gPodder 3.7.0 for Harmattan
[gpodder.git] / debian / postinst
blobfd5af1b203b3abe7c2cfc55ba9cfb376c1b8ece6
1 #!/bin/sh
3 # Optification - link stuff into /usr here
5 SYMLINKS=/opt/gpodder/optification.symlinks
7 # Clean up old leftover stuff from previous installs (gPodder bug 1672)
8 DIST_PACKAGES=/usr/lib/python2.6/dist-packages
9 echo "Checking for leftover files in $DIST_PACKAGES"
10 for directory in gpodder mygpoclient; do
11 directory=$DIST_PACKAGES/$directory
12 if [ -e $directory ]; then
13 echo " Removing $directory"
14 rm -rf $directory
16 done
18 rm -f $SYMLINKS
20 link_to() {
21 DESTDIR=$1
22 shift
24 mkdir -p $DESTDIR
25 echo "Symlinking files to $DESTDIR"
26 for file in $*; do
27 echo " $file"
28 ln -sf $file $DESTDIR
29 echo $DESTDIR/$(basename $file) >>$SYMLINKS
30 done
33 link_to /usr/bin /opt/gpodder/bin/*
34 link_to /usr/share /opt/gpodder/share/gpodder
35 link_to /usr/share/man/man1 /opt/gpodder/share/man/man1/*
36 link_to /usr/lib/python2.6/dist-packages/ /opt/gpodder/lib/python2.6/dist-packages/*
38 echo -n "Symlinking languages:"
39 for lang in /opt/gpodder/share/locale/*; do
40 echo -n " $(basename $lang)"
41 mkdir -p /usr/share/locale/$(basename $lang)/LC_MESSAGES
42 ln -sf $lang/LC_MESSAGES/gpodder.mo /usr/share/locale/$(basename $lang)/LC_MESSAGES/
43 echo /usr/share/locale/$(basename $lang)/LC_MESSAGES/gpodder.mo >> $SYMLINKS
44 done
45 echo " - OK"