aboutsummaryrefslogtreecommitdiffstats
path: root/main/xapian-bindings/APKBUILD
blob: fc9b6ecc668121a232c7eac17ab0cc9bea9efb49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=xapian-bindings
pkgver=1.2.21
pkgrel=0
pkgdesc="Binding libraries for xapian"
url="http://www.xapian.org"
arch="all"
license="GPL2+"
depends=""
depends_dev="bash xapian-core-dev perl-dev lua5.2-dev
			php-dev php-cli python-dev ruby-dev tcl-dev"
makedepends="$depends_dev automake autoconf libtool"
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/lua5.2
	export LUA_INC=/usr/include/lua5.2
	export LUA_LIB=/usr/lib/lua/5.2
	export LUA_SO=.so
	export PERL=/usr/bin/perl
	export PERL_LIB=/usr/share/perl5/vendor_perl
	export PERL_ARCH=/usr/share/perl5/vendor_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 TCLSH=/usr/bin/tclsh8.6
	export TCL_LIB=/usr/lib/tcl8.6/$pkgname-$pkgver
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--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 \
		"$subpkgdir"/usr/lib/php/modules \
		"$subpkgdir"/etc/php/conf.d || return 1
	echo ';extension=xapian.so' > "$subpkgdir/etc/php/conf.d/xapian.ini" \
		|| return 1
	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/share/perl5
	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/tcl8.6
	mv "$pkgdir"/usr/lib/tcl8.6/$pkgname-$pkgver "$subpkgdir"/usr/lib/tcl8.6
}

md5sums="33c598a26fcf92ab15af6c65475ab8de  xapian-bindings-1.2.21.tar.xz"
sha256sums="28a39247ac875be2dc1386c273167aab5c9949227c1070b65ca8de603c06d546  xapian-bindings-1.2.21.tar.xz"
sha512sums="bebb4c6fce57f9b54b307bf921e760efe8fbd06d404629cfb80717eed9bfb886c82559c2ba2b333a4e24ce14d389c916ca36924f9d4b2f72fae183d4a00e635b  xapian-bindings-1.2.21.tar.xz"