wok-next annotate LibreOffice/receipt @ rev 20882
Check Repology info from a* to g* packages
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Jul 10 20:08:05 2018 +0300 (2018-07-10) |
parents | d43bf7aae921 |
children | df20b2110f7e |
rev | line source |
---|---|
al@19828 | 1 # SliTaz package receipt v2. |
al@19828 | 2 |
al@19828 | 3 PACKAGE="LibreOffice" |
al@20882 | 4 VERSION="6.0.5.2" |
al@19828 | 5 CATEGORY="office" |
al@19828 | 6 SHORT_DESC="Powerful office suite" |
al@19828 | 7 MAINTAINER="al.bobylev@gmail.com" |
al@19828 | 8 LICENSE="MPL2" |
al@19828 | 9 WEB_SITE="https://www.libreoffice.org/" |
al@19828 | 10 HOST_ARCH="i486 x86_64" |
al@20882 | 11 REPOLOGY="libreoffice" |
al@19828 | 12 |
al@19828 | 13 case $ARCH in |
al@20465 | 14 i?86) lo_arch="x86" ; lo_arch2="x86" ;; |
al@19828 | 15 x86_64) lo_arch="x86_64"; lo_arch2="x86-64";; |
al@19828 | 16 esac |
al@19828 | 17 |
al@19828 | 18 TARBALL="LibreOffice_${VERSION}_Linux_${lo_arch2}_deb.tar.gz" |
al@19828 | 19 WGET_URL="http://download.documentfoundation.org/libreoffice/stable/$VERSION/deb/$lo_arch/$TARBALL" |
al@19828 | 20 |
al@19828 | 21 SPLIT="LibreOffice-langpack-de LibreOffice-langpack-es LibreOffice-langpack-fr \ |
al@19828 | 22 LibreOffice-langpack-it LibreOffice-langpack-pt-BR LibreOffice-langpack-ru \ |
al@19828 | 23 LibreOffice LibreOffice-extra" |
al@19828 | 24 |
al@19828 | 25 sizes() { du -chs ${1:-$fs} | awk 'END{print $1}'; } |
al@19828 | 26 |
al@20465 | 27 compile_rules() { |
al@19828 | 28 echo 'Checking language packages...' |
al@19828 | 29 for i in de es fr it pt-BR ru; do |
al@19828 | 30 TARBALL="LibreOffice_${VERSION}_Linux_${lo_arch2}_deb_langpack_$i.tar.gz" |
al@19828 | 31 WGET_URL="$(dirname $WGET_URL)/$TARBALL" |
al@19828 | 32 [ -e "$SRC/$TARBALL" ] || wget -O $SRC/$TARBALL $WGET_URL |
al@19828 | 33 tar -xzf $SRC/$TARBALL |
al@19828 | 34 done |
al@19828 | 35 action 'Extracting LibreOffice...' |
al@19828 | 36 # extract all deb's filesystem into $install |
al@19828 | 37 find . -name '*.deb' -exec dpkg-deb -x '{}' $install \; |
al@19828 | 38 sizes $install |
al@19828 | 39 |
al@19828 | 40 # substitute desktop files symlinks by actual files (to be processed by cook) |
al@19828 | 41 find $install/usr/share/applications/ -type l -delete # no way to remove 'broken' symlinks by `rm` |
al@19828 | 42 find $install/opt/libreoffice${VERSION%.*}/share/xdg/ -type f | \ |
al@19828 | 43 while read i; do |
al@19828 | 44 mv $i $install/usr/share/applications/libreoffice${VERSION%.*}-$(basename $i) |
al@19828 | 45 done |
al@19828 | 46 # remove useless (after processing by sdft) lines from desktop files |
al@19828 | 47 sed -i '/^#/d; /^Actions=/d; s|X-Red-Hat-Base;||; |
al@19828 | 48 s|X-MandrivaLinux-[^;]*;||' $install/usr/share/applications/*.desktop |
al@20500 | 49 |
al@20500 | 50 # fix some files permissions |
al@20500 | 51 find $install -type f -name 'libpl*.so' -exec chmod -v 755 '{}' \; # was 444 |
al@20500 | 52 find $install -type f -name 'Carlito*.ttf' -exec chmod -v 644 '{}' \; # was 640 |
al@20500 | 53 find $install -type f -name 'Noto*.ttf' -exec chmod -v 644 '{}' \; # was 640 |
al@19828 | 54 } |
al@19828 | 55 |
al@20465 | 56 genpkg_rules() { |
al@19828 | 57 case $PACKAGE in |
al@19828 | 58 LibreOffice-langpack-*) |
al@19828 | 59 lang=${PACKAGE#*langpack-} |
al@19828 | 60 copy *$lang.res $lang/ $lang.zip dict-$lang/ *-$lang.xcd *_$lang.xcd |
al@19828 | 61 |
al@19828 | 62 action 'Removing unwanted files...' |
al@19828 | 63 find $fs -name '*.properties' | \ |
al@19828 | 64 while read i; do |
al@19828 | 65 j=$(basename $i .properties) |
al@19828 | 66 case $j in |
al@19828 | 67 *de|*en_US|*es|*fr|*it|*pt_BR|*ru) ;; |
al@19828 | 68 *) rm $i;; |
al@19828 | 69 esac |
al@19828 | 70 done |
al@19828 | 71 sizes |
al@19828 | 72 |
al@19828 | 73 case $lang in |
al@19828 | 74 de) L='German';; |
al@19828 | 75 es) L='Spanish';; |
al@19828 | 76 fr) L='French';; |
al@19828 | 77 it) L='Italian';; |
al@19828 | 78 pt-BR) L='Portuguese Brazilian';; |
al@19828 | 79 ru) L='Russian';; |
al@19828 | 80 esac |
al@19828 | 81 CAT="localization|$L langpack" |
al@19828 | 82 DEPENDS="LibreOffice" |
al@19828 | 83 ;; |
al@19828 | 84 LibreOffice) |
al@20513 | 85 copy @std *.inc @rm |
al@19828 | 86 DEPENDS="gtk+ dbus-glib libcomerr libkrb5 xorg-libSM \ |
al@19828 | 87 xorg-libXinerama xorg-libXrandr" |
al@19828 | 88 SUGGESTED="gst1-plugins-base mesa" |
al@19828 | 89 |
al@19828 | 90 action 'Info: current size is...'; sizes |
al@19828 | 91 |
al@19828 | 92 action 'Removing Java support...' |
al@19828 | 93 # remove Java support |
al@19828 | 94 find $fs -name '*.jar' -delete |
al@19828 | 95 rm $fs/opt/libreoffice${VERSION%.*}/program/libofficebean.so |
al@19828 | 96 sizes |
al@19828 | 97 |
al@19828 | 98 action 'Removing unwanted files...' |
al@19828 | 99 # remove kde & qt support |
al@19828 | 100 rm $fs/opt/libreoffice${VERSION%.*}/program/libkde4be1lo.so |
al@19828 | 101 rm $fs/opt/libreoffice${VERSION%.*}/program/libvclplug_kde4lo.so |
al@19828 | 102 |
al@19828 | 103 # remove gstreamer0 support (libavmediagst_0_10.so) |
al@19828 | 104 # leave gstreamer1 support (libavmediagst.so) |
al@19828 | 105 rm $fs/opt/libreoffice${VERSION%.*}/program/libavmediagst_0_10.so |
al@19828 | 106 |
al@19828 | 107 # remove multilingual files |
al@19828 | 108 find $fs -name '*.properties' | \ |
al@19828 | 109 while read i; do |
al@19828 | 110 j=$(basename $i .properties) |
al@19828 | 111 case $j in |
al@19828 | 112 *de|*en_US|*es|*fr|*it|*pt_BR|*ru) ;; |
al@19828 | 113 *) rm $i;; |
al@19828 | 114 esac |
al@19828 | 115 done |
al@19828 | 116 |
al@19828 | 117 # remove icon themes; leave only default tango theme (-11MB) |
al@19828 | 118 for i in $fs/opt/libreoffice${VERSION%.*}/share/config/images*.zip; do |
al@19828 | 119 case $(basename $i .zip) in |
al@19828 | 120 *tango) ;; |
al@19828 | 121 *) rm $i;; |
al@19828 | 122 esac |
al@19828 | 123 done |
al@19828 | 124 |
al@19828 | 125 # remove wiki-publisher extension |
al@19828 | 126 rm -r $fs/opt/libreoffice${VERSION%.*}/share/extensions/wiki-publisher |
al@19828 | 127 |
al@19828 | 128 # remove unneded desktop integration |
al@19828 | 129 rm -r $fs/usr/lib/ |
al@19828 | 130 cd $fs/usr/share/ |
al@20465 | 131 rm -r mime-info/ application-registry/ icons/locolor/ icons/gnome/ |
al@20465 | 132 rm -r icons/hicolor/scalable/ |
al@19828 | 133 |
al@19828 | 134 # remove other files |
al@19828 | 135 rm -r $fs/opt/libreoffice${VERSION%.*}/readmes/ |
al@19828 | 136 |
al@19828 | 137 sizes |
al@19828 | 138 |
al@19828 | 139 # action 'Compressing xml files...' |
al@19828 | 140 # # compress xml-based files |
al@19828 | 141 # t="$(mktemp)" |
al@19828 | 142 # find $fs -type f \( -name '*.xml' -o -name 'xsl' \) | \ |
al@19828 | 143 # while read i; do |
al@19828 | 144 # xmlstarlet c14n --without-comments "$i" | \ |
al@19828 | 145 # xmlstarlet --no-doc-namespace sel -B -t -c '*' > $t |
al@19828 | 146 # cat "$t" > "$i" |
al@19828 | 147 # done |
al@19828 | 148 # sizes |
al@19828 | 149 ;; |
al@19828 | 150 |
al@19828 | 151 LibreOffice-extra) |
al@19828 | 152 # all the rest... |
al@20513 | 153 copy @std *.inc @rm |
al@19828 | 154 CAT="office|extra files" |
al@19828 | 155 ;; |
al@19828 | 156 esac |
al@19828 | 157 } |