wok rev 25121

created recipe for get-OpenOffice
author Hans-G?nter Theisgen
date Mon Jun 27 15:00:45 2022 +0100 (22 months ago)
parents d521a8fdb812
children 8bbdfd03ccf3
files get-OpenOffice/receipt get-OpenOffice/stuff/get-OpenOffice keepassx/receipt
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/get-OpenOffice/receipt	Mon Jun 27 15:00:45 2022 +0100
     1.3 @@ -0,0 +1,26 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="get-OpenOffice"
     1.7 +VERSION="1.00"
     1.8 +CATEGORY="office"
     1.9 +TAGS="office word excel ppt openoffice"
    1.10 +SHORT_DESC="Productivity suite."
    1.11 +MAINTAINER="maintainer@slitaz.org"
    1.12 +LICENSE="GPL3"
    1.13 +WEB_SITE="https://openoffice.org"
    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 +	install -o root -g root -m755 stuff/get-OpenOffice	$fs/usr/bin
    1.20 +	ln -s get-OpenOffice $fs/usr/bin/get-openoffice
    1.21 +}
    1.22 +
    1.23 +post_install()
    1.24 +{
    1.25 +	echo "Now you may enter:
    1.26 +get-openoffice
    1.27 +or
    1.28 +get-openoffice --help"
    1.29 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/get-OpenOffice/stuff/get-OpenOffice	Mon Jun 27 15:00:45 2022 +0100
     2.3 @@ -0,0 +1,241 @@
     2.4 +#!/bin/sh
     2.5 +# get-OpenOffice, install everything for OpenOffice except KDE and Gnome integration and testsuite.
     2.6 +#
     2.7 +# (C) 2022 SliTaz - GNU General Public License v3.
     2.8 +#
     2.9 +# Author : HGT
    2.10 +#
    2.11 +
    2.12 +#	=== Initialisations ===
    2.13 +
    2.14 +PKGS_DB="/var/lib/tazpkg"	# packages database directory
    2.15 +PACKAGE="OpenOffice"
    2.16 +CATEGORY="office"
    2.17 +SHORT_DESC="Productivity suite."
    2.18 +MAINTAINER="nobody@slitaz.org"
    2.19 +LICENSE="Apache"
    2.20 +WEB_SITE="https://www.openoffice.org"
    2.21 +
    2.22 +EXCLUDE="kde|gnome|test|onlineupdate"
    2.23 +
    2.24 +# Declare functions check_root, status, ...
    2.25 +. /lib/libtaz.sh
    2.26 +# and make commandline options (if any) available as variables
    2.27 +
    2.28 +is_installed()
    2.29 +{
    2.30 +	if [ -d $ROOT$PKGS_DB/installed/$PACKAGE ]
    2.31 +	  then	#package is deemed to be installed
    2.32 +	 	return 0
    2.33 +	  else
    2.34 +	 	return 1
    2.35 +	 fi
    2.36 +}
    2.37 +
    2.38 +# Show commandline options, if requested by --help
    2.39 +if [ "$help" == "yes" ]
    2.40 +  then
    2.41 +	echo "Commandline options:
    2.42 +  $0
    2.43 +	--version=<version>
    2.44 +	--lang=<language>
    2.45 +	--root=<path-to-root>
    2.46 +	--install=yes|no
    2.47 +	--keep=no|yes
    2.48 +	--tmpdir=<directory-to-build-package>
    2.49 +	--logfile=<logging-file>"
    2.50 +	exit
    2.51 +fi
    2.52 +
    2.53 +# Check for system administrator privileges
    2.54 +check_root
    2.55 +
    2.56 +title "Package $PACKAGE will be build as SliTaz package and installed"
    2.57 +
    2.58 +# Fetch latest version
    2.59 +# unless version is set by option --version
    2.60 +[ -z "$version" ] && version="latest"
    2.61 +
    2.62 +# Fetch RPM package for english language
    2.63 +# unless language is set by option --lang
    2.64 +[ -z "$lang" ] && lang="en-GB"
    2.65 +
    2.66 +# Install SliTaz package
    2.67 +# unless inhibited by option --install=no
    2.68 +[ -z "$install" ] && install="yes"
    2.69 +
    2.70 +# Delete SliTaz package file $PACKAGE-$VERSION.tazpkg after installation
    2.71 +# unless option --keep=yes is given
    2.72 +[ -z "$keep" ] && keep="no"
    2.73 +
    2.74 +# Directory for temporary files
    2.75 +TMP_DIR="$tmpdir"
    2.76 +[ -z "$tmpdir" ] && TMP_DIR="/tmp/get-$PACKAGE"
    2.77 +
    2.78 +# Logging file
    2.79 +LOG="$logfile"
    2.80 +[ -z "$logfile" ] && LOG=$TMP_DIR/get-$PACKAGE.log
    2.81 +
    2.82 +cat <<EOT
    2.83 +Options in use:
    2.84 +  root           : $root/
    2.85 +  version        : $version
    2.86 +  lang		 : $lang
    2.87 +  install package: $install
    2.88 +  keep tazpkg    : $keep
    2.89 +  build directory: $TMP_DIR
    2.90 +  logging file   : $LOG
    2.91 +
    2.92 +EOT
    2.93 +
    2.94 +separator; newline
    2.95 +
    2.96 +# Set VERSION, unless supplied by --version
    2.97 +if [ "$version" == "latest" ]
    2.98 +  then
    2.99 +	echo "Selecting latest version from $WEB_SITE ..."
   2.100 +	VERSION=$(wget -O - $WEB_SITE 2>/dev/null | sed '/Released: Apache OpenOffice /!d;s|.* OpenOffice ||;s|</a></div>||')
   2.101 +  else
   2.102 +	VERSION=$version
   2.103 +fi
   2.104 +
   2.105 +MV=${VERSION%%.*}	# main version
   2.106 +
   2.107 +TARBALL=Apache_OpenOffice_${VERSION}_Linux_x86_install-rpm_${lang}.tar.gz
   2.108 +echo "Archive is $TARBALL ..."
   2.109 +WGET_URL=https://archive.apache.org/dist/openoffice/$VERSION/binaries/$lang/$TARBALL
   2.110 +
   2.111 +#	=== Remove package, if installed ===
   2.112 +if is_installed
   2.113 +  then
   2.114 +	echo "$PACKAGE is already installed."
   2.115 +	echo -n "Would you like to remove and reinstall this package [y/n]? "
   2.116 +	read answer
   2.117 +	case "$answer" in
   2.118 +		(y|Y)
   2.119 +			action "Removing installed version..."
   2.120 +			newline
   2.121 +			tazpkg remove $PACKAGE --root="$root/"
   2.122 +			[ ! is_installed ] &&
   2.123 +			die "Can't remove installed version. Exiting."
   2.124 +			;;
   2.125 +		(*)
   2.126 +			echo "Leaving $PACKAGE untouched."
   2.127 +			exit 0
   2.128 +			;;
   2.129 +	esac
   2.130 +fi
   2.131 +
   2.132 +#	=== Fetch archive file, if not existing ===
   2.133 +
   2.134 +CUR_DIR=$(pwd)
   2.135 +mkdir -p $TMP_DIR
   2.136 +cd $TMP_DIR
   2.137 +if [ -f $TARBALL ]
   2.138 +  then
   2.139 +	echo "Using existing archive file $TARBALL"
   2.140 +  else
   2.141 +	action "Fetching the archive"
   2.142 +	newline
   2.143 +	wget	--no-check-certificate $WGET_URL
   2.144 +	if [ ! -f $TARBALL ]
   2.145 +	  then
   2.146 +		cd $CUR_DIR
   2.147 +		rm -rf $TMP_DIR
   2.148 +		echo "Could not transfer $TARBALL from $WGET_URL. Exiting."
   2.149 +		exit 1
   2.150 +	fi
   2.151 +fi
   2.152 +
   2.153 +#	=== Extract files from archive ===
   2.154 +action "Extracting the archive"
   2.155 +newline
   2.156 +
   2.157 +tar x -vf $TARBALL > $LOG 2>&1 || \
   2.158 + (echo "Failed to extract $TARBALL" ; exit 1)
   2.159 +
   2.160 +status
   2.161 +
   2.162 +# Remove archive file
   2.163 +rm -f $TARBALL
   2.164 +
   2.165 +# Extract everything from rpm files and remove them
   2.166 +cd $TMP_DIR/*/RPMS
   2.167 +for i in *.rpm
   2.168 +  do
   2.169 +	if (! echo $i | egrep -qi $EXCLUDE)
   2.170 +	  then
   2.171 +		(rpm2cpio $i | cpio -id >> $LOG 2>&1 ) &&
   2.172 +		rm -f $i
   2.173 +	fi
   2.174 +  done
   2.175 +
   2.176 +# Extracted from freedesktop rpm and remove it
   2.177 +rpm2cpio	desktop-integration/*freedesktop*.rpm | cpio -id >> $LOG 2>&1
   2.178 +rm -f		desktop-integration/*freedesktop*.rpm
   2.179 +
   2.180 +# Prepare the package tree
   2.181 +mkdir -p $PACKAGE-$VERSION/fs/usr/lib/openoffice
   2.182 +mkdir -p $PACKAGE-$VERSION/fs/usr/share
   2.183 +
   2.184 +mv opt/openoffice*	$PACKAGE-$VERSION/fs/usr/lib/openoffice
   2.185 +mv usr/share/mime	$PACKAGE-$VERSION/fs/usr/share
   2.186 +mv usr/share/icons	$PACKAGE-$VERSION/fs/usr/share
   2.187 +mv usr/bin		$PACKAGE-$VERSION/fs/usr
   2.188 +
   2.189 +# relocalised OOo libexec directory
   2.190 +sed -i 's|/opt/|/usr/lib/openoffice/|' \
   2.191 +	$PACKAGE-$VERSION/fs/usr/bin/openoffice*
   2.192 +
   2.193 +# Create recipe for tazpkg
   2.194 +cat > $PACKAGE-$VERSION/receipt <<EOT
   2.195 +# SliTaz package receipt.
   2.196 +
   2.197 +PACKAGE="$PACKAGE"
   2.198 +VERSION="$VERSION"
   2.199 +CATEGORY="$CATEGORY"
   2.200 +SHORT_DESC="$SHORT_DESC"
   2.201 +MAINTAINER="$MAINTAINER"
   2.202 +LICENSE="$LICENSE"
   2.203 +WEB_SITE="$WEB_SITE"
   2.204 +
   2.205 +post_install()
   2.206 +{
   2.207 +	cd \$1/usr/share/applications
   2.208 +	ln -s /usr/lib/openoffice/openoffice$MV/share/xdg/base.desktop		openoffice$MV-base.desktop 
   2.209 +	ln -s /usr/lib/openoffice/openoffice$MV/share/xdg/impress.desktop	openoffice$MV-impress.desktop
   2.210 +	ln -s /usr/lib/openoffice/openoffice$MV/share/xdg/writer.desktop	openoffice$MV-writer.desktop
   2.211 +	ln -s /usr/lib/openoffice/openoffice$MV/share/xdg/calc.desktop		openoffice$MV-calc.desktop
   2.212 +	ln -s /usr/lib/openoffice/openoffice$MV/share/xdg/math.desktop		openoffice$MV-math.desktop
   2.213 +	ln -s /usr/lib/openoffice/openoffice$MV/share/xdg/draw.desktop		openoffice$MV-draw.desktop
   2.214 +	ln -s /usr/lib/openoffice/openoffice$MV/share/xdg/printeradmin.desktop	openoffice$MV-printeradmin.desktop
   2.215 +
   2.216 +	cd \$1/usr/bin
   2.217 +	ln -sf /usr/lib/openoffice/openoffice$MV/program/soffice
   2.218 +}
   2.219 +
   2.220 +post_remove()
   2.221 +{
   2.222 +	rm -f \$1/usr/share/applications/openoffice$MV-*
   2.223 +}
   2.224 +
   2.225 +EOT
   2.226 +
   2.227 +# Pack
   2.228 +tazpkg pack $PACKAGE-$VERSION
   2.229 +# Remove package tree
   2.230 +rm -rf $PACKAGE-$VERSION
   2.231 +
   2.232 +#	=== Install the SliTaz package ===
   2.233 +[ "$install" == "yes" ] &&
   2.234 +tazpkg install $PACKAGE-$VERSION.tazpkg --root="$root"
   2.235 +
   2.236 +#	=== Cleanup ===
   2.237 +# Preserve package file, if requested
   2.238 +[ "$keep" == "yes" ] &&
   2.239 +( mv $PACKAGE-$VERSION.tazpkg $CUR_DIR &&
   2.240 +  echo Saved $PACKAGE-$VERSION.tazpkg to $CUR_DIR )
   2.241 +
   2.242 +# Remove temporary build directory
   2.243 +cd $CUR_DIR
   2.244 +rm -rf $TMP_DIR
     3.1 --- a/keepassx/receipt	Sun Jun 26 10:18:40 2022 +0100
     3.2 +++ b/keepassx/receipt	Mon Jun 27 15:00:45 2022 +0100
     3.3 @@ -2,18 +2,19 @@
     3.4  
     3.5  PACKAGE="keepassx"
     3.6  VERSION="0.4.3"
     3.7 -CATEGORY="graphics"
     3.8 -SHORT_DESC="Cross platform password manager"
     3.9 +CATEGORY="security"
    3.10 +TAGS="password key"
    3.11 +SHORT_DESC="Cross platform password manager."
    3.12  MAINTAINER="jozee@slitaz.org"
    3.13  LICENSE="GPL2"
    3.14 +WEB_SITE="https://www.keepassx.org/"
    3.15 +
    3.16  #SOURCE="KeePassX"
    3.17  TARBALL="$PACKAGE-$VERSION.tar.gz"
    3.18 -WEB_SITE="https://www.keepassx.org/"
    3.19  WGET_URL="https://www.keepassx.org/releases/$VERSION/$TARBALL"
    3.20 -TAGS="password key"
    3.21  
    3.22 -DEPENDS="xorg-libXtst libQtCore libQtGui libQtXml gcc-lib-base"
    3.23 -BUILD_DEPENDS="Qt4-dev xorg-libXtst-dev xorg-libXtst qmake libegl-mesa"
    3.24 +DEPENDS="gcc-lib-base libQtCore libQtGui libQtXml xorg-libXtst"
    3.25 +BUILD_DEPENDS="libegl-mesa qmake Qt4-dev xorg-libXtst-dev xorg-libXtst"
    3.26  
    3.27  # What is the latest version available today?
    3.28  current_version()
    3.29 @@ -25,23 +26,25 @@
    3.30  # Rules to configure and make the package.
    3.31  compile_rules()
    3.32  {
    3.33 -	cd $src/src
    3.34 +	cd src
    3.35  	qmake PREFIX=/usr &&
    3.36  	make &&
    3.37 -	make INSTALL_ROOT=$DESTDIR install
    3.38 +	make install INSTALL_ROOT=$DESTDIR
    3.39  }
    3.40  
    3.41  # Rules to gen a SliTaz package suitable for Tazpkg.
    3.42  genpkg_rules()
    3.43  {
    3.44 -	mkdir -p \
    3.45 -		$fs/usr/share/keepassx \
    3.46 -		$fs/usr/share/licenses \
    3.47 -		$fs/usr/share/icons/hicolor/16x16/apps $fs/usr/share/icons/hicolor/48x48/apps
    3.48 +	mkdir -p $fs/usr/share/keepassx
    3.49 +	mkdir -p $fs/usr/share/licenses
    3.50 +	mkdir -p $fs/usr/share/icons/hicolor/16x16/apps
    3.51 +	mkdir -p $fs/usr/share/icons/hicolor/48x48/apps
    3.52  
    3.53 -	cp -a $install/usr/bin $fs/usr
    3.54 -	cp -a $install/usr/share/keepassx/icons $fs/usr/share/keepassx
    3.55 -	cp -a $install/usr/share/keepassx/license.html $fs/usr/share/licenses/$PACKAGE.html
    3.56 -	ln -s /usr/share/keepassx/icons/keepassx_small.png $fs/usr/share/icons/hicolor/16x16/apps/keepassx.png
    3.57 -	ln -s /usr/share/keepassx/icons/keepassx_large.png $fs/usr/share/icons/hicolor/48x48/apps/keepassx.png
    3.58 +	cp -a $install/usr/bin				$fs/usr
    3.59 +	cp -a $install/usr/share/keepassx/icons		$fs/usr/share/keepassx
    3.60 +	cp -a $install/usr/share/keepassx/license.html	$fs/usr/share/licenses/$PACKAGE.html
    3.61 +	ln -s /usr/share/keepassx/icons/keepassx_small.png \
    3.62 +							$fs/usr/share/icons/hicolor/16x16/apps/keepassx.png
    3.63 +	ln -s /usr/share/keepassx/icons/keepassx_large.png \
    3.64 +							$fs/usr/share/icons/hicolor/48x48/apps/keepassx.png
    3.65  }