wok-6.x view get-xnviewmp/stuff/get-xnviewmp @ rev 24731
updated libdvdread and libdvdread-dev (6.0.2 -> 6.1.2)
author | Hans-G?nter Theisgen |
---|---|
date | Tue Mar 15 17:30:53 2022 +0100 (2022-03-15) |
parents | 5c7b8562fb97 |
children |
line source
1 #!/bin/sh -e
3 ROOT="$1"
5 # Test for administrator privilege
6 if test $(id -u) != 0 ; then
7 echo -e "\nYou must be root to run `basename $0`."
8 echo -e "Please type 'su' and root password to become super-user.\n"
9 exit 0
10 fi
12 # Already installed?
13 if [ -d $ROOT/var/lib/tazpkg/installed/xnviewmp ]; then
14 [ -n "$ROOT" ] && exit 1
15 tazpkg remove xnviewmp
16 [ -d /var/lib/tazpkg/installed/xnviewmp ] && exit 1
17 fi
19 [ -d $ROOT/usr/share/xnviewmp ] && rm -rf $ROOT/usr/share/xnviewmp
21 # Download tarball
22 WEB_SITE="https://download.xnview.com"
23 wget --no-check-certificate ${WEB_SITE}/XnViewMP-linux.tgz
24 if [ ! -f $TARBALL ]; then
25 rm -rf XnView
26 echo "Could not download $TARBALL. Exiting."
27 exit 1
28 fi
30 # Extract
31 TARBALL=$(ls XnView*.tgz 2> /dev/null || true)
32 tar xzf $TARBALL
34 cd XnView
36 # Create directories for packaging
37 mkdir -p xnviewmp/fs/usr/bin
38 mkdir -p xnviewmp/fs/usr/lib/xnviewmp/
39 mkdir -p xnviewmp/fs/usr/share/xnviewmp/
40 mkdir -p xnviewmp/fs/usr/share/applications
41 mkdir -p xnviewmp/fs/usr/share/pixmaps
43 # Install files
44 # use mv instead of 'cp -a' to save space
45 mv lib xnviewmp/fs/usr/lib/xnviewmp/
46 mv language xnviewmp/fs/usr/share/xnviewmp/
47 mv AddOn xnviewmp/fs/usr/lib/xnviewmp/
48 mv Plugins xnviewmp/fs/usr/lib/xnviewmp/
49 mv UI xnviewmp/fs/usr/lib/xnviewmp/
50 mv XnView xnviewmp/fs/usr/share/xnviewmp/xnview
51 mv *.png xnviewmp/fs/usr/share/xnviewmp/
52 mv country.txt xnviewmp/fs/usr/lib/xnviewmp/
53 mv qt.conf xnviewmp/fs/usr/lib/xnviewmp/
54 cp -a xnviewmp/fs/usr/share/xnviewmp/xnview.png \
55 xnviewmp/fs/usr/share/pixmaps
56 # Not all files from the tarball are owned by root
57 chown -R root:root xnviewmp/fs
58 # Not all libraries from the tarball are executable
59 find xnviewmp/fs -name "*.so*" -exec chmod +x {} ';'
61 # Create command procedure
62 cat > xnviewmp/fs/usr/bin/xnview <<EOT
63 #!/bin/sh
64 export LD_LIBRARY_PATH=/usr/lib/xnviewmp/lib
65 export QT_PLUGIN_PATH=/usr/lib/xnviewmp/lib
66 /usr/share/xnviewmp/xnview
67 EOT
68 chmod +x xnviewmp/fs/usr/bin/xnview
70 # Create desktop file
71 cat > xnviewmp/fs/usr/share/applications/XnView.desktop <<EOT
72 [Desktop Entry]
73 Encoding=UTF-8
74 Terminal=0
75 Exec=xnview
76 Icon=xnview
77 Type=Application
78 Categories=Graphics;
79 StartupNotify=true
80 Name=XnView Multi Platform
81 GenericName=XnViewMP
82 EOT
84 # Create pseudo package recipe
85 # Version is correct as on 2019-04-03
86 # Is there no way to retrieve the version from the tarball?
87 cat > xnviewmp/receipt <<EOT
88 PACKAGE="xnviewmp"
89 VERSION="0.89"
90 CATEGORY="non-free"
91 SHORT_DESC="An Efficient Multimedia Viewer, Browser and Converter."
92 WEB_SITE="https://www.xnview.com"
93 DEPENDS="mesa-wayland"
94 CONFIG_FILES=""
95 EOT
97 # Pack
98 tazpkg pack xnviewmp
100 # Install pseudo package
101 tazpkg install xnviewmp.tazpkg --root=$ROOT
102 cd ..
104 # Clean
105 rm -rf XnView $TARBALL