wok diff get-e-uae/stuff/get-e-uae @ rev 22717

updated fcron (3.0.4 -> 3.2.1)
author Hans-G?nter Theisgen
date Wed Jan 22 15:57:11 2020 +0100 (2020-01-22)
parents
children 49bbb4b9da3c
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/get-e-uae/stuff/get-e-uae	Wed Jan 22 15:57:11 2020 +0100
     1.3 @@ -0,0 +1,137 @@
     1.4 +#!/bin/sh
     1.5 +#
     1.6 +# get-e-uae - create and install SliTaz package e-uae
     1.7 +#
     1.8 +# (C) 2019 SliTaz - GNU General Public License v3.
     1.9 +# Author : HGT
    1.10 +# created: 2019-10-24
    1.11 +#
    1.12 +
    1.13 +#	=== Initialisations ===
    1.14 +
    1.15 +PKGS_DB="/var/lib/tazpkg"	# packages database directory
    1.16 +PACKAGE="e-uae"			# package to create and install
    1.17 +WEB_SITE="http://www.rcdrummond.net/uae/"
    1.18 +CATEGORY="system-tools"
    1.19 +TAGS="emulator"
    1.20 +
    1.21 +# Declare functions check_root, status, ...
    1.22 +. /lib/libtaz.sh
    1.23 +# and make commandline options (if any) available as variables
    1.24 +
    1.25 +is_installed()
    1.26 +{
    1.27 +	 if [ -d $ROOT$PKGS_DB/installed/$PACKAGE ]
    1.28 +	  then	#package is deemed to be installed
    1.29 +	 	return 0
    1.30 +	  else
    1.31 +	 	return 1
    1.32 +	 fi
    1.33 +}
    1.34 +
    1.35 +
    1.36 +# Show commandline options, if requested by --help
    1.37 +if [ "$help" == "yes" ]
    1.38 +	then
    1.39 +	echo "Commandline options:
    1.40 +  $0
    1.41 +	--version=<version>
    1.42 +	--root=<path-to-root>
    1.43 +	--install=yes|no
    1.44 +	--keep=no|yes
    1.45 +	--tmpdir=<directory-to-build-package>"
    1.46 +	exit
    1.47 +fi
    1.48 +
    1.49 +# Check for system administrator privileges
    1.50 +check_root
    1.51 +
    1.52 +title "Package $PACKAGE will be build as SliTaz package and installed"
    1.53 +
    1.54 +# Fetch latest version, unless version is set by option --version
    1.55 +[ -z "$version" ] && version="latest"
    1.56 +
    1.57 +# Install SliTaz package, unless inhibited by option --install=no
    1.58 +[ -z "$install" ] && install="yes"
    1.59 +
    1.60 +# Delete SliTaz package file $PACKAGE-$VERSION.tazpkg after installation,
    1.61 +# unless option --keep=yes is given
    1.62 +[ -z "$keep" ] && keep="no"
    1.63 +
    1.64 +# Directory for temporary files
    1.65 +[ -z "$tempdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
    1.66 +
    1.67 +# Logging file (unused by now)
    1.68 +LOG=$TMP_DIR/get-$PACKAGE.log
    1.69 +
    1.70 +cat <<EOT
    1.71 +Options in use:
    1.72 +  root           : $root/
    1.73 +  version        : $version
    1.74 +  install package: $install
    1.75 +  keep tazpkg    : $keep
    1.76 +  build directory: $TMP_DIR
    1.77 +
    1.78 +EOT
    1.79 +
    1.80 +separator; newline
    1.81 +
    1.82 +#	=== Remove package, if installed ===
    1.83 +if [ is_installed ]
    1.84 +	then
    1.85 +		action "Removing installed version..."
    1.86 +		tazpkg remove $PACKAGE --root="$root/"
    1.87 +		[ ! is_installed ] &&
    1.88 +		die "Can't remove installed version. Exiting."
    1.89 +fi
    1.90 +
    1.91 +#	=== Fetch archive file, if not existing ===
    1.92 +
    1.93 +WGET_URL="https://snapshot.debian.org/archive/debian/20100605T162440Z/pool/contrib/e/$PACKAGE/"
    1.94 +
    1.95 +if [ "$version" == "latest" ]
    1.96 +  then
    1.97 +	# wget --output-document=index $WGET_URL
    1.98 +	# output to be scanned for latest version!
    1.99 +	VERSION="0.8.29-WIP4-10"
   1.100 +  else
   1.101 +	VERSION=$version
   1.102 +fi
   1.103 +
   1.104 +FILE="${PACKAGE}_${VERSION}_i386.deb"
   1.105 +WGET_URL="https://snapshot.debian.org/archive/debian/20100605T162440Z/pool/contrib/e/$PACKAGE/$FILE"
   1.106 +
   1.107 +CUR_DIR=$(pwd)
   1.108 +mkdir -p $TMP_DIR
   1.109 +cd $TMP_DIR
   1.110 +if [ -f $FILE ]
   1.111 +	then
   1.112 +		echo "Using existing archive file $FILE"
   1.113 +	else
   1.114 +		action "Fetching the archive"
   1.115 +		newline
   1.116 +		wget	--no-check-certificate $WGET_URL
   1.117 +		if [ ! -f $FILE ]
   1.118 +		  then
   1.119 +			cd $CUR_DIR
   1.120 +			rm -rf $TMP_DIR
   1.121 +			echo "Could not transfer $FILE from $WGET_URL. Exiting."
   1.122 +			exit 1
   1.123 +		fi
   1.124 +fi
   1.125 +
   1.126 +action "Creating the package $PACKAGE..."
   1.127 +# Convert from Debian format
   1.128 +tazpkg convert $FILE
   1.129 +
   1.130 +#	=== Install the SliTaz package ===
   1.131 +[ "$install" == "yes" ] &&
   1.132 +tazpkg install $PACKAGE-$VERSION.tazpkg --root="$root"
   1.133 +
   1.134 +#	=== Cleanup ===
   1.135 +# Preserve package file, if requested
   1.136 +[ "$keep" == "yes" ] && mv $PACKAGE-$VERSION.tazpkg $CUR_DIR
   1.137 +
   1.138 +# Remove temporary build directory
   1.139 +cd $CUR_DIR
   1.140 +rm -rf $TMP_DIR