wok-current rev 22062
created package get-e-uae
author | Hans-G?nter Theisgen |
---|---|
date | Thu Oct 24 16:40:55 2019 +0100 (2019-10-24) |
parents | 1fd43dd7ebcb |
children | 487e1c66b9ed |
files | get-e-uae/receipt get-e-uae/stuff/get-e-uae |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/get-e-uae/receipt Thu Oct 24 16:40:55 2019 +0100 1.3 @@ -0,0 +1,17 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="get-e-uae" 1.7 +VERSION="1.00" 1.8 +CATEGORY="system-tools" 1.9 +TAGS="emulator" 1.10 +SHORT_DESC="Get Enhanced Ubiquitous Amiga Emulator." 1.11 +MAINTAINER="maintainer@slitaz.org" 1.12 +LICENSE="GPL2" 1.13 +WEB_SITE="http://www.rcdrummond.net/uae/" 1.14 + 1.15 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.16 +genpkg_rules() 1.17 +{ 1.18 + mkdir -p $fs/usr/bin 1.19 + cp stuff/get-e-uae $fs/usr/bin 1.20 +}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/get-e-uae/stuff/get-e-uae Thu Oct 24 16:40:55 2019 +0100 2.3 @@ -0,0 +1,137 @@ 2.4 +#!/bin/sh 2.5 +# 2.6 +# get-e-uae - create and install SliTaz package e-uae 2.7 +# 2.8 +# (C) 2019 SliTaz - GNU General Public License v3. 2.9 +# Author : HGT 2.10 +# created: 2019-10-24 2.11 +# 2.12 + 2.13 +# === Initialisations === 2.14 + 2.15 +PKGS_DB="/var/lib/tazpkg" # packages database directory 2.16 +PACKAGE="e-uae" # package to create and install 2.17 +WEB_SITE="http://www.rcdrummond.net/uae/" 2.18 +CATEGORY="system-tools" 2.19 +TAGS="emulator" 2.20 + 2.21 +# Declare functions check_root, status, ... 2.22 +. /lib/libtaz.sh 2.23 +# and make commandline options (if any) available as variables 2.24 + 2.25 +is_installed() 2.26 +{ 2.27 + if [ -d $ROOT$PKGS_DB/installed/$PACKAGE ] 2.28 + then #package is deemed to be installed 2.29 + return 0 2.30 + else 2.31 + return 1 2.32 + fi 2.33 +} 2.34 + 2.35 + 2.36 +# Show commandline options, if requested by --help 2.37 +if [ "$help" == "yes" ] 2.38 + then 2.39 + echo "Commandline options: 2.40 + $0 2.41 + --version=<version> 2.42 + --root=<path-to-root> 2.43 + --install=yes|no 2.44 + --keep=no|yes 2.45 + --tmpdir=<directory-to-build-package>" 2.46 + exit 2.47 +fi 2.48 + 2.49 +# Check for system administrator privileges 2.50 +check_root 2.51 + 2.52 +title "Package $PACKAGE will be build as SliTaz package and installed" 2.53 + 2.54 +# Fetch latest version, unless version is set by option --version 2.55 +[ -z "$version" ] && version="latest" 2.56 + 2.57 +# Install SliTaz package, unless inhibited by option --install=no 2.58 +[ -z "$install" ] && install="yes" 2.59 + 2.60 +# Delete SliTaz package file $PACKAGE-$VERSION.tazpkg after installation, 2.61 +# unless option --keep=yes is given 2.62 +[ -z "$keep" ] && keep="no" 2.63 + 2.64 +# Directory for temporary files 2.65 +[ -z "$tempdir" ] && TMP_DIR="/tmp/get-$PACKAGE" 2.66 + 2.67 +# Logging file (unused by now) 2.68 +LOG=$TMP_DIR/get-$PACKAGE.log 2.69 + 2.70 +cat <<EOT 2.71 +Options in use: 2.72 + root : $root/ 2.73 + version : $version 2.74 + install package: $install 2.75 + keep tazpkg : $keep 2.76 + build directory: $TMP_DIR 2.77 + 2.78 +EOT 2.79 + 2.80 +separator; newline 2.81 + 2.82 +# === Remove package, if installed === 2.83 +if [ is_installed ] 2.84 + then 2.85 + action "Removing installed version..." 2.86 + tazpkg remove $PACKAGE --root="$root/" 2.87 + [ ! is_installed ] && 2.88 + die "Can't remove installed version. Exiting." 2.89 +fi 2.90 + 2.91 +# === Fetch archive file, if not existing === 2.92 + 2.93 +WGET_URL="https://snapshot.debian.org/archive/debian/20100605T162440Z/pool/contrib/e/$PACKAGE/" 2.94 + 2.95 +if [ "$version" == "latest" ] 2.96 + then 2.97 + # wget --output-document=index $WGET_URL 2.98 + # output to be scanned for latest version! 2.99 + VERSION="0.8.29-WIP4-10" 2.100 + else 2.101 + VERSION=$version 2.102 +fi 2.103 + 2.104 +FILE="${PACKAGE}_${VERSION}_i386.deb" 2.105 +WGET_URL="https://snapshot.debian.org/archive/debian/20100605T162440Z/pool/contrib/e/$PACKAGE/$FILE" 2.106 + 2.107 +CUR_DIR=$(pwd) 2.108 +mkdir -p $TMP_DIR 2.109 +cd $TMP_DIR 2.110 +if [ -f $FILE ] 2.111 + then 2.112 + echo "Using existing archive file $FILE" 2.113 + else 2.114 + action "Fetching the archive" 2.115 + newline 2.116 + wget --no-check-certificate $WGET_URL 2.117 + if [ ! -f $FILE ] 2.118 + then 2.119 + cd $CUR_DIR 2.120 + rm -rf $TMP_DIR 2.121 + echo "Could not transfer $FILE from $WGET_URL. Exiting." 2.122 + exit 1 2.123 + fi 2.124 +fi 2.125 + 2.126 +action "Creating the package $PACKAGE..." 2.127 +# Convert from Debian format 2.128 +tazpkg convert $FILE 2.129 + 2.130 +# === Install the SliTaz package === 2.131 +[ "$install" == "yes" ] && 2.132 +tazpkg install $PACKAGE-$VERSION.tazpkg --root="$root" 2.133 + 2.134 +# === Cleanup === 2.135 +# Preserve package file, if requested 2.136 +[ "$keep" == "yes" ] && mv $PACKAGE-$VERSION.tazpkg $CUR_DIR 2.137 + 2.138 +# Remove temporary build directory 2.139 +cd $CUR_DIR 2.140 +rm -rf $TMP_DIR