wok-next annotate LibreOffice/receipt @ rev 21449
updated slock (1.1 -> 1.4)
author | Hans-G?nter Theisgen |
---|---|
date | Thu May 07 07:51:56 2020 +0100 (2020-05-07) |
parents | 82b613cfd1e0 |
children |
rev | line source |
---|---|
al@19828 | 1 # SliTaz package receipt v2. |
al@19828 | 2 |
al@19828 | 3 PACKAGE="LibreOffice" |
al@20883 | 4 VERSION="6.0.5" |
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@20882 | 10 REPOLOGY="libreoffice" |
al@19828 | 11 |
al@19828 | 12 case $ARCH in |
al@20465 | 13 i?86) lo_arch="x86" ; lo_arch2="x86" ;; |
al@19828 | 14 x86_64) lo_arch="x86_64"; lo_arch2="x86-64";; |
al@19828 | 15 esac |
al@19828 | 16 |
al@19828 | 17 TARBALL="LibreOffice_${VERSION}_Linux_${lo_arch2}_deb.tar.gz" |
al@19828 | 18 WGET_URL="http://download.documentfoundation.org/libreoffice/stable/$VERSION/deb/$lo_arch/$TARBALL" |
al@19828 | 19 |
al@21094 | 20 COOKOPTS="force-arch" # different .bau, segments_3, .jar, help.ht_, .xcd in langpacks |
al@21094 | 21 |
al@21020 | 22 SPLIT="$PACKAGE-langpack-de $PACKAGE-langpack-es $PACKAGE-langpack-fr \ |
al@21020 | 23 $PACKAGE-langpack-it $PACKAGE-langpack-pt-BR $PACKAGE-langpack-ru \ |
al@21020 | 24 $PACKAGE $PACKAGE-extra" |
al@19828 | 25 |
al@19828 | 26 sizes() { du -chs ${1:-$fs} | awk 'END{print $1}'; } |
al@19828 | 27 |
al@20465 | 28 compile_rules() { |
al@19828 | 29 echo 'Checking language packages...' |
al@19828 | 30 for i in de es fr it pt-BR ru; do |
al@19828 | 31 TARBALL="LibreOffice_${VERSION}_Linux_${lo_arch2}_deb_langpack_$i.tar.gz" |
al@19828 | 32 WGET_URL="$(dirname $WGET_URL)/$TARBALL" |
al@19828 | 33 [ -e "$SRC/$TARBALL" ] || wget -O $SRC/$TARBALL $WGET_URL |
al@19828 | 34 tar -xzf $SRC/$TARBALL |
al@19828 | 35 done |
al@19828 | 36 action 'Extracting LibreOffice...' |
al@19828 | 37 # extract all deb's filesystem into $install |
al@19828 | 38 find . -name '*.deb' -exec dpkg-deb -x '{}' $install \; |
al@19828 | 39 sizes $install |
al@19828 | 40 |
al@19828 | 41 # substitute desktop files symlinks by actual files (to be processed by cook) |
al@19828 | 42 find $install/usr/share/applications/ -type l -delete # no way to remove 'broken' symlinks by `rm` |
al@19828 | 43 find $install/opt/libreoffice${VERSION%.*}/share/xdg/ -type f | \ |
al@19828 | 44 while read i; do |
al@19828 | 45 mv $i $install/usr/share/applications/libreoffice${VERSION%.*}-$(basename $i) |
al@19828 | 46 done |
al@19828 | 47 # remove useless (after processing by sdft) lines from desktop files |
al@19828 | 48 sed -i '/^#/d; /^Actions=/d; s|X-Red-Hat-Base;||; |
al@19828 | 49 s|X-MandrivaLinux-[^;]*;||' $install/usr/share/applications/*.desktop |
al@20500 | 50 |
al@20500 | 51 # fix some files permissions |
al@20500 | 52 find $install -type f -name 'libpl*.so' -exec chmod -v 755 '{}' \; # was 444 |
al@21048 | 53 find $install -type f -name 'libnspr4.so' -exec chmod -v 755 '{}' \; # was 444 |
al@20500 | 54 find $install -type f -name 'Carlito*.ttf' -exec chmod -v 644 '{}' \; # was 640 |
al@20500 | 55 find $install -type f -name 'Noto*.ttf' -exec chmod -v 644 '{}' \; # was 640 |
al@21048 | 56 |
al@21048 | 57 # make symlink relative: /usr/bin/libreoffice6.0 -> /opt/libreoffice6.0/program/soffice |
al@21048 | 58 fix symlinks |
al@19828 | 59 } |
al@19828 | 60 |
al@20465 | 61 genpkg_rules() { |
al@19828 | 62 case $PACKAGE in |
al@19828 | 63 LibreOffice-langpack-*) |
al@19828 | 64 lang=${PACKAGE#*langpack-} |
al@19828 | 65 copy *$lang.res $lang/ $lang.zip dict-$lang/ *-$lang.xcd *_$lang.xcd |
al@19828 | 66 |
al@19828 | 67 action 'Removing unwanted files...' |
al@19828 | 68 find $fs -name '*.properties' | \ |
al@19828 | 69 while read i; do |
al@19828 | 70 j=$(basename $i .properties) |
al@19828 | 71 case $j in |
al@19828 | 72 *de|*en_US|*es|*fr|*it|*pt_BR|*ru) ;; |
al@19828 | 73 *) rm $i;; |
al@19828 | 74 esac |
al@19828 | 75 done |
al@19828 | 76 sizes |
al@19828 | 77 |
al@19828 | 78 case $lang in |
al@19828 | 79 de) L='German';; |
al@19828 | 80 es) L='Spanish';; |
al@19828 | 81 fr) L='French';; |
al@19828 | 82 it) L='Italian';; |
al@19828 | 83 pt-BR) L='Portuguese Brazilian';; |
al@19828 | 84 ru) L='Russian';; |
al@19828 | 85 esac |
al@19828 | 86 CAT="localization|$L langpack" |
al@19828 | 87 DEPENDS="LibreOffice" |
al@19828 | 88 ;; |
al@19828 | 89 LibreOffice) |
al@20513 | 90 copy @std *.inc @rm |
al@21105 | 91 DEPENDS="atk libcairo dbus dbus-glib fontconfig freetype gdk-pixbuf \ |
al@21143 | 92 glib gpgme gst1-plugins-base gstreamer1 gtk2 icu liblcms2 libassuan \ |
al@20905 | 93 libcomerr libcups libcurl libepoxy libgpg-error libicu libkrb5 \ |
al@20905 | 94 libsqlite3 libxml2 libxslt neon nspr nss pango perl python \ |
al@21078 | 95 libice libsm libx11 libxext libxinerama \ |
al@21078 | 96 libxrandr libxrender zlib" |
al@20905 | 97 SUGGESTED="mesa" |
al@19828 | 98 |
al@19828 | 99 action 'Info: current size is...'; sizes |
al@19828 | 100 |
al@19828 | 101 action 'Removing Java support...' |
al@19828 | 102 # remove Java support |
al@19828 | 103 find $fs -name '*.jar' -delete |
al@19828 | 104 rm $fs/opt/libreoffice${VERSION%.*}/program/libofficebean.so |
al@19828 | 105 sizes |
al@19828 | 106 |
al@19828 | 107 action 'Removing unwanted files...' |
al@19828 | 108 # remove kde & qt support |
al@19828 | 109 rm $fs/opt/libreoffice${VERSION%.*}/program/libkde4be1lo.so |
al@19828 | 110 rm $fs/opt/libreoffice${VERSION%.*}/program/libvclplug_kde4lo.so |
al@19828 | 111 |
al@19828 | 112 # remove gstreamer0 support (libavmediagst_0_10.so) |
al@19828 | 113 # leave gstreamer1 support (libavmediagst.so) |
al@19828 | 114 rm $fs/opt/libreoffice${VERSION%.*}/program/libavmediagst_0_10.so |
al@19828 | 115 |
al@19828 | 116 # remove multilingual files |
al@19828 | 117 find $fs -name '*.properties' | \ |
al@19828 | 118 while read i; do |
al@19828 | 119 j=$(basename $i .properties) |
al@19828 | 120 case $j in |
al@19828 | 121 *de|*en_US|*es|*fr|*it|*pt_BR|*ru) ;; |
al@19828 | 122 *) rm $i;; |
al@19828 | 123 esac |
al@19828 | 124 done |
al@19828 | 125 |
al@19828 | 126 # remove icon themes; leave only default tango theme (-11MB) |
al@19828 | 127 for i in $fs/opt/libreoffice${VERSION%.*}/share/config/images*.zip; do |
al@19828 | 128 case $(basename $i .zip) in |
al@19828 | 129 *tango) ;; |
al@19828 | 130 *) rm $i;; |
al@19828 | 131 esac |
al@19828 | 132 done |
al@19828 | 133 |
al@19828 | 134 # remove wiki-publisher extension |
al@19828 | 135 rm -r $fs/opt/libreoffice${VERSION%.*}/share/extensions/wiki-publisher |
al@19828 | 136 |
al@19828 | 137 # remove unneded desktop integration |
al@19828 | 138 rm -r $fs/usr/lib/ |
al@19828 | 139 cd $fs/usr/share/ |
al@20465 | 140 rm -r mime-info/ application-registry/ icons/locolor/ icons/gnome/ |
al@20465 | 141 rm -r icons/hicolor/scalable/ |
al@19828 | 142 |
al@19828 | 143 # remove other files |
al@19828 | 144 rm -r $fs/opt/libreoffice${VERSION%.*}/readmes/ |
al@19828 | 145 |
al@19828 | 146 sizes |
al@19828 | 147 |
al@19828 | 148 # action 'Compressing xml files...' |
al@19828 | 149 # # compress xml-based files |
al@19828 | 150 # t="$(mktemp)" |
al@19828 | 151 # find $fs -type f \( -name '*.xml' -o -name 'xsl' \) | \ |
al@19828 | 152 # while read i; do |
al@19828 | 153 # xmlstarlet c14n --without-comments "$i" | \ |
al@19828 | 154 # xmlstarlet --no-doc-namespace sel -B -t -c '*' > $t |
al@19828 | 155 # cat "$t" > "$i" |
al@19828 | 156 # done |
al@19828 | 157 # sizes |
al@19828 | 158 ;; |
al@19828 | 159 |
al@19828 | 160 LibreOffice-extra) |
al@19828 | 161 # all the rest... |
al@20513 | 162 copy @std *.inc @rm |
al@19828 | 163 CAT="office|extra files" |
al@20905 | 164 DEPENDS="glib gst0-plugins-base gstreamer0 libepoxy libicu libxml2 \ |
al@21078 | 165 libice libsm libx11 libxext" |
al@20905 | 166 SUGGESTED="libQtCore libQtGui libQtNetwork" |
al@19828 | 167 ;; |
al@19828 | 168 esac |
al@19828 | 169 } |