updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / openchange / PKGBUILD
blobb0a97f768d495ab252e5e74c4456bae74bac05ff
1 # Maintainer: Adam Russell <adamlr6+arch@gmail.com>
2 # Contributor: ngoonee <ngoonee.talk@gmail.com>
3 pkgname=openchange
4 _codename=TRANSPORTER
5 _dlid=142
6 pkgver=0.11
7 pkgrel=2
8 pkgdesc="Library for MAPI connectivity with Microsoft Exchange. This package was SPECIFICALLY created to support evolution-mapi and may not work for any other purpose."
9 arch=('i686' 'x86_64')
10 url="http://www.openchange.org"
11 license=('GPL3')
12 depends=('samba4=4.0.0A17' 'popt' 'libical' 'sqlite3' 'file' 'boost' 'zlib')
13 makedepends=('ccache' 'python2' 'subversion' 'git' 'docbook-xsl' 'libxslt')
14 options=(!makeflags)
15 # Releases are mirrored at http://tracker.openchange.org/projects/openchange/files
16 source=("http://tracker.openchange.org/attachments/download/${_dlid}/${pkgname}-${pkgver}-${_codename}.tar.gz")
18 md5sums=('7e5d2de7399f429048390a04aa8c5e79')
19 _prefix="/opt/samba4"
21 build() {
22         cd ${srcdir}/${pkgname}-${pkgver}-${_codename}
24         SAVEIFS=${IFS}
25         IFS=$(echo -en "\n\b")
26         PYTHON_CALLERS="$(find ${srcdir}/${pkgname}-${pkgver}-${_codename} -name '*.py')
27 $(find ${srcdir}/${pkgname}-${pkgver}-${_codename}/  -type f)
28 $(find ${srcdir}/${pkgname}-${pkgver}-${_codename}/ -name 'configure.ac')"
29         sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
30                -e "s|python-config$|python2-config|" \
31                -e "s|bin/python$|bin/python2|" \
32             ${PYTHON_CALLERS}
33         IFS=${SAVEIFS}
35         export PYTHON=/usr/bin/python2
37         export PKG_CONFIG_PATH="${_prefix}/samba/lib/pkgconfig:${_prefix}/lib/pkgconfig"
38         export BOOST_LIB_SUFFIX="-mt"
39         ./autogen.sh
40         ./configure --prefix=${_prefix} --with-samba=${_prefix}
41         make || return 1
44 package() {
45         _pyver=`python2 -c 'import sys; print(sys.version[:3])'`
47         cd ${srcdir}/${pkgname}-${pkgver}-${_codename}
48         make DESTDIR="$pkgdir/" install
50         cd ${pkgdir}/${_prefix}/lib/
51         ln -s libmapi.so libmapi.so.0
53         find ${pkgdir}/${_prefix}/lib/python${_pyver}/site-packages/ -name '*.py' | \
54              xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"