wok rev 22835

modified get-flash-plugin
author Hans-G?nter Theisgen
date Mon Feb 10 10:39:19 2020 +0100 (20 months ago)
parents 75868251b117
children 079887dee9fb
files get-algobox/stuff/get-algobox get-bitcoin/stuff/get-bitcoin get-community-backgrounds/stuff/get-community-backgrounds get-dropbox/stuff/get-dropbox get-e-uae/stuff/get-e-uae get-flash-plugin/receipt get-flash-plugin/stuff/get-flash-plugin
line diff
     1.1 --- a/get-algobox/stuff/get-algobox	Sun Feb 09 16:49:37 2020 +0100
     1.2 +++ b/get-algobox/stuff/get-algobox	Mon Feb 10 10:39:19 2020 +0100
     1.3 @@ -4,7 +4,7 @@
     1.4  #
     1.5  # (C) 2020 SliTaz - GNU General Public License v3.
     1.6  # Author : unknown
     1.7 -# modified by HGT on 2020-01-28
     1.8 +# modified by HGT on 2020-02-10
     1.9  #
    1.10  #	=== Initialisations ===
    1.11  
    1.12 @@ -59,7 +59,8 @@
    1.13  [ -z "$keep" ] && keep="no"
    1.14  
    1.15  # Directory for temporary files
    1.16 -[ -z "$tempdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
    1.17 +TMP_DIR="$tmpdir"
    1.18 +[ -z "$tmpdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
    1.19  
    1.20  # Logging file (unused by now)
    1.21  LOG=$TMP_DIR/get-$PACKAGE.log
    1.22 @@ -77,7 +78,7 @@
    1.23  separator; newline
    1.24  
    1.25  #	=== Remove package, if installed ===
    1.26 -if [ is_installed ]
    1.27 +if is_installed
    1.28    then
    1.29  	action "Removing installed version..."
    1.30  	tazpkg remove $PACKAGE --root="$root/"
     2.1 --- a/get-bitcoin/stuff/get-bitcoin	Sun Feb 09 16:49:37 2020 +0100
     2.2 +++ b/get-bitcoin/stuff/get-bitcoin	Mon Feb 10 10:39:19 2020 +0100
     2.3 @@ -4,7 +4,7 @@
     2.4  #
     2.5  # (C) 2020 SliTaz - GNU General Public License v3.
     2.6  # Author : unknown
     2.7 -# modified by HGT on 2020-01-29
     2.8 +# modified by HGT on 2020-02-10
     2.9  #
    2.10  
    2.11  #	=== Initialisations ===
    2.12 @@ -60,7 +60,8 @@
    2.13  [ -z "$keep" ] && keep="no"
    2.14  
    2.15  # Directory for temporary files
    2.16 -[ -z "$tempdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
    2.17 +TMP_DIR="$tmpdir"
    2.18 +[ -z "$tmpdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
    2.19  
    2.20  # Logging file (unused by now)
    2.21  LOG=$TMP_DIR/get-$PACKAGE.log
    2.22 @@ -78,7 +79,7 @@
    2.23  separator; newline
    2.24  
    2.25  #	=== Remove package, if installed ===
    2.26 -if [ is_installed ]
    2.27 +if is_installed
    2.28    then
    2.29  	action "Removing installed version..."
    2.30  	tazpkg remove $PACKAGE --root="$root/"
     3.1 --- a/get-community-backgrounds/stuff/get-community-backgrounds	Sun Feb 09 16:49:37 2020 +0100
     3.2 +++ b/get-community-backgrounds/stuff/get-community-backgrounds	Mon Feb 10 10:39:19 2020 +0100
     3.3 @@ -4,7 +4,7 @@
     3.4  #
     3.5  # (C) 2020 SliTaz - GNU General Public License v3.
     3.6  # Author : Leonardo Laporte
     3.7 -# modified by HGT on 2020-01-29
     3.8 +# modified by HGT on 2020-02-10
     3.9  #
    3.10  
    3.11  #	=== Initialisations ===
    3.12 @@ -61,7 +61,8 @@
    3.13  [ -z "$keep" ] && keep="no"
    3.14  
    3.15  # Directory for temporary files
    3.16 -[ -z "$tempdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
    3.17 +TMP_DIR="$tmpdir"
    3.18 +[ -z "$tmpdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
    3.19  
    3.20  # Logging file (unused by now)
    3.21  LOG=$TMP_DIR/get-$PACKAGE.log
    3.22 @@ -79,7 +80,7 @@
    3.23  newline
    3.24  
    3.25  #	=== Remove package, if installed ===
    3.26 -if [ is_installed ]
    3.27 +if is_installed
    3.28    then
    3.29  	action "Removing installed version..."
    3.30  	newline
     4.1 --- a/get-dropbox/stuff/get-dropbox	Sun Feb 09 16:49:37 2020 +0100
     4.2 +++ b/get-dropbox/stuff/get-dropbox	Mon Feb 10 10:39:19 2020 +0100
     4.3 @@ -4,7 +4,7 @@
     4.4  #
     4.5  # (C) 2020 SliTaz - GNU General Public License v3.
     4.6  # Author : unknown
     4.7 -# modified by HGT on 2020-02-07
     4.8 +# modified by HGT on 2020-02-10
     4.9  #
    4.10  
    4.11  #	=== Initialisations ===
    4.12 @@ -59,7 +59,8 @@
    4.13  [ -z "$keep" ] && keep="no"
    4.14  
    4.15  # Directory for temporary files
    4.16 -[ -z "$tempdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
    4.17 +TMP_DIR="$tmpdir"
    4.18 +[ -z "$tmpdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
    4.19  
    4.20  # Logging file (unused by now)
    4.21  LOG=$TMP_DIR/get-$PACKAGE.log
    4.22 @@ -76,7 +77,7 @@
    4.23  separator; newline
    4.24  
    4.25  #	=== Remove package, if installed ===
    4.26 -if [ is_installed ]
    4.27 +if is_installed
    4.28    then
    4.29  	action "Removing installed version..."
    4.30  	tazpkg remove $PACKAGE --root="$root/"
     5.1 --- a/get-e-uae/stuff/get-e-uae	Sun Feb 09 16:49:37 2020 +0100
     5.2 +++ b/get-e-uae/stuff/get-e-uae	Mon Feb 10 10:39:19 2020 +0100
     5.3 @@ -2,9 +2,10 @@
     5.4  #
     5.5  # get-e-uae - create and install SliTaz package e-uae
     5.6  #
     5.7 -# (C) 2019 SliTaz - GNU General Public License v3.
     5.8 +# (C) 2020 SliTaz - GNU General Public License v3.
     5.9  # Author : HGT
    5.10  # created: 2019-10-24
    5.11 +# modified by HGT on 2020-02-08
    5.12  #
    5.13  
    5.14  #	=== Initialisations ===
    5.15 @@ -59,10 +60,12 @@
    5.16  [ -z "$keep" ] && keep="no"
    5.17  
    5.18  # Directory for temporary files
    5.19 -[ -z "$tempdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
    5.20 +TMP_DIR=$tmpdir
    5.21 +[ -z "$tmpdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
    5.22  
    5.23  # Logging file (unused by now)
    5.24 -LOG=$TMP_DIR/get-$PACKAGE.log
    5.25 +LOG=$logging_file
    5.26 +[ -z "$logging_file" ] && LOG=$TMP_DIR/get-$PACKAGE.log
    5.27  
    5.28  cat <<EOT
    5.29  Options in use:
    5.30 @@ -77,12 +80,23 @@
    5.31  separator; newline
    5.32  
    5.33  #	=== Remove package, if installed ===
    5.34 -if [ is_installed ]
    5.35 -	then
    5.36 -		action "Removing installed version..."
    5.37 -		tazpkg remove $PACKAGE --root="$root/"
    5.38 -		[ ! is_installed ] &&
    5.39 -		die "Can't remove installed version. Exiting."
    5.40 +if is_installed
    5.41 +  then
    5.42 +	echo "$PACKAGE is already installed."
    5.43 +	echo -n "Would you like to remove and reinstall this package [y/n]? "
    5.44 +	read answer
    5.45 +	case "$answer" in
    5.46 +		y|Y)
    5.47 +			action "Removing installed version..."
    5.48 +			tazpkg remove $PACKAGE --root="$root/"
    5.49 +			[ ! is_installed ] &&
    5.50 +			die "Can't remove installed version. Exiting."
    5.51 +			;;
    5.52 +		*)
    5.53 +			echo "Leaving $PACKAGE untouched."
    5.54 +			exit 0
    5.55 +			;;
    5.56 +	esac
    5.57  fi
    5.58  
    5.59  #	=== Fetch archive file, if not existing ===
    5.60 @@ -121,6 +135,7 @@
    5.61  fi
    5.62  
    5.63  action "Creating the package $PACKAGE..."
    5.64 +newline
    5.65  # Convert from Debian format
    5.66  tazpkg convert $FILE
    5.67  
    5.68 @@ -130,7 +145,9 @@
    5.69  
    5.70  #	=== Cleanup ===
    5.71  # Preserve package file, if requested
    5.72 -[ "$keep" == "yes" ] && mv $PACKAGE-$VERSION.tazpkg $CUR_DIR
    5.73 +[ "$keep" == "yes" ] &&
    5.74 +( mv $PACKAGE-$VERSION.tazpkg $CUR_DIR &&
    5.75 +  echo Saved $PACKAGE-$VERSION.tazpkg to $CUR_DIR )
    5.76  
    5.77  # Remove temporary build directory
    5.78  cd $CUR_DIR
     6.1 --- a/get-flash-plugin/receipt	Sun Feb 09 16:49:37 2020 +0100
     6.2 +++ b/get-flash-plugin/receipt	Mon Feb 10 10:39:19 2020 +0100
     6.3 @@ -1,18 +1,19 @@
     6.4  # SliTaz package receipt.
     6.5  
     6.6  PACKAGE="get-flash-plugin"
     6.7 -VERSION="1.6.0"
     6.8 +VERSION="1.6.1"
     6.9  CATEGORY="non-free"
    6.10 +TAGS="flash"
    6.11  SHORT_DESC="Get Adobe Flash Player."
    6.12  MAINTAINER="pascal.bellard@slitaz.org"
    6.13  LICENSE="BSD"
    6.14  WEB_SITE="http://www.adobe.com/products/flash/"
    6.15 +
    6.16  DEPENDS="libfirefox"
    6.17 -TAGS="flash"
    6.18  
    6.19  # Rules to gen a SliTaz package suitable for Tazpkg.
    6.20  genpkg_rules()
    6.21  {
    6.22  	mkdir -p $fs/usr/bin
    6.23 -	cp $stuff/get-flash-plugin $fs/usr/bin
    6.24 +	cp $stuff/get-flash-plugin	$fs/usr/bin
    6.25  }
     7.1 --- a/get-flash-plugin/stuff/get-flash-plugin	Sun Feb 09 16:49:37 2020 +0100
     7.2 +++ b/get-flash-plugin/stuff/get-flash-plugin	Mon Feb 10 10:39:19 2020 +0100
     7.3 @@ -1,69 +1,190 @@
     7.4 -#!/bin/sh -e
     7.5 +#!/bin/sh
     7.6 +#
     7.7 +# get-flash-plugin - create and install SliTaz package flash-plugin
     7.8 +#
     7.9 +# (C) 2020 SliTaz - GNU General Public License v3.
    7.10 +# Author : Pascal Bellard
    7.11 +# modified by HGT on 2020-02-10
    7.12 +#
    7.13  
    7.14 -[ -f '/etc/slitaz/slitaz.conf' ] && . /etc/slitaz/slitaz.conf
    7.15 -[ -z "$INSTALLED" ] && INSTALLED='/var/lib/tazpkg/installed'
    7.16 +#	=== Initialisations ===
    7.17  
    7.18 +PKGS_DB="/var/lib/tazpkg"	# packages database directory
    7.19  PACKAGE="flash-plugin"
    7.20 -WEB_SITE="http://www.adobe.com/products/flash/"
    7.21  SHORT_DESC="Adobe Flash Player."
    7.22 -ROOT="$1"
    7.23 -[ -d "$ROOT" ] || ROOT=""
    7.24 +CATEGORY="non-free"
    7.25 +LICENSE="non-free"
    7.26 +WEB_SITE="https://www.adobe.com/products/flashplayer/"
    7.27  
    7.28 -if [ $(id -u) -ne 0 ]; then
    7.29 -	echo -e "\nYou must be root to run `basename $0`."
    7.30 -	echo -e "Please type 'su' and root password to become super-user.\n"
    7.31 -	exit 0
    7.32 +DEPENDS="atk cairo curl expat fontconfig freetype glib gtk+ libfirefox libpng \
    7.33 +	nss pango pixman xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \
    7.34 +	xorg-libXcursor xorg-libXdamage xorg-libXdmcp xorg-libXext xorg-libXfixes \
    7.35 +	xorg-libXinerama xorg-libXrandr xorg-libXrender xorg-libXt zlib"
    7.36 +
    7.37 +# Declare functions check_root, status, ...
    7.38 +. /lib/libtaz.sh
    7.39 +# and make commandline options (if any) available as variables
    7.40 +
    7.41 +is_installed()
    7.42 +{
    7.43 +	if [ -d $ROOT$PKGS_DB/installed/$PACKAGE ]
    7.44 +	  then	#package is deemed to be installed
    7.45 +	 	return 0
    7.46 +	  else
    7.47 +	 	return 1
    7.48 +	 fi
    7.49 +}
    7.50 +
    7.51 +# Show commandline options, if requested by --help
    7.52 +if [ "$help" == "yes" ]
    7.53 +  then
    7.54 +	echo "Commandline options:
    7.55 +  $0
    7.56 +	--version=<version>
    7.57 +	--root=<path-to-root>
    7.58 +	--install=yes|no
    7.59 +	--keep=no|yes
    7.60 +	--tmpdir=<directory-to-build-package>"
    7.61 +	exit
    7.62  fi
    7.63  
    7.64 -if [ -d $ROOT$INSTALLED/$PACKAGE ]; then
    7.65 -	[ -n "$ROOT" ] && exit 1
    7.66 -	tazpkg remove $PACKAGE
    7.67 -	[ -d $INSTALLED/$PACKAGE ] && exit 1
    7.68 -fi
    7.69 -VERSION="$(wget -q -O - http://www.adobe.com/software/flash/about/ | sed -n '/Linux/,/<\/tr/s/[^>]*>\([0-9].*\)<.*/\1/p')"
    7.70 -TARBALL="flash_player_npapi_linux.i386.tar.gz"
    7.71 -URL="https://fpdownload.adobe.com/get/flashplayer/pdc/$VERSION/$TARBALL"
    7.72 -TMP_DIR="$(mktemp -d)"
    7.73 -CUR_DIR=$(pwd)
    7.74 -cd $TMP_DIR
    7.75 -wget --no-check-certificate -O $TARBALL $URL
    7.76 +# Check for system administrator privileges
    7.77 +check_root
    7.78  
    7.79 -if [ ! -f $TARBALL ]; then
    7.80 -	echo "Could not download $TARBALL. Exiting."
    7.81 -	exit 1
    7.82 +title "Package $PACKAGE will be build as SliTaz package and installed"
    7.83 +
    7.84 +# Fetch latest version, unless version is set by option --version
    7.85 +[ -z "$version" ] && version="latest"
    7.86 +
    7.87 +# Install SliTaz package, unless inhibited by option --install=no
    7.88 +[ -z "$install" ] && install="yes"
    7.89 +
    7.90 +# Delete SliTaz package file $PACKAGE-$VERSION.tazpkg after installation,
    7.91 +# unless option --keep=yes is given
    7.92 +[ -z "$keep" ] && keep="no"
    7.93 +
    7.94 +# Directory for temporary files
    7.95 +TMP_DIR="$tmpdir"
    7.96 +[ -z "$tmpdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
    7.97 +
    7.98 +# Logging file (unused by now)
    7.99 +LOG=$TMP_DIR/get-$PACKAGE.log
   7.100 +
   7.101 +cat <<EOT
   7.102 +Options in use:
   7.103 +  root           : $root/
   7.104 +  version        : $version
   7.105 +  install package: $install
   7.106 +  keep tazpkg    : $keep
   7.107 +  build directory: $TMP_DIR
   7.108 +
   7.109 +EOT
   7.110 +
   7.111 +separator; newline
   7.112 +
   7.113 +#	=== Remove package, if installed ===
   7.114 +if is_installed
   7.115 +  then
   7.116 +	echo "$PACKAGE is already installed."
   7.117 +	echo -n "Would you like to remove and reinstall this package [y/n]? "
   7.118 +	read answer
   7.119 +	case "$answer" in
   7.120 +		y|Y)
   7.121 +			action "Removing installed version..."
   7.122 +			tazpkg remove $PACKAGE --root="$root/"
   7.123 +			[ ! is_installed ] &&
   7.124 +			die "Can't remove installed version. Exiting."
   7.125 +			;;
   7.126 +		*)
   7.127 +			echo "Leaving $PACKAGE untouched."
   7.128 +			exit 0
   7.129 +			;;
   7.130 +	esac
   7.131  fi
   7.132  
   7.133 -tar xzf $TARBALL
   7.134 +#	=== Fetch archive file, if not existing ===
   7.135 +if [ "$version" == "latest" ]
   7.136 +  then
   7.137 +	VERSION="$(wget --no-check-certificate -q -O - \
   7.138 +		https://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html |\
   7.139 +		sed -n '/Released /p' | head -1 | sed 's|.*fp_\(.*\)_archive.*|\1|')"
   7.140 +  else
   7.141 +	VERSION=$version
   7.142 +fi
   7.143 +FILE="fp_${VERSION}_archive.zip"
   7.144 +WGET_URL="https://fpdownload.macromedia.com/pub/flashplayer/installers/archive/$FILE"
   7.145 +
   7.146 +CUR_DIR=$(pwd)
   7.147 +mkdir -p $TMP_DIR
   7.148 +cd $TMP_DIR
   7.149 +if [ -f $FILE ]
   7.150 +  then
   7.151 +	echo "Using existing archive file $FILE"
   7.152 +  else
   7.153 +	action "Fetching the archive"
   7.154 +	newline
   7.155 +	wget	--no-check-certificate $WGET_URL
   7.156 +	if [ ! -f $FILE ]
   7.157 +	  then
   7.158 +		cd $CUR_DIR
   7.159 +		rm -rf $TMP_DIR
   7.160 +		echo "Could not transfer $FILE from $WGET_URL. Exiting."
   7.161 +		exit 1
   7.162 +	fi
   7.163 +fi
   7.164 +
   7.165 +#	=== Extract files from archive ===
   7.166 +action "Extracting the archive"
   7.167 +newline
   7.168 +
   7.169 +mkdir $PACKAGE
   7.170 +cd $PACKAGE
   7.171 +unzip $TMP_DIR/$FILE *linux.i386.tar.gz
   7.172 +tar xf */*linux.i386.tar.gz 
   7.173 +status
   7.174 +
   7.175 +# Remove archive file
   7.176 +cd $TMP_DIR
   7.177 +rm -f $FILE
   7.178  
   7.179  # Install files
   7.180 -chmod 755 libflashplayer.so
   7.181 -chown root.root libflashplayer.so
   7.182  fs=$PACKAGE-$VERSION/fs
   7.183  mkdir -p $fs/usr/share/flash
   7.184 -mv libflashplayer.so $fs/usr/share/flash
   7.185 -mv usr/bin $fs/usr
   7.186 -mv usr/share/icons $fs/usr/share
   7.187 -mv usr/share/pixmaps $fs/usr/share
   7.188 -mv usr/share/applications $fs/usr/share
   7.189 +
   7.190 +mv $PACKAGE/libflashplayer.so		$fs/usr/share/flash
   7.191 +chmod 755 				$fs/usr/share/flash/libflashplayer.so
   7.192 +chown root.root				$fs/usr/share/flash/libflashplayer.so
   7.193 +mv $PACKAGE/usr/bin			$fs/usr
   7.194 +mv $PACKAGE/usr/share/icons		$fs/usr/share
   7.195 +mv $PACKAGE/usr/share/pixmaps		$fs/usr/share
   7.196 +mv $PACKAGE/usr/share/applications	$fs/usr/share
   7.197  
   7.198  # Sanity Check: Reexport firefox libraries if they don't exist
   7.199  dir=$PACKAGE-$VERSION/fs/usr/lib
   7.200  mkdir -p $dir
   7.201 -for i in /usr/lib/firefox/*.so ; do
   7.202 -	[ -f $i ] && [ -z "$(ls /usr/lib/$(basename $i))" ] && ln -s $i $dir
   7.203 -done
   7.204 +for i in /usr/lib/firefox/*.so
   7.205 +  do
   7.206 +	[ -f $i ] &&
   7.207 +	[ -z "$(ls /usr/lib/$(basename $i))" ] &&
   7.208 +	ln -s $i $dir
   7.209 +  done
   7.210  
   7.211 -# Create pseudo package
   7.212 -cat > $PACKAGE-$VERSION/receipt <<EOT
   7.213 +#	=== Create SliTaz package ===
   7.214 +
   7.215 +cd $PACKAGE-$VERSION
   7.216 +
   7.217 +# Create recipe for SliTaz package
   7.218 +cat > receipt <<EOT
   7.219 +# SliTaz package receipt.
   7.220 +
   7.221  PACKAGE="$PACKAGE"
   7.222  VERSION="$VERSION"
   7.223 -CATEGORY="non-free"
   7.224 +CATEGORY="$CATEGORY"
   7.225  SHORT_DESC="$SHORT_DESC"
   7.226 +LICENSE="$LICENSE"
   7.227  WEB_SITE="$WEB_SITE"
   7.228 -DEPENDS="libfirefox curl atk cairo expat fontconfig freetype glib gtk+ libpng \
   7.229 -nss pango pixman xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \
   7.230 -xorg-libXcursor xorg-libXdamage xorg-libXdmcp xorg-libXext xorg-libXfixes \
   7.231 -xorg-libXinerama xorg-libXrandr xorg-libXrender xorg-libXt zlib"
   7.232 +
   7.233 +DEPENDS="$DEPENDS"
   7.234  
   7.235  post_install()
   7.236  {
   7.237 @@ -83,15 +204,24 @@
   7.238  }
   7.239  EOT
   7.240  
   7.241 +cd $TMP_DIR
   7.242 +
   7.243 +action "Creating the package $PACKAGE..."
   7.244  # Pack
   7.245  tazpkg pack $PACKAGE-$VERSION
   7.246 +# Remove package tree
   7.247 +rm -rf $PACKAGE-$VERSION
   7.248  
   7.249 -# Install pseudo package
   7.250 -tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
   7.251 -case " $@ " in
   7.252 -*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
   7.253 -esac
   7.254 +#	=== Install the SliTaz package ===
   7.255 +[ "$install" == "yes" ] &&
   7.256 +tazpkg install $PACKAGE-$VERSION.tazpkg --root="$root"
   7.257  
   7.258 -# Clean
   7.259 +#	=== Cleanup ===
   7.260 +# Preserve package file, if requested
   7.261 +[ "$keep" == "yes" ] &&
   7.262 +( mv $PACKAGE-$VERSION.tazpkg $CUR_DIR &&
   7.263 +  echo Saved $PACKAGE-$VERSION.tazpkg to $CUR_DIR )
   7.264 +
   7.265 +# Remove temporary build directory
   7.266  cd $CUR_DIR
   7.267 -rm -rf "$TMP_DIR"
   7.268 +rm -rf $TMP_DIR