wok-6.x view get-xnviewmp/stuff/get-xnviewmp @ rev 16790

Down zeromq (3.2.2.3)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jul 02 11:44:42 2014 +0200 (2014-07-02)
parents 0cfa77ea0a47
children 2759b1a5c165
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 mkdir -p xnviewmp/fs/usr/share/applications
37 mkdir -p xnviewmp/fs/usr/share/pixmaps
39 # use mv instead of 'cp -a' to save RAM
40 mv lib xnviewmp/fs/usr/lib/xnviewmp/
41 mv language xnviewmp/fs/usr/share/xnviewmp/
42 mv AddOn xnviewmp/fs/usr/lib/xnviewmp/
43 mv Plugins xnviewmp/fs/usr/lib/xnviewmp/
44 mv UI xnviewmp/fs/usr/lib/xnviewmp/
45 mv xnview xnviewmp/fs/usr/share/xnviewmp/
46 mv *.png xnviewmp/fs/usr/share/xnviewmp/
47 mv country.txt xnviewmp/fs/usr/lib/xnviewmp/
48 mv qt.conf xnviewmp/fs/usr/lib/xnviewmp/
49 cp -a xnviewmp/fs/usr/share/xnviewmp/xnview.png xnviewmp/fs/usr/share/pixmaps
51 cat > xnviewmp/fs/usr/bin/xnview <<EOT
52 #!/bin/sh
53 LD_LIBRARY_PATH=/usr/lib/xnviewmp/lib
54 export LD_LIBRARY_PATH
55 /usr/share/xnviewmp/xnview
56 EOT
57 chmod +x xnviewmp/fs/usr/bin/xnview
59 cat > xnviewmp/fs/usr/share/applications/XnView.desktop <<EOT
60 [Desktop Entry]
61 Encoding=UTF-8
62 Terminal=0
63 Exec=xnview
64 Icon=xnview
65 Type=Application
66 Categories=Graphics;
67 StartupNotify=true
68 Name=XnView Multi Platform
69 GenericName=XnViewMP
70 EOT
72 # Create pseudo package
73 cat > xnviewmp/receipt <<EOT
74 PACKAGE="xnviewmp"
75 VERSION="0.39"
76 CATEGORY="non-free"
77 SHORT_DESC="XnViewMP"
78 WEB_SITE="http://www.xnview.com"
79 DEPENDS=""
80 CONFIG_FILES=""
81 EOT
83 # Pack
84 tazpkg pack xnviewmp
86 # Install pseudo package
87 tazpkg install xnviewmp.tazpkg --root=$ROOT
88 cd ..
90 # Clean
91 rm -rf XnViewMP $TARBALL