wok-next view LibreOffice/receipt @ rev 20883

Check Repology info from h* to l* packages
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Jul 11 02:06:34 2018 +0300 (2018-07-11)
parents d958fec46c9f
children e7a485521d6a
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="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 @rm
154 CAT="office|extra files"
155 ;;
156 esac
157 }