wok-next diff LibreOffice/receipt @ rev 20185

abiword, apache, connman, elementary, evince, ffmpeg, go, mono: receipt v2
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Nov 02 18:17:32 2017 +0100 (2017-11-02)
parents
children 6805cf8ff938
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/LibreOffice/receipt	Thu Nov 02 18:17:32 2017 +0100
     1.3 @@ -0,0 +1,159 @@
     1.4 +# SliTaz package receipt v2.
     1.5 +
     1.6 +PACKAGE="LibreOffice"
     1.7 +VERSION="5.4.0"
     1.8 +CATEGORY="office"
     1.9 +SHORT_DESC="Powerful office suite"
    1.10 +MAINTAINER="al.bobylev@gmail.com"
    1.11 +LICENSE="MPL2"
    1.12 +WEB_SITE="https://www.libreoffice.org/"
    1.13 +HOST_ARCH="i486 x86_64"
    1.14 +
    1.15 +case $ARCH in
    1.16 +	i486)   lo_arch="x86"   ; lo_arch2="x86"   ;;
    1.17 +	x86_64) lo_arch="x86_64"; lo_arch2="x86-64";;
    1.18 +esac
    1.19 +
    1.20 +TARBALL="LibreOffice_${VERSION}_Linux_${lo_arch2}_deb.tar.gz"
    1.21 +WGET_URL="http://download.documentfoundation.org/libreoffice/stable/$VERSION/deb/$lo_arch/$TARBALL"
    1.22 +
    1.23 +SPLIT="LibreOffice-langpack-de LibreOffice-langpack-es LibreOffice-langpack-fr \
    1.24 +LibreOffice-langpack-it LibreOffice-langpack-pt-BR LibreOffice-langpack-ru \
    1.25 +LibreOffice LibreOffice-extra"
    1.26 +
    1.27 +sizes() { du -chs ${1:-$fs} | awk 'END{print $1}'; }
    1.28 +
    1.29 +# Rules to configure and make the package.
    1.30 +compile_rules()
    1.31 +{
    1.32 +	echo 'Checking language packages...'
    1.33 +	for i in de es fr it pt-BR ru; do
    1.34 +		TARBALL="LibreOffice_${VERSION}_Linux_${lo_arch2}_deb_langpack_$i.tar.gz"
    1.35 +		WGET_URL="$(dirname $WGET_URL)/$TARBALL"
    1.36 +		[ -e "$SRC/$TARBALL" ] || wget -O $SRC/$TARBALL $WGET_URL
    1.37 +		tar -xzf $SRC/$TARBALL
    1.38 +	done
    1.39 +	action 'Extracting LibreOffice...'
    1.40 +	# extract all deb's filesystem into $install
    1.41 +	find . -name '*.deb' -exec dpkg-deb -x '{}' $install \;
    1.42 +	sizes $install
    1.43 +
    1.44 +	# substitute desktop files symlinks by actual files (to be processed by cook)
    1.45 +	find $install/usr/share/applications/ -type l -delete # no way to remove 'broken' symlinks by `rm`
    1.46 +	find $install/opt/libreoffice${VERSION%.*}/share/xdg/ -type f | \
    1.47 +	while read i; do
    1.48 +		mv $i $install/usr/share/applications/libreoffice${VERSION%.*}-$(basename $i)
    1.49 +	done
    1.50 +	# remove useless (after processing by sdft) lines from desktop files
    1.51 +	sed -i '/^#/d; /^Actions=/d; s|X-Red-Hat-Base;||;
    1.52 +		s|X-MandrivaLinux-[^;]*;||' $install/usr/share/applications/*.desktop
    1.53 +}
    1.54 +
    1.55 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.56 +genpkg_rules()
    1.57 +{
    1.58 +	case $PACKAGE in
    1.59 +		LibreOffice-langpack-*)
    1.60 +			lang=${PACKAGE#*langpack-}
    1.61 +			copy *$lang.res $lang/ $lang.zip dict-$lang/ *-$lang.xcd *_$lang.xcd
    1.62 +
    1.63 +			action 'Removing unwanted files...'
    1.64 +			find $fs -name '*.properties' | \
    1.65 +			while read i; do
    1.66 +				j=$(basename $i .properties)
    1.67 +				case $j in
    1.68 +					*de|*en_US|*es|*fr|*it|*pt_BR|*ru) ;;
    1.69 +					*) rm $i;;
    1.70 +				esac
    1.71 +			done
    1.72 +			sizes
    1.73 +
    1.74 +			case $lang in
    1.75 +				de) L='German';;
    1.76 +				es) L='Spanish';;
    1.77 +				fr) L='French';;
    1.78 +				it) L='Italian';;
    1.79 +				pt-BR) L='Portuguese Brazilian';;
    1.80 +				ru) L='Russian';;
    1.81 +			esac
    1.82 +			CAT="localization|$L langpack"
    1.83 +			DEPENDS="LibreOffice"
    1.84 +			;;
    1.85 +		LibreOffice)
    1.86 +			copy @std *.inc
    1.87 +			remove_already_packed
    1.88 +			DEPENDS="gtk+ dbus-glib libcomerr libkrb5 xorg-libSM \
    1.89 +			xorg-libXinerama xorg-libXrandr"
    1.90 +			SUGGESTED="gst1-plugins-base mesa"
    1.91 +
    1.92 +			action 'Info: current size is...'; sizes
    1.93 +
    1.94 +			action 'Removing Java support...'
    1.95 +			# remove Java support
    1.96 +			find $fs -name '*.jar' -delete
    1.97 +			rm $fs/opt/libreoffice${VERSION%.*}/program/libofficebean.so
    1.98 +			sizes
    1.99 +
   1.100 +			action 'Removing unwanted files...'
   1.101 +			# remove kde & qt support
   1.102 +			rm $fs/opt/libreoffice${VERSION%.*}/program/libkde4be1lo.so
   1.103 +			rm $fs/opt/libreoffice${VERSION%.*}/program/libvclplug_kde4lo.so
   1.104 +
   1.105 +			# remove gstreamer0 support (libavmediagst_0_10.so)
   1.106 +			# leave  gstreamer1 support (libavmediagst.so)
   1.107 +			rm $fs/opt/libreoffice${VERSION%.*}/program/libavmediagst_0_10.so
   1.108 +
   1.109 +			# remove multilingual files
   1.110 +			find $fs -name '*.properties' | \
   1.111 +			while read i; do
   1.112 +				j=$(basename $i .properties)
   1.113 +				case $j in
   1.114 +					*de|*en_US|*es|*fr|*it|*pt_BR|*ru) ;;
   1.115 +					*) rm $i;;
   1.116 +				esac
   1.117 +			done
   1.118 +
   1.119 +			# remove icon themes; leave only default tango theme (-11MB)
   1.120 +			for i in $fs/opt/libreoffice${VERSION%.*}/share/config/images*.zip; do
   1.121 +				case $(basename $i .zip) in
   1.122 +					*tango) ;;
   1.123 +					*) rm $i;;
   1.124 +				esac
   1.125 +			done
   1.126 +
   1.127 +			# remove wiki-publisher extension
   1.128 +			rm -r $fs/opt/libreoffice${VERSION%.*}/share/extensions/wiki-publisher
   1.129 +
   1.130 +			# remove unneded desktop integration
   1.131 +			rm -r $fs/usr/lib/
   1.132 +			cd $fs/usr/share/
   1.133 +			rm -r mimelnk/ mime-info/ application-registry/ appdata/
   1.134 +			rm -r icons/locolor/ icons/gnome/
   1.135 +			cd icons/hicolor/
   1.136 +			rm -r scalable/ 512x512/ 256x256/ 128x128/ 32x32/
   1.137 +
   1.138 +			# remove other files
   1.139 +			rm -r $fs/opt/libreoffice${VERSION%.*}/readmes/
   1.140 +
   1.141 +			sizes
   1.142 +
   1.143 +			#	action 'Compressing xml files...'
   1.144 +			#	# compress xml-based files
   1.145 +			#	t="$(mktemp)"
   1.146 +			#	find $fs -type f \( -name '*.xml' -o -name 'xsl' \) | \
   1.147 +			#	while read i; do
   1.148 +			#		xmlstarlet c14n --without-comments "$i" | \
   1.149 +			#		xmlstarlet --no-doc-namespace sel -B -t -c '*' > $t
   1.150 +			#		cat "$t" > "$i"
   1.151 +			#	done
   1.152 +			#	sizes
   1.153 +			;;
   1.154 +
   1.155 +		LibreOffice-extra)
   1.156 +			# all the rest...
   1.157 +			copy @std *.inc
   1.158 +			remove_already_packed
   1.159 +			CAT="office|extra files"
   1.160 +			;;
   1.161 +	esac
   1.162 +}