template 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Template file for 'openoffice'
  2. pkgname=openoffice
  3. version=4.1.14
  4. revision=1
  5. _vmaj=4
  6. _lang=en-US
  7. archs="x86_64 i686"
  8. create_wrksrc=yes
  9. depends="desktop-file-utils hicolor-icon-theme freetype glibc gtk+ shared-mime-info"
  10. short_desc="Free and Open Productivity Suite"
  11. maintainer="MarcoAPC <marcoaureliopc@gmail.com>"
  12. license="Apache-2.0"
  13. homepage="https://www.openoffice.org"
  14. nostrip=yes
  15. # To install different language version adjust the following lines: _lang and checksum.
  16. # available: ast, bg, ca, ca-XR, ca-XV, cs, da, de, el, en-GB, en-US, es, eu, fi, fr, gd, gl, he, hi, hu, it, ja, km, ko, lt, nb, nl, pl, pt, pt-BR, ru, SDK, sk, sl, sr, sv, ta, th, tr, vi, zh-CN, zh-TW
  17. case "$XBPS_TARGET_MACHINE" in
  18. x86_64)
  19. distfiles="https://downloads.apache.org/openoffice/${version}/binaries/${_lang}/Apache_OpenOffice_${version}_Linux_x86-64_install-rpm_${_lang}.tar.gz"
  20. checksum=680614656e1c5625b39111af37ff2e144b90cf0b3028c6e7d63bbd41ffc5863e
  21. ;;
  22. i686)
  23. distfiles="https://downloads.apache.org/openoffice/${version}/binaries/${_lang}/Apache_OpenOffice_${version}_Linux_x86_install-rpm_${_lang}.tar.gz"
  24. checksum=f20abdd86b9fbf4518fa80955048c0d6098569d78340b06c9567029509b03652
  25. ;;
  26. *)
  27. broken="No distfiles available for this target"
  28. ;;
  29. esac
  30. do_install() {
  31. _source_dirs=${_lang}/RPMS
  32. local dir file
  33. for dir in "${_source_dirs[@]}"; do
  34. dir=${wrksrc}/${dir}
  35. ( cd "${dir}" ) # check existing
  36. for file in $( find "${dir}" -type f -name '*.rpm' ); do
  37. echo "Extracting ${file##*/}"
  38. bsdtar -xf "${file}"
  39. if ! [[ $file == */desktop-integration/* && $file != *-freedesktop-menus-* ]] &&
  40. ! [[ $file == */jre-* ]]; then
  41. echo "${file}"
  42. elif type -p msg >/dev/null; then
  43. echo "Skipping ${file##*/}" >&2
  44. else
  45. echo "Skipping ${file##*/}" >&2
  46. fi
  47. done
  48. done
  49. # remove symlink to avoid conflict with libreoffice-common
  50. # (not used in the desktop files)
  51. [[ -h usr/bin/soffice ]] && rm -f usr/bin/soffice
  52. sed -i -re "1s;^#! *(/usr(/local)?)?/bin/(env +)?python(2[^ ]*)?( |$);#!/usr/bin/env python2 ;" $(
  53. find opt/openoffice${_vmaj}/program/python-core-2.7.18/lib -type f -name '*.py'
  54. )
  55. # Remove unused
  56. rm -rf usr/share/application-registry
  57. rm -rf usr/share/applnk-redhat
  58. rm -rf usr/lib/menu
  59. vcopy opt /
  60. vcopy usr /
  61. }