wok-next view LibreOffice/receipt @ rev 20500

Tiny edits: fix permissions and avoid out-of-tree files.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Mar 15 20:43:55 2018 +0200 (2018-03-15)
parents 6805cf8ff938
children d43bf7aae921
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
85 remove_already_packed
86 DEPENDS="gtk+ dbus-glib libcomerr libkrb5 xorg-libSM \
87 xorg-libXinerama xorg-libXrandr"
88 SUGGESTED="gst1-plugins-base mesa"
90 action 'Info: current size is...'; sizes
92 action 'Removing Java support...'
93 # remove Java support
94 find $fs -name '*.jar' -delete
95 rm $fs/opt/libreoffice${VERSION%.*}/program/libofficebean.so
96 sizes
98 action 'Removing unwanted files...'
99 # remove kde & qt support
100 rm $fs/opt/libreoffice${VERSION%.*}/program/libkde4be1lo.so
101 rm $fs/opt/libreoffice${VERSION%.*}/program/libvclplug_kde4lo.so
103 # remove gstreamer0 support (libavmediagst_0_10.so)
104 # leave gstreamer1 support (libavmediagst.so)
105 rm $fs/opt/libreoffice${VERSION%.*}/program/libavmediagst_0_10.so
107 # remove multilingual files
108 find $fs -name '*.properties' | \
109 while read i; do
110 j=$(basename $i .properties)
111 case $j in
112 *de|*en_US|*es|*fr|*it|*pt_BR|*ru) ;;
113 *) rm $i;;
114 esac
115 done
117 # remove icon themes; leave only default tango theme (-11MB)
118 for i in $fs/opt/libreoffice${VERSION%.*}/share/config/images*.zip; do
119 case $(basename $i .zip) in
120 *tango) ;;
121 *) rm $i;;
122 esac
123 done
125 # remove wiki-publisher extension
126 rm -r $fs/opt/libreoffice${VERSION%.*}/share/extensions/wiki-publisher
128 # remove unneded desktop integration
129 rm -r $fs/usr/lib/
130 cd $fs/usr/share/
131 rm -r mime-info/ application-registry/ icons/locolor/ icons/gnome/
132 rm -r icons/hicolor/scalable/
134 # remove other files
135 rm -r $fs/opt/libreoffice${VERSION%.*}/readmes/
137 sizes
139 # action 'Compressing xml files...'
140 # # compress xml-based files
141 # t="$(mktemp)"
142 # find $fs -type f \( -name '*.xml' -o -name 'xsl' \) | \
143 # while read i; do
144 # xmlstarlet c14n --without-comments "$i" | \
145 # xmlstarlet --no-doc-namespace sel -B -t -c '*' > $t
146 # cat "$t" > "$i"
147 # done
148 # sizes
149 ;;
151 LibreOffice-extra)
152 # all the rest...
153 copy @std *.inc
154 remove_already_packed
155 CAT="office|extra files"
156 ;;
157 esac
158 }