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 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 mysql neon paper python3-lxml redland sane unzip xmlsec zip
5 # Optional: cups gst-plugins-base kio qt5 valgrind vlc
6
7 name=libreoffice
8 version=6.3.4.1
9 release=1
10 source=(
11 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/pdfium-3794.tar.bz2
16 makefile.in.patch
17 fix_mdds-orcus.patch
18 config.patch
19 )
20
21 unpack_source() {
22 for file in ${source[@]}; do
23 case ${file##*/} in
24 libreoffice-*.tar.xz)
25 bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
26 185d60944ea767075d27247c3162b3bc-unowinreg.dll)
27 mkdir $SRC/tarballs || true
28 cp $(get_filename $file) $SRC/tarballs ;;
29 0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz)
30 mkdir $SRC/tarballs || true
31 cp $(get_filename $file) $SRC/tarballs ;;
32 pdfium-3794.tar.bz2)
33 mkdir $SRC/tarballs || true
34 cp $(get_filename $file) $SRC/tarballs ;;
35 *)
36 cp $(get_filename $file) $SRC ;;
37 esac
38 done
39 }
40
41 build() {
42 cd $name-$version
43 patch -Np0 -i ../makefile.in.patch
44 patch -Np1 -i ../fix_mdds-orcus.patch
45 # fixed borked configure script that fails to test for pdfium and poppler
46 patch -Np0 -i ../config.patch
47
48 find -L . \
49 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
50 -o -perm 511 \) -exec chmod 755 {} \; -o \
51 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
52 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
53
54 # determine configure options based on installed packages on the system
55 [[ -e /usr/lib/ccache ]] && PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')"
56 [[ -e /usr/lib/ccache ]] && PKGMK_LIBREOFFICE+=" --enable-ccache" || PKGMK_LIBREOFFICE+=" --disable-ccache"
57 [[ -e /usr/lib/cups ]] && PKGMK_LIBREOFFICE+=" --enable-cups" || PKGMK_LIBREOFFICE+=" --disable-cups"
58 [[ -e /usr/lib/pkgconfig/gstreamer-plugins-base-1.0.pc ]] && PKGMK_LIBREOFFICE+=" --enable-gstreamer-1-0" || PKGMK_LIBREOFFICE+=" --disable-gstreamer-1-0"
59 [[ -e /usr/lib/pkgconfig/Qt5Core.pc ]] && PKGMK_LIBREOFFICE+=" --enable-qt5" || PKGMK_LIBREOFFICE+=" --disable-qt5"
60 [[ -e /usr/share/kf5/ ]] && PKGMK_LIBREOFFICE+=" --enable-kde5 --enable-gtk3-kde5"
61 [[ -e /usr/share/vlc ]] && PKGMK_LIBREOFFICE+=" --enable-vlc" || PKGMK_LIBREOFFICE+=" --disable-vlc" # experimental vlc av backend
62 [[ -e /usr/lib/pkgconfig/valgrind.pc ]] && PKGMK_LIBREOFFICE+=" --with-valgrind"
63
64 local build_date=$(date +%Y%m%d)
65 ./autogen.sh $PKGMK_LIBREOFFICE \
66 --with-parallelism=${JOBS-1} \
67 --prefix=/usr \
68 --with-external-tar="$SRC/tarballs" \
69 --enable-{build-opensymbol,dbus,firebird-sdbc=no,gtk3,introspection=yes,release-build,odk,openssl,pdfium,python=system} \
70 --with-{lang="",package-format=archive,myspell-dicts,parallelism} \
71 --with-build-version="$name-$version" \
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,gstreamer-0-10,gtk,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 }
|