updated on Wed Jan 25 20:08:56 UTC 2012
[aur-mirror.git] / openoffice-base-bin-cs / PKGBUILD
blob5b08f87cb7c75ea040071cfb4c37ef1d2f3691d1
2 # Maintainer: Kurt J. Bosch <kjb-temp-2009 at alpenjodel.de>
3 # Modified for Czech language by Jirka Zelinka j.zelinka@centrum.cz
5 _lang=cs
6 pkgname=openoffice-base-bin-cs
7 pkgver=3.3.0
8 pkgrel=2
9 pkgdesc="OpenOffice.org - Repackaged from upstream"
10 arch=('i686' 'x86_64')
11 url="http://openoffice.org/"
12 license=('LGPL3') # more below
13 # Some depends can be found in the README, some with namcap, some with _extract_depends() below
14 depends=(
15         'desktop-file-utils'        # install script
16         'freetype2'
17         'glibc>=2.5'
18         'gtk2>=2.10.4'
19         'hicolor-icon-theme'
20         'sh'                        # freedesktop-menus
21         'shared-mime-info'          # install script
23 makedepends=(
24         'coreutils' 'findutils' 'rpmextract'
25 #       'binutils' 'tar' # _debunpack()
27 optdepends=(
28         'libgail-gnome: GNOME Assistive Technology'
29         'mime-types: provides /etc/mime.types'
30         'openoffice-de-bin: Language pack (example)'
32 backup=() # more below
33 options=(!strip docs)
34 install=openoffice-bin-cs.install
36 _url="http://download.services.openoffice.org/files"
37 _arch="-ARCH-" # feed the AUR ;-)
38 _src_extra=""
39 case "$CARCH"
40 in "i686"   ) _arch="x86"   ;                     md5sums=( 'f3f4984212021253df3507767eccc5b0' )
41 ;; "x86_64" ) _arch="x86-64"; _src_extra="-wJRE"; md5sums=( '00c9d69a798d5d7437a30a93f6f4df97' )
42 esac
43 _dirs=( "${srcdir}"/OOO330_m20_native_packed-1_${_lang}.9567 )
45 # deb tarballs contain no freedesktop integration !
46 source=("${_url}"/localized/cs/${pkgver}/OOo_${pkgver}_Linux_${_arch}_install-rpm${_src_extra}_cs.tar.gz )
48 #_debunpack() { ar -p "$1" data.tar.gz | tar -xz; }
50 package() {
51         cd "${pkgdir}"
52         # unpack RPMs and DEBs
53         local dir file
54         for dir in "${_dirs[@]}"; do
55                 for file in $( cd "${dir}" && find -type f \( -name '*.rpm' -o -name '*.deb' \) ); do
56                         if [[ $file == */desktop-integration/* && $file != *-freedesktop-menus-* ]] ||
57                            [[ $file == */jre* ]]; then
58                                 msg2 "Skipping ${file#./}"
59                                 continue
60                         fi
61                         msg2 "Extracting ${file#./}"
62                         case $file
63                         in *.rpm ) rpmextract.sh "${dir}/${file}"
64                         ;; *.deb ) _debunpack    "${dir}/${file}"
65                         esac
66                 done
67         done
68         local base=opt
69         # link license files
70         local file i=0
71         for file in $( find "${base}" -type f -name 'THIRDPARTY*LICENSE*.html' ); do
72                 mkdir -p usr/share/licenses/${pkgname}
73                 ln -sT /${file} usr/share/licenses/${pkgname}/THIRDPARTY-$((++i)).html
74                 license+=( "custom:THIRDPARTY-$i" )
75         done
76         # add backups
77         backup+=( ${base}/openoffice.org3/program/sofficerc )
78         # link mozilla plugin
79         mkdir -p usr/lib/mozilla/plugins
80         ln -s -t usr/lib/mozilla/plugins /${base}/openoffice.org3/program/libnpsoplugin.so
83 # Function for listing external dependencies
84 _extract_depends() {
85         (( $# == 1 )) || { echo "Usage: $FUNCNAME <RPMS-directory-path>" >&2; return 1; }
86         (
87                 cd "$1"
88                 for f in $( find -type f -name '*.rpm' ); do
89                         r=$( rpmmeta -t requirename $f | sed -re 's;(ooobasis|openoffice|rpmlib)[^ ]*;;g' )
90                         [[ $r ]] && echo ${f#./} $r
91                 done
92         )
95 # Function for extracting install script code
96 _extract_install() {
97         (( $# == 1 )) || { echo "Usage: $FUNCNAME <RPMS-directory-path>" >&2; return 1; }
98         cat <<EOF
99 ## arg 1:  the new package version
100 post_install() {
102   ## code from freedesktop-menus rpm tag postin
104   #### Inappropriate parts should be removed:
105   #### - mime.type stuff is already provided by mime-types package
106   #### - /etc/mailcap does not exist on ArchLinux normaly
107   #### - Don't use 'which' because tools are already in depends
110         rpmmeta -t postin "${1}"/desktop-integration/openoffice*-freedesktop-menus-*.noarch.rpm
111         cat <<EOF
114 ## arg 1:  the new package version
115 ## arg 2:  the old package version
116 post_upgrade() {
117   post_install \$1
120 ## arg 1:  the old package version
121 post_remove() {
123   ## code from freedesktop-menus rpm tag postun
125   #### inappropriate parts should be removed
128         rpmmeta -t postun "${1}"/desktop-integration/openoffice*-freedesktop-menus-*.noarch.rpm
129         cat <<EOF