wok-next view LibreOffice/receipt @ rev 21087
Updates...
Revert names: libsdl -> sdl, libsmpeg -> smpeg, libtdb -> tdb
Revert names: libsdl -> sdl, libsmpeg -> smpeg, libtdb -> tdb
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Dec 28 05:11:49 2018 +0200 (2018-12-28) |
parents | 7b8e000b629f |
children | e19ff076dc63 |
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 REPOLOGY="libreoffice"
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="$PACKAGE-langpack-de $PACKAGE-langpack-es $PACKAGE-langpack-fr \
21 $PACKAGE-langpack-it $PACKAGE-langpack-pt-BR $PACKAGE-langpack-ru \
22 $PACKAGE $PACKAGE-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 'libnspr4.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
55 # make symlink relative: /usr/bin/libreoffice6.0 -> /opt/libreoffice6.0/program/soffice
56 fix symlinks
57 }
59 genpkg_rules() {
60 case $PACKAGE in
61 LibreOffice-langpack-*)
62 lang=${PACKAGE#*langpack-}
63 copy *$lang.res $lang/ $lang.zip dict-$lang/ *-$lang.xcd *_$lang.xcd
65 action 'Removing unwanted files...'
66 find $fs -name '*.properties' | \
67 while read i; do
68 j=$(basename $i .properties)
69 case $j in
70 *de|*en_US|*es|*fr|*it|*pt_BR|*ru) ;;
71 *) rm $i;;
72 esac
73 done
74 sizes
76 case $lang in
77 de) L='German';;
78 es) L='Spanish';;
79 fr) L='French';;
80 it) L='Italian';;
81 pt-BR) L='Portuguese Brazilian';;
82 ru) L='Russian';;
83 esac
84 CAT="localization|$L langpack"
85 DEPENDS="LibreOffice"
86 ;;
87 LibreOffice)
88 copy @std *.inc @rm
89 DEPENDS="atk cairo dbus dbus-glib fontconfig freetype gdk-pixbuf \
90 glib gpgme gst1-plugins-base gstreamer1 gtk2 icu lcms2 libassuan \
91 libcomerr libcups libcurl libepoxy libgpg-error libicu libkrb5 \
92 libsqlite3 libxml2 libxslt neon nspr nss pango perl python \
93 libice libsm libx11 libxext libxinerama \
94 libxrandr libxrender zlib"
95 SUGGESTED="mesa"
97 action 'Info: current size is...'; sizes
99 action 'Removing Java support...'
100 # remove Java support
101 find $fs -name '*.jar' -delete
102 rm $fs/opt/libreoffice${VERSION%.*}/program/libofficebean.so
103 sizes
105 action 'Removing unwanted files...'
106 # remove kde & qt support
107 rm $fs/opt/libreoffice${VERSION%.*}/program/libkde4be1lo.so
108 rm $fs/opt/libreoffice${VERSION%.*}/program/libvclplug_kde4lo.so
110 # remove gstreamer0 support (libavmediagst_0_10.so)
111 # leave gstreamer1 support (libavmediagst.so)
112 rm $fs/opt/libreoffice${VERSION%.*}/program/libavmediagst_0_10.so
114 # remove multilingual files
115 find $fs -name '*.properties' | \
116 while read i; do
117 j=$(basename $i .properties)
118 case $j in
119 *de|*en_US|*es|*fr|*it|*pt_BR|*ru) ;;
120 *) rm $i;;
121 esac
122 done
124 # remove icon themes; leave only default tango theme (-11MB)
125 for i in $fs/opt/libreoffice${VERSION%.*}/share/config/images*.zip; do
126 case $(basename $i .zip) in
127 *tango) ;;
128 *) rm $i;;
129 esac
130 done
132 # remove wiki-publisher extension
133 rm -r $fs/opt/libreoffice${VERSION%.*}/share/extensions/wiki-publisher
135 # remove unneded desktop integration
136 rm -r $fs/usr/lib/
137 cd $fs/usr/share/
138 rm -r mime-info/ application-registry/ icons/locolor/ icons/gnome/
139 rm -r icons/hicolor/scalable/
141 # remove other files
142 rm -r $fs/opt/libreoffice${VERSION%.*}/readmes/
144 sizes
146 # action 'Compressing xml files...'
147 # # compress xml-based files
148 # t="$(mktemp)"
149 # find $fs -type f \( -name '*.xml' -o -name 'xsl' \) | \
150 # while read i; do
151 # xmlstarlet c14n --without-comments "$i" | \
152 # xmlstarlet --no-doc-namespace sel -B -t -c '*' > $t
153 # cat "$t" > "$i"
154 # done
155 # sizes
156 ;;
158 LibreOffice-extra)
159 # all the rest...
160 copy @std *.inc @rm
161 CAT="office|extra files"
162 DEPENDS="glib gst0-plugins-base gstreamer0 libepoxy libicu libxml2 \
163 libice libsm libx11 libxext"
164 SUGGESTED="libQtCore libQtGui libQtNetwork"
165 ;;
166 esac
167 }