updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / openoffice-de-bin-unstable / PKGBUILD
blob65632fff03316638310ed21f1ab3ac6f748cf931
1 #!/bin/bash
3 # Maintainer: Kurt J. Bosch <kjb-temp-2009 at alpenjodel.de>
5 _lang='de'
7 _source_url="http://download.services.openoffice.org/files/extended/3.4beta"
9 # Source directories containing the RPMs to install
10 _source_dirs=( OOO340_m0_native_packed-3_${_lang}.9583 )
12 # Install path components as found in RPMs
13 _install_prefix='opt'
14 _install_name='ooo-dev3'
15 #_install_name='openoffice.org3'
16 _install_path=${_install_prefix}/${_install_name}
18 pkgname=openoffice-${_lang}-bin-unstable
19 pkgver=3.4beta_20110411
20 pkgrel=1
21 pkgdesc="German language pack for OpenOffice.org - Prerelease repackaged from upstream"
22 arch=('any')
23 url="http://openoffice.org/"
24 license=('LGPL3') # see below
25 depends=(
26 "openoffice-base-bin-unstable>=${pkgver}"
28 makedepends=(
29 'rpmextract'
31 options=(!strip docs)
32 install=openoffice-i18n-bin.install
33 source=( "${_source_url}/OOo-Dev_${pkgver}_Linux_x86_langpack-rpm_${_lang}.tar.gz" )
34 md5sums=( 'd1c357bd3f86d1d53b454a9b1440d836' )
36 _find_rpms() {
37 local dir file
38 for dir in "${_source_dirs[@]}"; do
39 dir=${srcdir:-src}/${dir}
40 ( cd "${dir}" ) # check existing
41 for file in $( find "${dir}" -type f -name '*.rpm' ); do
42 if ! [[ $file == */desktop-integration/* && $file != *-freedesktop-menus-* ]] &&
43 ! [[ $file == */jre-* ]]; then
44 echo "${file}"
45 elif type -p msg2 >/dev/null; then
46 msg2 "Skipping ${file##*/}" >&2
47 else
48 echo "Skipping ${file##*/}" >&2
50 done
51 done
54 _ln_s_t() {
55 local dir=$1 prefix=$2
56 shift 2
57 mkdir -p "$dir"
58 local file
59 for file in "${@}"; do
60 readlink -v -e "${file}" >/dev/null # check existing
61 ln -s -T /"${file}" "${dir}/${prefix}${file##*/}"
62 done
65 package() {
66 cd "${pkgdir}"
67 # unpack RPMs
68 local file
69 for file in $( _find_rpms ); do
70 msg2 "Extracting ${file##*/}"
71 rpmextract.sh "${file}"
72 done
73 msg2 "Completing package"
74 # add licenses (found by find pkg -ipath '*license*')
75 #_ln_s_t usr/share/licenses/${pkgname} '' \
76 # ${_install_path}/share/extensions/dict-en/WordNet_license.txt
79 ## Functions for manual usage
81 # makepkg -o && source PKGBUILD && _list_rpm_depends
82 # Helper for finding external dependencies
83 _list_rpm_depends() {
84 local file
85 for file in $( _find_rpms ); do
86 r=$( rpmmeta -t requirename "${file}" | sed -re 's;(ooobasis|ooo-dev|ooodev|openoffice|rpmlib)[^ ]*;;g' )
87 [[ $r ]] || continue
88 echo ${file##*/} $r
89 done
92 # makepkg -o && source PKGBUILD && _find_license_files
93 # Helper for finding license files
94 _find_license_files() {
95 find pkg -ipath '*license*' -type f
98 # makepkg -o && source PKGBUILD && _make_install_script >${install}.new
99 # Helper for porting install scripts
100 _make_install_script() {
101 cat <<EOF
102 #!/bin/bash
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
111 for args in 'prein pre_install' 'postin post_install' 'preun pre_remove' 'postun post_remove'; do
112 set -- $args
113 echo "$2() {"
114 echo " local RPM_INSTALL_PREFIX='${_install_prefix}'"
115 echo
116 local file code
117 for file in $( _find_rpms ); do
118 code=$( rpmmeta -t $1 "${file}" )
119 [[ $code ]] || continue
120 echo " ( ### ${file##*/} $1"
121 echo "$code"
122 echo " )"
123 echo
124 done
125 echo "}"
126 echo
127 done
129 cat <<EOF
130 ## arg 1: the new package version
131 ## arg 2: the old package version
132 pre_upgrade() {
133 pre_install "\$1"
136 ## arg 1: the new package version
137 ## arg 2: the old package version
138 post_upgrade() {
139 post_install "\$1"
142 # vim:set ts=2 sw=2 et: