wok-next view LibreOffice/receipt @ rev 21017

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