wok view get-e-uae/stuff/get-e-uae @ rev 22335

updated zstd and zstd-dev (1.4.3 -> 1.4.4)
author Hans-G?nter Theisgen
date Fri Nov 15 16:17:53 2019 +0100 (2019-11-15)
parents
children 49bbb4b9da3c
line source
1 #!/bin/sh
2 #
3 # get-e-uae - create and install SliTaz package e-uae
4 #
5 # (C) 2019 SliTaz - GNU General Public License v3.
6 # Author : HGT
7 # created: 2019-10-24
8 #
10 # === Initialisations ===
12 PKGS_DB="/var/lib/tazpkg" # packages database directory
13 PACKAGE="e-uae" # package to create and install
14 WEB_SITE="http://www.rcdrummond.net/uae/"
15 CATEGORY="system-tools"
16 TAGS="emulator"
18 # Declare functions check_root, status, ...
19 . /lib/libtaz.sh
20 # and make commandline options (if any) available as variables
22 is_installed()
23 {
24 if [ -d $ROOT$PKGS_DB/installed/$PACKAGE ]
25 then #package is deemed to be installed
26 return 0
27 else
28 return 1
29 fi
30 }
33 # Show commandline options, if requested by --help
34 if [ "$help" == "yes" ]
35 then
36 echo "Commandline options:
37 $0
38 --version=<version>
39 --root=<path-to-root>
40 --install=yes|no
41 --keep=no|yes
42 --tmpdir=<directory-to-build-package>"
43 exit
44 fi
46 # Check for system administrator privileges
47 check_root
49 title "Package $PACKAGE will be build as SliTaz package and installed"
51 # Fetch latest version, unless version is set by option --version
52 [ -z "$version" ] && version="latest"
54 # Install SliTaz package, unless inhibited by option --install=no
55 [ -z "$install" ] && install="yes"
57 # Delete SliTaz package file $PACKAGE-$VERSION.tazpkg after installation,
58 # unless option --keep=yes is given
59 [ -z "$keep" ] && keep="no"
61 # Directory for temporary files
62 [ -z "$tempdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
64 # Logging file (unused by now)
65 LOG=$TMP_DIR/get-$PACKAGE.log
67 cat <<EOT
68 Options in use:
69 root : $root/
70 version : $version
71 install package: $install
72 keep tazpkg : $keep
73 build directory: $TMP_DIR
75 EOT
77 separator; newline
79 # === Remove package, if installed ===
80 if [ is_installed ]
81 then
82 action "Removing installed version..."
83 tazpkg remove $PACKAGE --root="$root/"
84 [ ! is_installed ] &&
85 die "Can't remove installed version. Exiting."
86 fi
88 # === Fetch archive file, if not existing ===
90 WGET_URL="https://snapshot.debian.org/archive/debian/20100605T162440Z/pool/contrib/e/$PACKAGE/"
92 if [ "$version" == "latest" ]
93 then
94 # wget --output-document=index $WGET_URL
95 # output to be scanned for latest version!
96 VERSION="0.8.29-WIP4-10"
97 else
98 VERSION=$version
99 fi
101 FILE="${PACKAGE}_${VERSION}_i386.deb"
102 WGET_URL="https://snapshot.debian.org/archive/debian/20100605T162440Z/pool/contrib/e/$PACKAGE/$FILE"
104 CUR_DIR=$(pwd)
105 mkdir -p $TMP_DIR
106 cd $TMP_DIR
107 if [ -f $FILE ]
108 then
109 echo "Using existing archive file $FILE"
110 else
111 action "Fetching the archive"
112 newline
113 wget --no-check-certificate $WGET_URL
114 if [ ! -f $FILE ]
115 then
116 cd $CUR_DIR
117 rm -rf $TMP_DIR
118 echo "Could not transfer $FILE from $WGET_URL. Exiting."
119 exit 1
120 fi
121 fi
123 action "Creating the package $PACKAGE..."
124 # Convert from Debian format
125 tazpkg convert $FILE
127 # === Install the SliTaz package ===
128 [ "$install" == "yes" ] &&
129 tazpkg install $PACKAGE-$VERSION.tazpkg --root="$root"
131 # === Cleanup ===
132 # Preserve package file, if requested
133 [ "$keep" == "yes" ] && mv $PACKAGE-$VERSION.tazpkg $CUR_DIR
135 # Remove temporary build directory
136 cd $CUR_DIR
137 rm -rf $TMP_DIR