summaryrefslogtreecommitdiff
path: root/manualPorts/libreoffice-bin/Pkgfile
blob: cc3bfbfbe040a17ad13f59884c88ed192ae974a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Description: a powerful office suite, compiled upstream
# URL: https://www.libreoffice.org/
# Maintainer: Erich Eckner, crux at eckner dot net
# Contributor: John McQuah, jmcquah at disroot dot org
# Depends on: gtk3 freetype avahi cups nss nspr
# Optional: qt5 sane

name=libreoffice-bin
Name=LibreOffice
version=7.5.0
release=1
source=(https://download.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 =~ "-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 {} +

  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

  rm -f "$PKG"/usr/bin/*
  cd "$PKG"/usr/bin
  for APP in soffice; do
      ln -sf ../lib/libreoffice*/program/$APP ${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*" \) -exec rm {} +
  find "$PKG" -name "wininst*.exe" -exec rm {} +
}