cruxports/libreoffice-bin/Pkgfile

52 lines
1.9 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
# Optional: qt5 cups sane
name=libreoffice-bin
Name=LibreOffice
version=7.3.5.2
release=1
source=(https://downloadarchive.documentfoundation.org/${name%-bin}/stable/$version/rpm/x86_64/${Name}_${version%.*}_Linux_x86-64_rpm.tar.gz)
build() {
cd ${Name}*/RPMS
for RPM in *.rpm; do
[[ $RPM =~ "-firebird-" ]] && continue
[[ $RPM =~ "-report-builder-" ]] && continue
[[ $RPM =~ "-mediawiki-" ]] && continue
[[ $RPM =~ "-mediawiki-" ]] && continue
[[ $RPM =~ "-onlineupdate-" ]] && continue
[[ $RPM =~ "-kde-integration-" ]] && continue
[[ $RPM =~ "-gnome-integration-" ]] && continue
[[ $RPM =~ "-postgresql-" ]] && continue
[[ $RPM =~ "-nlpsolver-" ]] && continue
[[ $RPM =~ "-ooofonts-" ]] && continue
[[ $RPM =~ "-ogltrans-" ]] && continue
[[ $RPM =~ "-javascript-" ]] && continue
[[ $RPM =~ "-beanshell-" ]] && continue
[[ $RPM =~ "-dict-" ]] && [[ ! $RPM =~ "-dict-${LANG:0:2}" ]] && continue
bsdtar -p -C $PKG -xf "$RPM"
done
mv "$PKG/opt" "$PKG/usr/lib"
find "$PKG" -type d -perm 700 -exec chmod 755 {} +
mkdir -p "$PKG/usr/bin" && cd "$PKG/usr/bin"
rm -f libreoffice7.3
ln -sf ../lib/libreoffice7.3/program/soffice soffice
ln -sf ../lib/libreoffice7.3/program/soffice libreoffice
rm -f "$PKG"/usr/share/applications/*.desktop
cd "$PKG"/usr/share/applications
for APP in ../../lib/libreoffice7.3/share/xdg/*.desktop; do
ln -sf $APP libreoffice7.3-${APP##*/}
done
# clean up junk files
rm -rf "$PKG"/usr/lib/libreoffice7.3/readmes
find "$PKG" \( -name "README*" -o -name "LICENSE*" -o -name "NOTICE*" -o -name "COPYING*" \) -exec rm {} +
find "$PKG" -name "wininst*.exe" -exec rm {} +
}