wok-stable view get-xnviewmp/stuff/get-xnviewmp @ rev 4813

Up: claws-mail-spam_report(0.3.10)
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Tue Jan 19 01:07:42 2010 +0100 (2010-01-19)
parents 126bfa34502c
children e5dde73f1ac9
line source
1 #!/bin/sh -e
3 ROOT="$1"
5 if test $(id -u) != 0 ; then
6 echo -e "\nYou must be root to run `basename $0`."
7 echo -e "Please type 'su' and root password to become super-user.\n"
8 exit 0
9 fi
11 if [ -d $ROOT/var/lib/tazpkg/installed/xnviewmp ]; then
12 [ -n "$ROOT" ] && exit 1
13 tazpkg remove xnviewmp
14 [ -d /var/lib/tazpkg/installed/xnviewmp ] && exit 1
15 fi
16 [ -d $ROOT/usr/share/xnviewmp ] && rm -rf $ROOT/usr/share/xnviewmp
18 # Download tarball
19 WEB_SITE="http://download.xnview.com"
20 wget ${WEB_SITE}/XnViewMP-linux.tgz
21 if [ ! -f $TARBALL ]; then
22 rm -rf XnViewMP
23 echo "Could not download $TARBALL. Exiting."
24 exit 1
25 fi
27 # Extract
28 TARBALL=$(ls XnView*.tgz 2> /dev/null || true)
29 tar xzf $TARBALL
30 cd XnViewMP
32 # Install files
33 mkdir -p xnviewmp/fs/usr/bin
34 mkdir -p xnviewmp/fs/usr/lib/xnviewmp/
35 mkdir -p xnviewmp/fs/usr/share/xnviewmp/
36 cp -a lib* xnviewmp/fs/usr/lib/xnviewmp/
37 cp -a phonon_backend xnviewmp/fs/usr/lib/xnviewmp/
38 cp -a language xnviewmp/fs/usr/share/xnviewmp/
39 cp -a xnview xnviewmp/fs/usr/share/xnviewmp/
40 cat > xnviewmp/fs/usr/bin/xnview <<EOT
41 #!/bin/sh
42 LD_LIBRARY_PATH=/usr/lib/xnviewmp/
43 export LD_LIBRARY_PATH
44 /usr/share/xnviewmp/xnview
45 EOT
46 chmod +x xnviewmp/fs/usr/bin/xnview
48 # Create pseudo package
49 cat > xnviewmp/receipt <<EOT
50 PACKAGE="xnviewmp"
51 VERSION="0.12"
52 CATEGORY="non-free"
53 SHORT_DESC="XnViewMP"
54 WEB_SITE="http://www.xnview.com"
55 DEPENDS=""
56 CONFIG_FILES=""
57 EOT
59 # Pack
60 tazpkg pack xnviewmp
62 # Install pseudo package
63 tazpkg install xnviewmp.tazpkg --root=$ROOT
64 cd ..
66 # Clean
67 rm -rf XnViewMP $TARBALL