You are not logged in.

#1 2012-10-08 18:20:57

synthead
Member
Registered: 2006-05-09
Posts: 1,337

AUR for LibreOffice GIT (can't upload to AUR?)

I have created a PKGBUILD for LibreOffice that builds from the GIT master branch, but the AUR won't allow me to upload it, so I'm putting it here.

Source package: http://8bitboobs.com/stuff/libreoffice- … src.tar.gz

PKGBUILD:

# Maintainer: Maxwell Pray a.k.a. Synthead <synthead@gmail.com>
# Contributor: AndyRTR <andyrtr@archlinux.org>

pkgbase='libreoffice-git'
pkgname=(
  'libreoffice-common-git'
  'libreoffice-base-git'
  'libreoffice-calc-git'
  'libreoffice-draw-git'
  'libreoffice-gnome-git'
  'libreoffice-impress-git'
  'libreoffice-kde4-git'
  'libreoffice-math-git'
  'libreoffice-sdk-git'
  'libreoffice-sdk-doc-git'
  'libreoffice-writer-git'
  'libreoffice-en-US-git'
  'libreoffice-postgresql-connector-git'
  'libreoffice-extension-pdfimport-git'
  'libreoffice-extension-presenter-screen-git'
  'libreoffice-extension-presentation-minimizer-git'
  'libreoffice-extension-report-builder-git'
  'libreoffice-scripting-beanshell-git'
  'libreoffice-scripting-javascript-git'
  'libreoffice-extension-scripting-python-git'
  'libreoffice-extension-wiki-publisher-git'
  'libreoffice-extension-nlpsolver-git'
)
pkgver=20121008
pkgrel=1
arch=(
  'i686'
  'x86_64'
)
license=('LGPL3')
url="http://www.libreoffice.org/"
makedepends=(
  'apache-ant'
  'beanshell'
  'bluez'
  'cppunit'
  'doxygen'
  'gconf'
  'gperf'
  'gstreamer0.10-base'
  'hsqldb-java'
  'imagemagick'
  'java-environment'
  'junit'
  'kdelibs'
  'libmythes'
  'libwpg'
  'mesa'
  'perl-archive-zip'
  'postgresql-libs'
  'sane'
  'unixodbc'
  'unzip'
  'vigra'
  'zip'
)
depends=(
  'curl>=7.20.0'
  'dbus-glib'
  'desktop-file-utils'
  'gcc-libs'
  'graphite'
  'gtk2'
  'hicolor-icon-theme'
  'hunspell>=1.2.8'
  'hyphen'
  'icu>=49.1'
  'lcms2'
  'libgl'
  'libjpeg'
  'librsvg'
  'libtextcat'
  'libwpd>=0.9.2'
  'libxaw'
  'libxrandr'
  'libxslt'
  'lpsolve'
  'neon>=0.28.6'
  'nspr'
  'orbit2'
  'pango'
  'python2>=2.7'
  'redland'
  'sh'
  'shared-mime-info'
  'translate-toolkit'
  'ttf-dejavu'
  'xdg-utils'
)

_gitroot=(
  'git://anongit.freedesktop.org/libreoffice/core'
  'git://anongit.freedesktop.org/libreoffice/help'
  'git://anongit.freedesktop.org/libreoffice/translations'
)
_gitname=(
  'libreoffice-core'
  'libreoffice-help'
  'libreoffice-translations'
)

_additional_source_url="http://dev-www.libreoffice.org/src"
_additional_source_url2="http://dev-www.libreoffice.org/extern"

source=(
  "$_additional_source_url/0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz"
  "$_additional_source_url/18f577b374d60b3c760a3a3350407632-STLport-4.5.tar.gz"
  "$_additional_source_url/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz"
  "$_additional_source_url/2a177023f9ea8ec8bd00837605c5df1b-jakarta-tomcat-5.0.30-src.tar.gz"
  "$_additional_source_url/2ae988b339daec234019a7066f96733e-commons-lang-2.3-src.tar.gz"
  "$_additional_source_url/2c9b0f83ed5890af02c0df1c1776f39b-commons-httpclient-3.1-src.tar.gz"
  "$_additional_source_url/3404ab6b1792ae5f16bbd603bd1e1d03-libformula-1.1.7.zip"
  "$_additional_source_url/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip"
  "$_additional_source_url/39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip"
  "$_additional_source_url/3bdf40c0d199af31923e900d082ca2dd-libfonts-1.1.6.zip"
  "$_additional_source_url/3c219630e4302863a9a83d0efde889db-commons-logging-1.1.1-src.tar.gz"
  "$_additional_source_url/46d9f4cf8b145c21ce1056e116d2ce71-liborcus_0.1.0.tar.bz2"
  "$_additional_source_url/48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz"
  "$_additional_source_url/599dc4cc65a07ee868cf92a667a913d2-xpdf-3.02.tar.gz"
  "$_additional_source_url/6097739c841f671cb21332b9cc593ae7-libexttextcat-3.3.1.tar.bz2"
  "$_additional_source_url/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip"
  "$_additional_source_url/8ce2fcd72becf06c41f7201d15373ed9-librepository-1.1.6.zip"
  "$_additional_source_url/94e7f271e38c976462558b4278590178-libvisio-0.0.19.tar.bz2"
  "$_additional_source_url/97b2d4dba862397f446b217e2b623e71-libloader-1.1.6.zip"
  "$_additional_source_url/9f9e15966b5624834157fe3d748312bc-mdds_0.6.1.tar.bz2"
  "$_additional_source_url/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip"
  "$_additional_source_url/ace6ab49184e329db254e454a010f56d-libxml-1.1.7.zip"
  "$_additional_source_url/ada24d37d8d638b3d8a9985e80bc2978-source-9.0.0.7-bj.zip"
  "$_additional_source_url/af3c3acf618de6108d65fcdc92b492e1-commons-codec-1.3-src.tar.gz"
  "$_additional_source_url/b2371dc7cf4811c9d32146eec913d296-libcmis-0.3.0.tar.gz"
  "$_additional_source_url/b2db54b6e96287ac995d7ed654ace4fc-libmspub-0.0.3.tar.bz2"
  "$_additional_source_url/ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip"
  "$_additional_source_url/3c0037fb07dea2f0bbae8386fa7c6a9a-libcdr-0.0.9.tar.bz2"
  "$_additional_source_url/d197bd6211669a2fa4ca648faf04bcb1-libwps-0.2.7.tar.bz2"
  "$_additional_source_url/d8bd5eed178db6e2b18eeed243f85aa8-flute-1.1.6.zip"
  "$_additional_source_url/db60e4fde8dd6d6807523deb71ee34dc-liblayout-0.2.10.zip"
  "$_additional_source_url/eeb2c7ddf0d302fba4bfc6e97eac9624-libbase-1.1.6.zip"
  "$_additional_source_url/f02578f5218f217a9f20e9c30e119c6a-boost_1_44_0.tar.bz2"
  "$_additional_source_url/f94d9870737518e3b597f9265f4e9803-libserializer-1.1.6.zip"
  "$_additional_source_url/fa6a2f85bd28baab035b2c95e722713f-liblangtag-0.2.tar.bz2"
  "$_additional_source_url/fdb27bfe2dbe2e7b57ae194d9bf36bab-SampleICC-1.3.2.tar.gz"
  "$_additional_source_url2/185d60944ea767075d27247c3162b3bc-unowinreg.dll"
  'improve-vml-path-parsing-to-handle-repeated-commands.patch::https://gerrit.libreoffice.org/gitweb?p=core.git;a=patch;h=9cc362d8b210bfa06ad40e15dd3c8b37b10fa702'
  'vml-import-only-apply-width-percent-attribute-if-non-zero.patch::https://gerrit.libreoffice.org/gitweb?p=core.git;a=patch;h=4dd8bb09dc4ac1a499a159a4c647475230170d71'
)
noextract=(
  '0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz'
  '185d60944ea767075d27247c3162b3bc-unowinreg.dll'
  '18f577b374d60b3c760a3a3350407632-STLport-4.5.tar.gz'
  '1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz'
  '2a177023f9ea8ec8bd00837605c5df1b-jakarta-tomcat-5.0.30-src.tar.gz'
  '2ae988b339daec234019a7066f96733e-commons-lang-2.3-src.tar.gz'
  '2c9b0f83ed5890af02c0df1c1776f39b-commons-httpclient-3.1-src.tar.gz'
  '3404ab6b1792ae5f16bbd603bd1e1d03-libformula-1.1.7.zip'
  '35c94d2df8893241173de1d16b6034c0-swingExSrc.zip'
  '39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip'
  '3bdf40c0d199af31923e900d082ca2dd-libfonts-1.1.6.zip'
  '3c219630e4302863a9a83d0efde889db-commons-logging-1.1.1-src.tar.gz'
  '46d9f4cf8b145c21ce1056e116d2ce71-liborcus_0.1.0.tar.bz2'
  '48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz'
  '599dc4cc65a07ee868cf92a667a913d2-xpdf-3.02.tar.gz'
  '6097739c841f671cb21332b9cc593ae7-libexttextcat-3.3.1.tar.bz2'
  '798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip'
  '8ce2fcd72becf06c41f7201d15373ed9-librepository-1.1.6.zip'
  '94e7f271e38c976462558b4278590178-libvisio-0.0.19.tar.bz2'
  '97b2d4dba862397f446b217e2b623e71-libloader-1.1.6.zip'
  '9f9e15966b5624834157fe3d748312bc-mdds_0.6.1.tar.bz2'
  'a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip'
  'ace6ab49184e329db254e454a010f56d-libxml-1.1.7.zip'
  'ada24d37d8d638b3d8a9985e80bc2978-source-9.0.0.7-bj.zip'
  'af3c3acf618de6108d65fcdc92b492e1-commons-codec-1.3-src.tar.gz'
  'b2371dc7cf4811c9d32146eec913d296-libcmis-0.3.0.tar.gz'
  'b2db54b6e96287ac995d7ed654ace4fc-libmspub-0.0.3.tar.bz2'
  'ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip'
  '3c0037fb07dea2f0bbae8386fa7c6a9a-libcdr-0.0.9.tar.bz2'
  'd197bd6211669a2fa4ca648faf04bcb1-libwps-0.2.7.tar.bz2'
  'd8bd5eed178db6e2b18eeed243f85aa8-flute-1.1.6.zip'
  'db60e4fde8dd6d6807523deb71ee34dc-liblayout-0.2.10.zip'
  'eeb2c7ddf0d302fba4bfc6e97eac9624-libbase-1.1.6.zip'
  'f02578f5218f217a9f20e9c30e119c6a-boost_1_44_0.tar.bz2'
  'f94d9870737518e3b597f9265f4e9803-libserializer-1.1.6.zip'
  'fa6a2f85bd28baab035b2c95e722713f-liblangtag-0.2.tar.bz2'
  'fdb27bfe2dbe2e7b57ae194d9bf36bab-SampleICC-1.3.2.tar.gz'
)
md5sums=(
  '0168229624cfac409e766913506961a8'
  '18f577b374d60b3c760a3a3350407632'
  '1f24ab1d39f4a51faf22244c94a6203f'
  '2a177023f9ea8ec8bd00837605c5df1b'
  '2ae988b339daec234019a7066f96733e'
  '2c9b0f83ed5890af02c0df1c1776f39b'
  '3404ab6b1792ae5f16bbd603bd1e1d03'
  '35c94d2df8893241173de1d16b6034c0'
  '39bb3fcea1514f1369fcfc87542390fd'
  '3bdf40c0d199af31923e900d082ca2dd'
  '3c219630e4302863a9a83d0efde889db'
  '46d9f4cf8b145c21ce1056e116d2ce71'
  '48d647fbd8ef8889e5a7f422c1bfda94'
  '599dc4cc65a07ee868cf92a667a913d2'
  '6097739c841f671cb21332b9cc593ae7'
  '798b2ffdc8bcfe7bca2cf92b62caf685'
  '8ce2fcd72becf06c41f7201d15373ed9'
  '94e7f271e38c976462558b4278590178'
  '97b2d4dba862397f446b217e2b623e71'
  '9f9e15966b5624834157fe3d748312bc'
  'a7983f859eafb2677d7ff386a023bc40'
  'ace6ab49184e329db254e454a010f56d'
  'ada24d37d8d638b3d8a9985e80bc2978'
  'af3c3acf618de6108d65fcdc92b492e1'
  'b2371dc7cf4811c9d32146eec913d296'
  'b2db54b6e96287ac995d7ed654ace4fc'
  'ba2930200c9f019c2d93a8c88c651a0f'
  '3c0037fb07dea2f0bbae8386fa7c6a9a'
  'd197bd6211669a2fa4ca648faf04bcb1'
  'd8bd5eed178db6e2b18eeed243f85aa8'
  'db60e4fde8dd6d6807523deb71ee34dc'
  'eeb2c7ddf0d302fba4bfc6e97eac9624'
  'f02578f5218f217a9f20e9c30e119c6a'
  'f94d9870737518e3b597f9265f4e9803'
  'fa6a2f85bd28baab035b2c95e722713f'
  'fdb27bfe2dbe2e7b57ae194d9bf36bab'
  '185d60944ea767075d27247c3162b3bc'
  '82893e891aca9c2f04df6347253c1d04'
  'c3f2473294124bd83e49328761c362ac'
)

install_from_list() {
  # Create directories from .txt file.
  for directory in $(grep '^%dir' "$srcdir/libreoffice-core-build/file-lists/$1_list.txt"); do
    install -dm 755 "$pkgdir/${directory/\%dir}"
  done

  # Install files into pkg from the fakeinstall dir.
  for file in $(grep -v '^%dir' "$srcdir/libreoffice-core-build/file-lists/$1_list.txt"); do
    dirname="$(dirname "$file")"

    # Check if directory has been already been created.
    [[ -d "$pkgdir/$dirname" ]] || install -dm 755 "$pkgdir/$dirname"

    # Move file from fakeinstall to $pkgdir.
    mv "$srcdir/fakeinstall$file" "$pkgdir$file"
  done
}

unzip_extension() {
  # Unzip this extension to $pkgdir.
  install -dm 755 "$pkgdir/usr/lib/libreoffice/share/extensions"
  unzip -q "$srcdir/libreoffice-core-build/solver/unxlng"*"/bin/$1.oxt" -d "$pkgdir/usr/lib/libreoffice/share/extensions/$1"
}

build() {
  # Manage the three GIT repositories.
  cd "$srcdir"

  for i in {0..2}; do
    msg "Connecting to GIT server for ${_gitname[i]}..."
  
    if [[ -d "$srcdir/${_gitname[i]}" ]]; then
      msg2 "Updating local GIT repository..."
      cd "$srcdir/${_gitname[i]}" && git pull origin
    else
      msg2 "Downloading GIT repository..."
      git clone "${_gitroot[i]}" "$srcdir/${_gitname[i]}"
    fi
  
    msg2 "Cloning for build..."
    rm -rf "$srcdir/${_gitname[i]}-build"
    git clone "$srcdir/${_gitname[i]}" "$srcdir/${_gitname[i]}-build"
  done

  msg "Starting build..."

  cd "$srcdir/${_gitname[0]}-build"

  # Patches for better support for "inked" documents.

  patch -p1 < "$srcdir/improve-vml-path-parsing-to-handle-repeated-commands.patch"
  patch -p1 < "$srcdir/vml-import-only-apply-width-percent-attribute-if-non-zero.patch"

  # Correctly set environment variables.
  unset J2REDIR J2SDKDIR JAVA_HOME CLASSPATH EXTRAOPTS
  . /etc/profile.d/jdk.sh || . /etc/profile.d/openjdk6.sh
  [[ ! $ANT_HOME ]] && . /etc/profile.d/apache-ant.sh

  # Create symlinks for external sources.
  [[ -d "$srcdir/ext_sources" ]] && rm -r "$srcdir/ext_sources"
  mkdir "$srcdir/ext_sources"
  for source in "${noextract[@]}"; do
    ln -s "$srcdir/$source" "$srcdir/ext_sources"
  done

  # Create symlinks for the "help" and "translations" repositories.
  ln -s ../libreoffice-help-build/helpcontent2 "$srcdir/${_gitname[0]}-build"
  ln -s ../libreoffice-translations-build/translations "$srcdir/${_gitname[0]}-build"

  # Use the CFLAGS, but remove the LibO overridden ones.
  for i in $CFLAGS; do
    case "$i" in
      -O?|-pipe|-Wall|-g|-fexceptions) continue ;;
    esac
    ARCH_FLAGS="$ARCH_FLAGS $i"
  done
  
  # Fix for python2.
  export PYTHON=python2

  # Configure LibreOffice with a Swiss Army knife of options!

  ./autogen.sh \
    --disable-ext-mysql-connector \
    --disable-fetch-external \
    --disable-gnome-vfs \
    --disable-kde \
    --disable-mozilla \
    --disable-verbose \
    --enable-crashdump \
    --enable-dbus \
    --enable-evolution2 \
    --enable-ext-nlpsolver \
    --enable-ext-scripting-beanshell \
    --enable-ext-scripting-javascript \
    --enable-ext-wiki-publisher \
    --enable-gio \
    --enable-gtk3 \
    --enable-kde4 \
    --enable-librsvg=system \
    --enable-lockdown \
    --enable-mergelibs \
    --enable-odk \
    --enable-opengl \
    --enable-split-app-modules \
    --exec-prefix=/usr \
    --libdir=/usr/lib \
    --mandir=/usr/share/man \
    --prefix=/usr \
    --sysconfdir=/etc \
    --with-alloc=system \
    --with-ant-home="/usr/share/apache-ant" \
    --with-build-version="GIT-$pkgver ArchLinux build-$pkgrel" \
    --with-external-dict-dir=/usr/share/hunspell \
    --with-external-hyph-dir=/usr/share/hyphen \
    --with-external-tar="${srcdir}/ext_sources" \
    --with-external-thes-dir=/usr/share/mythes \
    --with-java-target-version=1.5 \
    --with-lang="" \
    --with-max-jobs=${MAKEFLAGS/-j/} \
    --with-num-cpus=${MAKEFLAGS/-j/} \
    --with-system-beanshell \
    --with-system-cairo \
    --with-system-cppunit \
    --with-system-dicts \
    --with-system-graphite \
    --with-system-headers \
    --with-system-hsqldb \
    --with-system-libs \
    --with-system-libwpg \
    --with-system-mysql \
    --with-system-mythes \
    --with-system-redland \
    --with-unix-wrapper="libreoffice" \
    --with-vendor="ArchLinux" \
    --without-afms \
    --without-fonts \
    --without-myspell-dicts \
    --without-ppds \
    --without-system-apache-commons \
    --without-system-boost \
    --without-system-clucene \
    --without-system-jfreereport \
    --without-system-libcdr \
    --without-system-libcmis \
    --without-system-libexttextcat \
    --without-system-liblangtag \
    --without-system-libmspub \
    --without-system-libvisio \
    --without-system-libwps \
    --without-system-mdds \
    --without-system-mozilla \
    --without-system-mozilla-headers \
    --without-system-orcus \
    --without-system-poppler \
    --without-system-saxon \
    --without-system-servlet-api \
    $EXTRAOPTS

  # Tell LibreOffice that the sources are already downloaded.
  touch src.downloaded

  # Build LibreOffice.
  make

  # Create fake installation directory to create split file lists.
  mkdir "$srcdir/fakeinstall"

  # Install LibreOffice to the fake installation directory.
  make DESTDIR="$srcdir/fakeinstall" distro-pack-install
}

package_libreoffice-common-git() {
  pkgdesc="Common files for LibreOffice, a productivity suite that is compatible with other major office suites."
  depends=(
    'libreoffice-langpack'
    'hunspell>=1.2.8'
    'python2>=2.7'
    'neon>=0.28.6'
    'nspr'
    'libsm'
    'redland'
    'hyphen'
    'graphite'
    'icu>=49.1'
    'lcms2'
    'hicolor-icon-theme'
    'desktop-file-utils'
    'shared-mime-info'
    'xdg-utils'
    'orbit2'
  )
  optdepends=(
    'libreoffice-langpack: Additional language support.'
    'java-runtime:         Adds java support.'
    'libcups:              Adds printing support.'
    'gconf:                Adds additional gnome support.'
    'nss:                  Adds support for signed files/macros.'
    'pstoedit:             Translates PostScript and PDF graphics into other vector formats.'
    'libmythes:            For use in thesaurus.'
    'beanshell:            Interactive java; good for prototyping and macros.'
    'vigra:                C++ computer vision library, usable in Basebmp.'
    'libmspack:            Library for Microsoft compression formats for use in FontOOo.'
    'libwpg:               Library for importing and converting Corel WordPerfect(tm) Graphics images.'
    'sane:                 For scanner access.'
    'unixodbc:             Adds ODBC database support.'
    'gstreamer0.10-base:   Some gstr-plugins to support multimedia content, e.g. in impress.'
    'gtk2:                 For browser plugin.'
  )
  backup=(
    'etc/libreoffice/sofficerc'
    'etc/libreoffice/bootstraprc'
    'etc/libreoffice/psprint.conf'
  )
  groups=('libreoffice')
  provides=(
    'go-openoffice'
    'libreoffice-common'
  )
  conflicts=(
    'go-openoffice'
    'libreoffice-common'
  )
  replaces=(
    'go-openoffice'
    'libreoffice'
    'openoffice-base'
  )
  install='libreoffice-common.install'

  install_from_list common

  # Configuration files.
  install -dm 755 "$pkgdir/etc/libreoffice"
  install -m 644 "$pkgdir/usr/lib/libreoffice/program/"{bootstraprc,sofficerc} "$pkgdir/etc/libreoffice"
  install -m 644 "$pkgdir/usr/lib/libreoffice/share/psprint/psprint.conf" "$pkgdir/etc/libreoffice"

  # Install dummy links.
  cd "$pkgdir/usr/lib/libreoffice/program"
  ln -sf /etc/libreoffice/{bootstraprc,sofficerc} .
  cd "$pkgdir/usr/lib/libreoffice/share/psprint"
  ln -sf /etc/libreoffice/psprint.conf .
  
  # Move bash-completion files.
  install -dm755 "$pkgdir/usr/share/bash-completion/completions"
  mv "$pkgdir/etc/bash_completion.d/libreoffice.sh" "$pkgdir/usr/share/bash-completion/completions/libreoffice.sh"
  rm -rf "$pkgdir/etc/bash_completion.d"
  
  # Prevent conflicts.
  rm -f "$pkgdir/usr/lib/libreoffice/program/classes/ScriptProviderForJavaScript.jar"
  rm -f "$pkgdir/usr/lib/libreoffice/program/classes/js.jar"
  rm -f "$pkgdir/usr/lib/libreoffice/program/services/scriptproviderforjavascript.rdb"
}

package_libreoffice-base-git() {
  pkgdesc="GUI database front-end for LibreOffice.  Allows creation and management of databases through a GUI."
  depends=(
    'libreoffice-common'
    'hsqldb-java'
  )
  optdepends=('libreoffice-postgresql-connector')
  provides=('libreoffice-base')
  conflicts=(
    'go-openoffice'
    'libreoffice-base'
    'libreoffice-common'
  )
  groups=('libreoffice')
  replaces=('libreoffice')
  install='update-desktop-database.install'

  install_from_list base
}

package_libreoffice-postgresql-connector-git() {
  pkgdesc="A PostgreSQL connector for LibreOffice."
  depends=(
    'libreoffice-base'
    'postgresql-libs'
  )
  groups=('libreoffice')
  replaces=('libreoffice')
  provides=('libreoffice-postgresql-connector')
  conflicts=('libreoffice-postgresql-connector')

  # No file list for this package.
  install -dm 755 "$pkgdir/usr/lib/libreoffice/program/services"
  install -m 644 "$srcdir/fakeinstall/usr/lib/libreoffice/program/postgresql-sdbc.uno.so" "$pkgdir/usr/lib/libreoffice/program"
  install -m 644 "$srcdir/fakeinstall/usr/lib/libreoffice/program/postgresql-sdbc-impl.uno.so" "$pkgdir/usr/lib/libreoffice/program"
  install -m 644 "$srcdir/fakeinstall/usr/lib/libreoffice/program/postgresql-sdbc.ini" "$pkgdir/usr/lib/libreoffice/program"
  install -m 644 "$srcdir/fakeinstall/usr/lib/libreoffice/program/services/postgresql-sdbc.rdb" "$pkgdir/usr/lib/libreoffice/program/services"
  install -dm 755 "$pkgdir/usr/lib/libreoffice/share/registry"
  install -m 644 "$srcdir/fakeinstall/usr/lib/libreoffice/share/registry/postgresqlsdbc.xcd" "$pkgdir/usr/lib/libreoffice/share/registry"
}

package_libreoffice-calc-git() {
  pkgdesc="Spreadsheet application for LibreOffice."
  depends=(
    'libreoffice-common'
    'lpsolve'
  )
  groups=('libreoffice')
  replaces=('libreoffice')
  provides=('libreoffice-calc')
  conflicts=('libreoffice-calc')
  install='update-desktop-database.install'

  install_from_list calc
}

package_libreoffice-draw-git() {
  pkgdesc="Drawing application for LibreOffice."
  arch=('any')
  depends=('libreoffice-common')
  groups=('libreoffice')
  replaces=('libreoffice')
  provides=('libreoffice-draw')
  conflicts=('libreoffice-draw')
  install='update-desktop-database.install'

  install_from_list draw
}

package_libreoffice-gnome-git() {
  pkgdesc="Plug-in for LibreOffice that enables integration of Gnome and other GTK-based desktop environments."
  depends=(
    'gtk2'
    'gtk3'
    'libreoffice-common'
  )
  groups=('libreoffice')
  provides=('libreoffice-gnome')
  conflicts=('libreoffice-gnome')

  install_from_list gnome
}

package_libreoffice-impress-git() {
  pkgdesc="Presentation Application for LibreOffice."
  depends=('libreoffice-common')
  optdepends=('mesa:             For the OGLTrans extension.')
  groups=('libreoffice')
  replaces=('libreoffice')
  provides=('libreoffice-impress')
  conflicts=('libreoffice-impress')
  install='update-desktop-database.install'

  install_from_list impress
}

package_libreoffice-kde4-git() {
  pkgdesc="Plug-in for LibreOffice that enables integration into the KDE4 desktop environment."
  depends=(
    'libreoffice-common'
    'kdelibs'
  )
  groups=('libreoffice')
  provides=('libreoffice-kde4')
  conflicts=('libreoffice-kde4')

  install_from_list kde4
}

package_libreoffice-math-git() {
  pkgdesc="Equation editor for LibreOffice."
  depends=('libreoffice-common')
  groups=('libreoffice')
  replaces=('libreoffice')
  provides=('libreoffice-math')
  conflicts=('libreoffice-math')

  install_from_list math
}

package_libreoffice-sdk-git() {
  pkgdesc="Software Development Kit for LibreOffice."
  depends=(
    'gcc'
    'gcc-libs'
    'java-environment'
    'libreoffice-common'
    'make'
    'sh'
    'zip'
  )
  groups=('libreoffice')
  provides=('libreoffice-sdk')
  conflicts=('libreoffice-sdk')

  install_from_list sdk

  # Fix environment path for compatibility with openjdk6 and openjdk7.
  sed -ie 's:\/usr\/lib\/jvm\/java-7-openjdk:$J2SDKDIR:' "$pkgdir/usr/lib/libreoffice/sdk/setsdkenv_unix."{sh,csh}
}

package_libreoffice-sdk-doc-git() {
  pkgdesc="Software Development Kit documentation for LibreOffice."
  arch=('any')
  depends=(
    'libreoffice-common'
    'libreoffice-sdk'
  )
  groups=('libreoffice')
  provides=('libreoffice-sdk-doc')
  conflicts=('libreoffice-sdk-doc')

  install_from_list sdk_doc

  # Fix permissions.
  find "$pkgdir/usr/lib/libreoffice/sdk/examples" -type f -exec chmod -x {} \;
}

package_libreoffice-writer-git() {
  pkgdesc="Word Processor Application for LibreOffice."
  depends=(
    'libreoffice-common'
    'libwpd>=0.9.2'
    'libxml2'
  )
  optdepends=('libwpg:           Library for importing and converting Corel WordPerfect(tm) Graphics images.')
  groups=('libreoffice')
  replaces=('libreoffice')
  provides=('libreoffice-writer')
  conflicts=('libreoffice-writer')
  install='update-desktop-database.install'

  install_from_list writer
}

package_libreoffice-en-US-git() {
  pkgdesc="English (US) language pack for LibreOffice."
  arch=('any')
  provides=(
    'openoffice-en-US'
    'libreoffice-en-US'
    'libreoffice-langpack'
  )
  replaces=('openoffice-en-US')
  conflicts=(
    'openoffice-en-US'
    'libreoffice-en-US'
  )

  install_from_list lang_en_US
}

package_libreoffice-extension-pdfimport-git() {
  pkgdesc="LibreOffice extension to import and modify PDF documents."
  arch=('any')
  depends=('libreoffice-common')
  groups=('libreoffice-extensions')
  provides=('libreoffice-extension-pdfimport')
  conflicts=('libreoffice-extension-pdfimport')

  unzip_extension pdfimport
}

package_libreoffice-extension-presenter-screen-git() {
  pkgdesc="LibreOffice extension to provide more control over slide show presentations."
  depends=(
    'libreoffice-common'
    'java-environment'
  )
  groups=('libreoffice-extensions')
  provides=('libreoffice-extension-presenter-screen')
  conflicts=('libreoffice-extension-presenter-screen')

  unzip_extension presenter-screen
}

package_libreoffice-extension-presentation-minimizer-git() {
  pkgdesc="LibreOffice extension to reduce the file size of presentations."
  depends=(
     'libreoffice-common'
    'gcc-libs'
  )
  groups=('libreoffice-extensions')
  provides=('libreoffice-extension-presentation-minimizer')
  conflicts=('libreoffice-extension-presentation-minimizer')

  unzip_extension presentation-minimizer
}

package_libreoffice-extension-report-builder-git() {
  pkgdesc="LibreOffice extension to create database reports."
  arch=('any')
  depends=(
    'libreoffice-common'
    'java-environment'
  )
  groups=('libreoffice-extensions')
  provides=('libreoffice-extension-report-builder')
  conflicts=('libreoffice-extension-report-builder')
  
  unzip_extension report-builder
}

package_libreoffice-extension-scripting-python-git() {
  pkgdesc="LibreOffice extension to enable support for Python."
  arch=('any')
  depends=(
    'libreoffice-common'
    'python2'
  )
  groups=('libreoffice-extensions')
  provides=('libreoffice-extension-scripting-python')
  conflicts=('libreoffice-extension-scripting-python')
  
  unzip_extension script-provider-for-python
}

package_libreoffice-extension-wiki-publisher-git() {
  pkgdesc="LibreOffice extension to create Wiki articles on MediaWiki servers."
  arch=('any')
  depends=(
    'libreoffice-common'
    'java-environment'
  )
  groups=('libreoffice-extensions')
  provides=('libreoffice-extension-wiki-publisher')
  conflicts=('libreoffice-extension-wiki-publisher')
  
  unzip_extension wiki-publisher
}

package_libreoffice-extension-nlpsolver-git() {
  pkgdesc="LibreOffice extension for Calc: additional Solver engines for optimizing nonlinear programming models."
  arch=('any')
  depends=(
    'libreoffice-common'
    'java-environment'
  )
  groups=('libreoffice-extensions')
  provides=('libreoffice-extension-nlpsolver')
  conflicts=('libreoffice-extension-nlpsolver')
  
  unzip_extension nlpsolver
}

package_libreoffice-scripting-beanshell-git() {
  pkgdesc="LibreOffice extension for BeanShell script support."
  arch=('any')
  depends=(
    'libreoffice-common'
    'java-environment'
  )
  groups=('libreoffice-extensions')
  provides=('libreoffice-scripting-beanshell')
  conflicts=('libreoffice-scripting-beanshell')
  
  install -dm 755 "$pkgdir/usr/lib/libreoffice/program/"{classes,services}
  mv "$srcdir/fakeinstall/usr/lib/libreoffice/program/classes/ScriptProviderForBeanShell.jar" "$pkgdir/usr/lib/libreoffice/program/classes"
  mv "$srcdir/fakeinstall/usr/lib/libreoffice/program/services/scriptproviderforbeanshell.rdb" "$pkgdir/usr/lib/libreoffice/program/services"
}

package_libreoffice-scripting-javascript-git() {
  pkgdesc="LibreOffice extension to enable support for JavaScript."
  arch=('any')
  depends=(
    'libreoffice-common'
    'java-environment'
  )
  groups=('libreoffice-extensions')
  provides=('libreoffice-scripting-javascript')
  conflicts=('libreoffice-scripting-javascript')
  
  install -dm 755 "$pkgdir/usr/lib/libreoffice/program/"{classes,services}
  mv "$srcdir/libreoffice-core-build/solver/unxlngx6.pro/bin/"{js.jar,ScriptProviderForJavaScript.jar} "$pkgdir/usr/lib/libreoffice/program/classes"
  mv "$srcdir/libreoffice-core-build/solver/unxlngx6.pro/xml/scriptproviderforjavascript.rdb" "$pkgdir/usr/lib/libreoffice/program/services"
}

update-desktop-database.install

post_install() {
  update-desktop-database -q
}

post_upgrade() {
  post_install
}

post_remove() {
  post_install
}

libreoffice-common.install

post_upgrade() {
  xdg-icon-resource forceupdate --theme hicolor
  update-desktop-database -q
  update-mime-database usr/share/mime > /dev/null 2>&1
}

post_install() {
  post_upgrade

  printf '%s\n' \
    'LibreOffice is split into several packages:' \
    '- libreoffice-common' \
    '- libreoffice-{base,calc,draw,impress,math,writer}: Frontend applications.' \
    '- libreoffice-{gnome,kde4}: Desktop integration plugins.' \
    '- libreoffice-{sdk,sdk-doc}: SDK and documentation for the LibreOffice API and extensions (UNO components).' \
    '' \
    'In addition:' \
    '- At least one libreoffice-langpack needs to be installed.' \
    '- Install {hunspell,mythes,hyphen}-xx for spell checking.'
}

post_remove() {
  post_upgrade
}

Last edited by synthead (2012-10-08 19:40:13)

Offline

#2 2012-10-08 18:24:28

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: AUR for LibreOffice GIT (can't upload to AUR?)

Is the problem with split packages? https://bugs.archlinux.org/task/16394

Offline

#3 2012-10-08 18:48:56

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: AUR for LibreOffice GIT (can't upload to AUR?)

karol wrote:

Is the problem with split packages? https://bugs.archlinux.org/task/16394

That should be the problem. By the way, this PKGBUILD is way too large, you should at least create four separate files: core, help, translations (split-package for all translations or at least mention how to switch language), extensions.

Last edited by progandy (2012-10-08 18:50:33)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#4 2012-10-08 18:52:42

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: AUR for LibreOffice GIT (can't upload to AUR?)

progandy wrote:
karol wrote:

Is the problem with split packages? https://bugs.archlinux.org/task/16394

That should be the problem. By the way, this PKGBUILD is way too large, you should at least create four separate files: core, help, sdk, extensions.

This is based off an official package: https://projects.archlinux.org/svntogit … ibreoffice

Also, splitting it into multiple files means that the (large) GIT repo would need to be downloaded and compiled per PKGBUILD (yeech).

Offline

#5 2012-10-08 18:56:39

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: AUR for LibreOffice GIT (can't upload to AUR?)

synthead wrote:

Also, splitting it into multiple files means that the (large) GIT repo would need to be downloaded and compiled per PKGBUILD (yeech).

Coming in pacman 4.1 https://bugs.archlinux.org/task/8890 and https://bugs.archlinux.org/task/19476

Last edited by karol (2012-10-08 18:57:46)

Offline

#6 2012-10-08 19:01:58

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: AUR for LibreOffice GIT (can't upload to AUR?)

synthead wrote:

This is based off an official package: https://projects.archlinux.org/svntogit … ibreoffice

Also, splitting it into multiple files means that the (large) GIT repo would need to be downloaded and compiled per PKGBUILD (yeech).

Oh well, that was my opinion, but I can't say anything against the core team big_smile I thought this was a reasonable split, since there were three git repos. If you need all for one build, forget what I said.

PS: To upload a split-package to AUR create a meaningful global package description that mentions splitting, and use the mentioned workaround:
pkgname="AUR-name"
true && pkgname=(...) # the array

Last edited by progandy (2012-10-08 19:03:37)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#7 2012-10-08 19:09:08

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: AUR for LibreOffice GIT (can't upload to AUR?)

karol wrote:
synthead wrote:

Also, splitting it into multiple files means that the (large) GIT repo would need to be downloaded and compiled per PKGBUILD (yeech).

Coming in pacman 4.1 https://bugs.archlinux.org/task/8890 and https://bugs.archlinux.org/task/19476

Oooh!  Very nice!

Offline

Board footer

Powered by FluxBB