cruxports/libreoffice-bin/Pkgfile

55 lines
1.7 KiB
Plaintext

# Description: a powerful office suite, compiled upstream
# URL: https://www.libreoffice.org/
# Maintainer: John McQuah, jmcquah at disroot dot org
# Depends on: gtk3 freetype avahi cups nss nspr
# Optional: qt5 sane
name=libreoffice-bin
version=7.5.4
release=1
source=(https://download.documentfoundation.org/${name%-bin}/stable/$version/rpm/x86_64/LibreOffice_${version}_Linux_x86-64_rpm.tar.gz)
build() {
cd LibreOffice*/RPMS
for RPM in *.rpm; do
case $RPM in
*-firebird-*) ;;
*-report-builder-*) ;;
*-mediawiki-*) ;;
*-onlineupdate-*) ;;
*-kde-integration-*) ;;
*-postgresql-*) ;;
*-nlpsolver-*) ;;
*-ooofonts-*) ;;
*-ooolinguistic-*) ;;
*-ogltrans-*) ;;
*-javascript-*) ;;
*-beanshell-*) ;;
*-dict-*)
[[ $RPM =~ "-dict-${LANG:0:2}" ]] && bsdtar -p -C $PKG -xf "$RPM"
;;
*)
bsdtar -p -C $PKG -xf "$RPM"
;;
esac
done
mv "$PKG/opt" "$PKG/usr/lib"
find "$PKG" -type d -perm 700 -exec chmod 755 {} +
rm -f "$PKG/usr/bin/libreoffice7.5"
ln -s ../lib/libreoffice7.5/program/soffice "$PKG/usr/bin/libreoffice7.5"
rm -f "$PKG"/usr/share/applications/*.desktop
cd "$PKG"/usr/share/applications
for APP in ../../lib/libreoffice7.5/share/xdg/*.desktop; do
ln -sf $APP libreoffice7.5-${APP##*/}
done
# clean up junk files
rm -rf "$PKG"/usr/lib/libreoffice7.5/readmes
find "$PKG" \( -name "README*" -o -name "LICENSE*" -o -name "NOTICE*" \
-o -name "COPYING*" \) -delete
find "$PKG" -name "wininst*.exe" -delete
}