wok-next view LibreOffice/receipt @ rev 20185

abiword, apache, connman, elementary, evince, ffmpeg, go, mono: receipt v2
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Nov 02 18:17:32 2017 +0100 (2017-11-02)
parents
children 6805cf8ff938
line source
1 # SliTaz package receipt v2.
3 PACKAGE="LibreOffice"
4 VERSION="5.4.0"
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 i486) 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 # Rules to configure and make the package.
27 compile_rules()
28 {
29 echo 'Checking language packages...'
30 for i in de es fr it pt-BR ru; do
31 TARBALL="LibreOffice_${VERSION}_Linux_${lo_arch2}_deb_langpack_$i.tar.gz"
32 WGET_URL="$(dirname $WGET_URL)/$TARBALL"
33 [ -e "$SRC/$TARBALL" ] || wget -O $SRC/$TARBALL $WGET_URL
34 tar -xzf $SRC/$TARBALL
35 done
36 action 'Extracting LibreOffice...'
37 # extract all deb's filesystem into $install
38 find . -name '*.deb' -exec dpkg-deb -x '{}' $install \;
39 sizes $install
41 # substitute desktop files symlinks by actual files (to be processed by cook)
42 find $install/usr/share/applications/ -type l -delete # no way to remove 'broken' symlinks by `rm`
43 find $install/opt/libreoffice${VERSION%.*}/share/xdg/ -type f | \
44 while read i; do
45 mv $i $install/usr/share/applications/libreoffice${VERSION%.*}-$(basename $i)
46 done
47 # remove useless (after processing by sdft) lines from desktop files
48 sed -i '/^#/d; /^Actions=/d; s|X-Red-Hat-Base;||;
49 s|X-MandrivaLinux-[^;]*;||' $install/usr/share/applications/*.desktop
50 }
52 # Rules to gen a SliTaz package suitable for Tazpkg.
53 genpkg_rules()
54 {
55 case $PACKAGE in
56 LibreOffice-langpack-*)
57 lang=${PACKAGE#*langpack-}
58 copy *$lang.res $lang/ $lang.zip dict-$lang/ *-$lang.xcd *_$lang.xcd
60 action 'Removing unwanted files...'
61 find $fs -name '*.properties' | \
62 while read i; do
63 j=$(basename $i .properties)
64 case $j in
65 *de|*en_US|*es|*fr|*it|*pt_BR|*ru) ;;
66 *) rm $i;;
67 esac
68 done
69 sizes
71 case $lang in
72 de) L='German';;
73 es) L='Spanish';;
74 fr) L='French';;
75 it) L='Italian';;
76 pt-BR) L='Portuguese Brazilian';;
77 ru) L='Russian';;
78 esac
79 CAT="localization|$L langpack"
80 DEPENDS="LibreOffice"
81 ;;
82 LibreOffice)
83 copy @std *.inc
84 remove_already_packed
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 mimelnk/ mime-info/ application-registry/ appdata/
131 rm -r icons/locolor/ icons/gnome/
132 cd icons/hicolor/
133 rm -r scalable/ 512x512/ 256x256/ 128x128/ 32x32/
135 # remove other files
136 rm -r $fs/opt/libreoffice${VERSION%.*}/readmes/
138 sizes
140 # action 'Compressing xml files...'
141 # # compress xml-based files
142 # t="$(mktemp)"
143 # find $fs -type f \( -name '*.xml' -o -name 'xsl' \) | \
144 # while read i; do
145 # xmlstarlet c14n --without-comments "$i" | \
146 # xmlstarlet --no-doc-namespace sel -B -t -c '*' > $t
147 # cat "$t" > "$i"
148 # done
149 # sizes
150 ;;
152 LibreOffice-extra)
153 # all the rest...
154 copy @std *.inc
155 remove_already_packed
156 CAT="office|extra files"
157 ;;
158 esac
159 }