wok-next view LibreOffice/receipt @ rev 20736

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