1 # Description: LibreOffice is a powerful office suite
2 # URL: https://www.libreoffice.org/
3 # Maintainer: Tim Biermann, tbier at posteo dot de
4 # Depends on: clucene coin-or-mp fakeroot fontforge gpgme graphite2 gst-plugins-base gtk3 harfbuzz-icu hyphen libabw libcdr libcmis libe-book libepubgen libetonyek libexttextcat libfreehand libmspub libmwaw libmythes libnumbertext libodfgen liborcus libpagemaker libqxp libstaroffice libtommath libvisio libwpg libwps libzmf lpsolve libqrcodegen mysql neon libpaper python3-lxml redland sane unzip xmlsec zip
5 # Optional: cups kio qt5 valgrind vlc
6
7 name=libreoffice
8 version=7.0.1.2
9 release=1
10 pdfiumversion=4137
11 source=(https://downloadarchive.documentfoundation.org/libreoffice/old/$version/src/$name-$version.tar.xz
12 https://downloadarchive.documentfoundation.org/libreoffice/old/$version/src/$name-dictionaries-$version.tar.xz
13 https://dev-www.libreoffice.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll
14 https://dev-www.libreoffice.org/src/0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz
15 https://dev-www.libreoffice.org/src/dtoa-20180411.tgz
16 https://dev-www.libreoffice.org/src/skia-m84-c1baf6e1c2a5454148adb516f0f833483b5a0353.tar.xz
17 https://dev-www.libreoffice.org/src/pdfium-$pdfiumversion.tar.bz2 makefile.in.patch)
18
19 unpack_source() {
20 for file in ${source[@]}; do
21 case ${file##*/} in
22 libreoffice-*.tar.xz)
23 bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
24 185d60944ea767075d27247c3162b3bc-unowinreg.dll)
25 mkdir $SRC/tarballs || true
26 cp $(get_filename $file) $SRC/tarballs ;;
27 0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz)
28 mkdir $SRC/tarballs || true
29 cp $(get_filename $file) $SRC/tarballs ;;
30 pdfium-$pdfiumversion.tar.bz2)
31 mkdir $SRC/tarballs || true
32 cp $(get_filename $file) $SRC/tarballs ;;
33 dtoa-20180411.tgz)
34 mkdir $SRC/tarballs || true
35 cp $(get_filename $file) $SRC/tarballs ;;
36 skia-m84-c1baf6e1c2a5454148adb516f0f833483b5a0353.tar.xz)
37 mkdir $SRC/tarballs || true
38 cp $(get_filename $file) $SRC/tarballs ;;
39 *)
40 cp $(get_filename $file) $SRC ;;
41 esac
42 done
43 }
44
45 build() {
46 cd $name-$version
47
48 patch -Np1 -i $SRC/makefile.in.patch
49
50 find -L . \
51 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
52 -o -perm 511 \) -exec chmod 755 {} \; -o \
53 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
54 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
55
56 # determine configure options based on installed packages on the system
57 [[ -e /usr/lib/ccache ]] && PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')"
58 [[ -e /usr/lib/ccache ]] && PKGMK_LIBREOFFICE+=" --enable-ccache" || PKGMK_LIBREOFFICE+=" --disable-ccache"
59 [[ -e /usr/lib/cups ]] && PKGMK_LIBREOFFICE+=" --enable-cups" || PKGMK_LIBREOFFICE+=" --disable-cups"
60 [[ -e /usr/lib/pkgconfig/Qt5Core.pc ]] && PKGMK_LIBREOFFICE+=" --enable-qt5" || PKGMK_LIBREOFFICE+=" --disable-qt5"
61 [[ -e /usr/include/KF5/KIOCore ]] && PKGMK_LIBREOFFICE+=" --enable-kde5 --enable-gtk3-kde5"
62 [[ -e /usr/share/vlc ]] && PKGMK_LIBREOFFICE+=" --enable-vlc" || PKGMK_LIBREOFFICE+=" --disable-vlc" # experimental vlc av backend
63 [[ -e /usr/lib/pkgconfig/valgrind.pc ]] && PKGMK_LIBREOFFICE+=" --with-valgrind"
64
65 local build_date=$(date +%Y%m%d)
66 ./autogen.sh $PKGMK_LIBREOFFICE \
67 --with-parallelism=${JOBS-1} \
68 --prefix=/usr \
69 --with-external-tar="$SRC/tarballs" \
70 --enable-{build-opensymbol,dbus,firebird-sdbc=no,gtk3,introspection=yes,release-build,odk,openssl,pdfium,python=system} \
71 --with-{lang="",package-format=archive,myspell-dicts,parallelism} \
72 --with-extra-buildid="$(crux | awk '{ print $1 " " $3 }') ${build_date}" \
73 --with-package-version="$version" \
74 --with-system-{headers,libs} \
75 --with-external-dict-dir=/usr/share/hunspell \
76 --with-external-hyph-dir=/usr/share/hypen \
77 --with-external-thes-dir=/usr/share/mythes \
78 --without-{doxygen,fonts,gssapi,help,helppack-integration,java,system-firebird} \
79 --disable-{avahi,build-unowinreg,dconf,dependency-tracking,extension-update,fetch-external} \
80 --disable-{firebird-sdbc,poppler,postgresql-sdbc,report-builder,sdremote-bluetooth,werror}
81
82 touch {sources.ver,src.downloaded}
83 echo "lo_sources_ver=${version}" > sources.ver
84 make build-nocheck
85
86 pushd workdir/installation/LibreOffice/archive/install/en-US
87 tar xf *.tar.gz
88 popd
89
90 make DESTDIR=$PKG distro-pack-install
91
92 install -dm755 $PKG/usr/etc/libreoffice
93 install -m644 $PKG/usr/lib/libreoffice/program/{bootstraprc,sofficerc} \
94 $PKG/usr/etc/libreoffice/
95 install -m644 $PKG/usr/lib/libreoffice/share/psprint/psprint.conf \
96 $PKG/usr/etc/libreoffice/
97
98 # install dummy links to make them found by lo
99 cd $PKG/usr/lib/libreoffice/program/
100 ln -vsrf $PKG/usr/etc/libreoffice/{bootstraprc,sofficerc} .
101
102 # cleanup
103 rm -r $PKG/usr/share/libreoffice/sdk
104 rm -r $PKG/usr/lib/libreoffice/sdk
105 rm -r $PKG/usr/share/doc
106 find $PKG -iname "*readme*" -exec rm -fr '{}' \+
107 }
|