updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / thrift / PKGBUILD
blobea5c5f187d0af8a463fa50bbd9f5d05554fa88cd
1 # Contributor: Byron Clark <byron@theclarkfamily.name>
2 # based on thrift-git PKGBUILD
3 pkgname=thrift
4 pkgver=0.8.0
5 pkgrel=1
6 pkgdesc="Scalable cross-language services framework for IPC/RPC between C++, Java, Ruby, PHP, Python, C#, Haskell, Erlang, etc."
7 arch=(i686 x86_64)
8 url="http://thrift.apache.org/"
9 license=(APACHE)
10 depends=(boost)
11 makedepends=(java-environment apache-ant python2 php perl perl-bit-vector perl-class-accessor)
12 optdepends=('python2: to use Python bindings'
13             'java-environment: to use Java bindings'
14             'php: to use PHP bindings'
15             'perl: to use Perl bindings'
16             'perl-bit-vector: to use Perl bindings'
17             'perl-class-accessor: to use Perl bindings')
18 options=(!emptydirs)
19 source=(http://www.apache.org/dist/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz
20         maven-repo-path.patch)
21 md5sums=('d29dfcd38d476cbc420b6f4d80ab966c'
22          '65bbe2a4260d9f7e3a8e385919788ff0')
24 build() {
25   cd "$srcdir/$pkgname-$pkgver"
27   patch -p1 -i $srcdir/maven-repo-path.patch
29   # apache-ant is not installed in a normal path location
30   . /etc/profile.d/apache-ant.sh
32   PYTHON=/usr/bin/python2 /bin/sh ./configure --prefix=/usr
34   # compiler
35   make -C compiler/cpp
36   install -d -m 0755 $pkgdir/usr/bin
37   install -m 0755 compiler/cpp/thrift $pkgdir/usr/bin
39   # C++ library
40   make -C lib/cpp
41   make -C lib/cpp DESTDIR=$pkgdir install
43   # Python library
44   pushd lib/py
45   python2 setup.py build
46   python2 setup.py install --no-compile --root=$pkgdir
47   popd
49   # Java library
50   pushd lib/java
51   ant
52   install -d -m 0755 $pkgdir/usr/share/java/thrift
53   install -D -m 0644 build/libthrift-${pkgver}.jar $pkgdir/usr/share/java/thrift
54   popd
56   # PHP library
57   pushd lib/php/src
58   install -d -m 0755 $pkgdir/usr/share/php/thrift
59   for ITEM in *; do
60     if [ "$ITEM" != ext ]; then
61       cp -R "$ITEM" $pkgdir/usr/share/php/thrift
62     fi
63   done
64   find $pkgdir/usr/share/php/thrift -type d | xargs chmod 0755
65   find $pkgdir/usr/share/php/thrift -type f | xargs chmod 0644
66   pushd ext/thrift_protocol
67   phpize
68   /bin/sh ./configure
69   make
70   make INSTALL_ROOT=$pkgdir install
71   popd
72   popd
74   # Perl library
75   pushd lib/perl
76   PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
77   make
78   make install DESTDIR=$pkgdir
79   find $pkgdir -name perllocal.pod -delete
80   find $pkgdir -name .packlist -delete
81   popd
84 # vim:set ts=2 sw=2 et: