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