wok-next view LibreOffice/receipt @ rev 20465

Up LibreOffice (6.0.2), TiMidity++, jack, zstd (1.3.3)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Mar 07 23:09:42 2018 +0200 (2018-03-07)
parents 0f38eda21e70
children a8e106e92cc2
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
48 }
50 genpkg_rules() {
51 case $PACKAGE in
52 LibreOffice-langpack-*)
53 lang=${PACKAGE#*langpack-}
54 copy *$lang.res $lang/ $lang.zip dict-$lang/ *-$lang.xcd *_$lang.xcd
56 action 'Removing unwanted files...'
57 find $fs -name '*.properties' | \
58 while read i; do
59 j=$(basename $i .properties)
60 case $j in
61 *de|*en_US|*es|*fr|*it|*pt_BR|*ru) ;;
62 *) rm $i;;
63 esac
64 done
65 sizes
67 case $lang in
68 de) L='German';;
69 es) L='Spanish';;
70 fr) L='French';;
71 it) L='Italian';;
72 pt-BR) L='Portuguese Brazilian';;
73 ru) L='Russian';;
74 esac
75 CAT="localization|$L langpack"
76 DEPENDS="LibreOffice"
77 ;;
78 LibreOffice)
79 copy @std *.inc
80 remove_already_packed
81 DEPENDS="gtk+ dbus-glib libcomerr libkrb5 xorg-libSM \
82 xorg-libXinerama xorg-libXrandr"
83 SUGGESTED="gst1-plugins-base mesa"
85 action 'Info: current size is...'; sizes
87 action 'Removing Java support...'
88 # remove Java support
89 find $fs -name '*.jar' -delete
90 rm $fs/opt/libreoffice${VERSION%.*}/program/libofficebean.so
91 sizes
93 action 'Removing unwanted files...'
94 # remove kde & qt support
95 rm $fs/opt/libreoffice${VERSION%.*}/program/libkde4be1lo.so
96 rm $fs/opt/libreoffice${VERSION%.*}/program/libvclplug_kde4lo.so
98 # remove gstreamer0 support (libavmediagst_0_10.so)
99 # leave gstreamer1 support (libavmediagst.so)
100 rm $fs/opt/libreoffice${VERSION%.*}/program/libavmediagst_0_10.so
102 # remove multilingual files
103 find $fs -name '*.properties' | \
104 while read i; do
105 j=$(basename $i .properties)
106 case $j in
107 *de|*en_US|*es|*fr|*it|*pt_BR|*ru) ;;
108 *) rm $i;;
109 esac
110 done
112 # remove icon themes; leave only default tango theme (-11MB)
113 for i in $fs/opt/libreoffice${VERSION%.*}/share/config/images*.zip; do
114 case $(basename $i .zip) in
115 *tango) ;;
116 *) rm $i;;
117 esac
118 done
120 # remove wiki-publisher extension
121 rm -r $fs/opt/libreoffice${VERSION%.*}/share/extensions/wiki-publisher
123 # remove unneded desktop integration
124 rm -r $fs/usr/lib/
125 cd $fs/usr/share/
126 rm -r mime-info/ application-registry/ icons/locolor/ icons/gnome/
127 rm -r icons/hicolor/scalable/
129 # remove other files
130 rm -r $fs/opt/libreoffice${VERSION%.*}/readmes/
132 sizes
134 # action 'Compressing xml files...'
135 # # compress xml-based files
136 # t="$(mktemp)"
137 # find $fs -type f \( -name '*.xml' -o -name 'xsl' \) | \
138 # while read i; do
139 # xmlstarlet c14n --without-comments "$i" | \
140 # xmlstarlet --no-doc-namespace sel -B -t -c '*' > $t
141 # cat "$t" > "$i"
142 # done
143 # sizes
144 ;;
146 LibreOffice-extra)
147 # all the rest...
148 copy @std *.inc
149 remove_already_packed
150 CAT="office|extra files"
151 ;;
152 esac
153 }