# Contributor: Francesco Colista # Maintainer: Francesco Colista pkgname=xapian-bindings pkgver=1.2.17 pkgrel=1 pkgdesc="Binding libraries for xapian" url="http://www.xapian.org" arch="all" license="GPL2+" depends="" depends_dev="libtool automake autoconf bash xapian-core-dev perl-dev lua-dev php-dev php-cli python-dev ruby-dev tcl-dev" makedepends="$depends_dev" install="" subpackages="$pkgname-perl $pkgname-lua $pkgname-php $pkgname-doc $pkgname-python $pkgname-ruby $pkgname-tcl" source="http://www.oligarchy.co.uk/xapian/$pkgver/$pkgname-$pkgver.tar.xz" _builddir="$srcdir"/$pkgname-$pkgver prepare() { local i cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done aclocal && autoconf || return 1 libtoolize || return 1 autoreconf -fvi || return 1 } build() { cd "$_builddir" export LUA=/usr/bin/lua export LUA_INC=/usr/include export LUA_LIB=/usr/lib/lua/5.1 export PERL=/usr/bin/perl export PERL_LIB=/usr/lib/perl5/site_perl export PERL_ARCH=/usr/lib/perl5/site_perl export PHP=/usr/bin/php export PYTHON=/usr/bin/python export PYTHON_LIB=/usr/lib/python2.7/site-packages export RUBY=/usr/bin/ruby export RUBY_LIB=/usr/lib/site_ruby export RUBY_LIB_ARCH=/usr/lib/site_ruby export TCL=/usr/bin/tcl export TCL_LIB=/usr/lib/xapian-bindings$pkgver ./configure \ --prefix=/usr \ --with-perl \ --with-lua \ --with-php \ --with-python \ --with-ruby \ --with-tcl \ XAPIAN_CONFIG=/usr/bin/xapian-config make || return 1 } package() { cd "$_builddir" make DESTDIR=$pkgdir install || return 1 } php() { arch="all" pkgdesc="PHP bindings for the Xapian search engine library" install -d "$subpkgdir"/usr/share/php5 install -d "$subpkgdir"/usr/lib/php/modules echo ';extension=xapian.so' >xapian.ini install -Dm644 xapian.ini "$subpkgdir/etc/php/conf.d/xapian.ini" mv "$pkgdir"/usr/lib/php/modules/* "$subpkgdir"/usr/lib/php/modules/ mv "$pkgdir"/usr/share/php5 "$subpkgdir"/usr/share/ } perl() { arch="all" pkgdesc="Perl bindings for the Xapian search engine library" install -d "$subpkgdir"/usr/lib/perl5 mv "$pkgdir"/usr/lib/perl5 "$subpkgdir"/usr/lib/ #mv "$pkgdir"/usr/share/perl5 "$subpkgdir"/usr/share/ } lua() { arch="all" pkgdesc="Lua bindings for the Xapian search engine library" install -d "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/lua "$subpkgdir"/usr/lib } python() { arch="all" pkgdesc="Python bindings for the Xapian search engine library" install -d "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/python2.7 "$subpkgdir"/usr/lib } ruby() { arch="all" pkgdesc="Ruby bindings for the Xapian search engine library" install -d "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/site_ruby "$subpkgdir"/usr/lib } tcl() { arch="all" pkgdesc="Tcl bindings for the Xapian search engine library" install -d "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/$pkgname$pkgver "$subpkgdir"/usr/lib } md5sums="9a31d998196e51551d38f386cf1544e1 xapian-bindings-1.2.17.tar.xz" sha256sums="54ad5d818fa7d6558acbf517a04c78db9fb4c90103eda0a0f9fe9a864683f80a xapian-bindings-1.2.17.tar.xz" sha512sums="4c8348ece62b57c4442e8cb16282b7da2a8ebecaf99eefbb263795c1451f1395c2073ea311df0159e74a4d52029682034926526b17554627cf8e286f328f36a7 xapian-bindings-1.2.17.tar.xz"