aboutsummaryrefslogtreecommitdiffstats
path: root/community/xapian-bindings/APKBUILD
blob: 25b47d0a3b9800d62dc23cce9c8961f48d79f507 (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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=xapian-bindings
pkgver=1.4.11
pkgrel=2
pkgdesc="Binding libraries for xapian"
url="http://www.xapian.org"
arch="all"
license="GPL-2.0-or-later"
# Disabled check for now since ruby smoketest fails
options="!check"
_py_makedepends="python-dev
	py-sphinx-autobuild py2-sphinx
	py2-requests py-setuptools py2-typing
    py-urllib3 py-chardet py-idna
    python3-dev py3-requests py3-certifi"
_php_makedepends="php7-dev"
_perl_makedepends="perl-dev"
_lua_makedepends="lua5.3-dev"
_ruby_makedepends="ruby-dev ruby ruby-rdoc ruby-irb"
_tcl_makedepends="tcl-dev"

makedepends="automake autoconf libtool bash xapian-core-dev sphinx
	$_py_makedepends
	$_php_makedepends
	$_perl_makedepends
	$_lua_makedepends
	$_ruby_makedepends
	$_tcl_makedepends"
subpackages="$pkgname-perl $pkgname-lua $pkgname-doc
	$pkgname-python $pkgname-python3 $pkgname-ruby $pkgname-tcl
	$pkgname-php7"
source="http://www.oligarchy.co.uk/xapian/$pkgver/$pkgname-$pkgver.tar.xz"

builddir="$srcdir"/$pkgname-$pkgver

prepare() {
	default_prepare
	cd "$builddir"
	aclocal && autoconf
	libtoolize
	autoreconf -fvi
	# workaround for non-existing-dir while build docs for python
	mkdir -p python/docs/_static
	mkdir -p python3/docs/_static
}

build() {
	cd "$builddir"
	export LUA=/usr/bin/lua5.3
	export LUA_INC=/usr/include/lua5.3
	export LUA_LIB=/usr/lib/lua/5.3
	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 PHP7=/usr/bin/php7
	export PHP_CONFIG7=/usr/bin/php-config7
	export PYTHON2=/usr/bin/python2
	export PYTHON3=/usr/bin/python3
	export RUBY=/usr/bin/ruby
	export RUBY_LIB=/usr/lib/ruby
	export RUBY_LIB_ARCH=/usr/lib/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-php7 \
		--with-python \
		--with-python3 \
		--with-ruby \
		--with-tcl \
		XAPIAN_CONFIG=/usr/bin/xapian-config
	make
}

package() {
	cd "$builddir"
	make DESTDIR=$pkgdir install
}

php7() {
	pkgdesc="PHP7 bindings for the Xapian search engine library"

	install -d "$subpkgdir"/usr/share/php7 \
		"$subpkgdir"/usr/lib/php7/modules \
		"$subpkgdir"/etc/php7/conf.d
	echo ';extension=xapian.so' > "$subpkgdir/etc/php7/conf.d/xapian.ini"

	if [ -d "$pkgdir"/usr/lib/php7/modules ]; then
		mv "$pkgdir"/usr/lib/php7/modules/* "$subpkgdir"/usr/lib/php7/modules/
	else
		mv "$pkgdir"/usr/lib/php7/* "$subpkgdir"/usr/lib/php7/
	fi
}

perl() {
	pkgdesc="Perl bindings for the Xapian search engine library"

	install -d "$subpkgdir"/usr/share/perl5
	mv "$pkgdir"/usr/share/perl5 "$subpkgdir"/usr/share/
}

lua() {
	pkgdesc="Lua 5.3 bindings for the Xapian search engine library"

	install -d "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/lua "$subpkgdir"/usr/lib
}

python() {
	pkgdesc="Python bindings for the Xapian search engine library"

	install -d "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python2.7 "$subpkgdir"/usr/lib
}

python3() {
	pkgdesc="Python3 bindings for the Xapian search engine library"

	install -d "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python3* "$subpkgdir"/usr/lib
}

ruby() {
	pkgdesc="Ruby bindings for the Xapian search engine library"

	install -d "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/ruby "$subpkgdir"/usr/lib
}

tcl() {
	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
}

sha512sums="326b08b9959143b92e6c10bd9b6b107ce2779e6ef1a3b5570abd07802a5988dd7df4e890d820f7da355f9f9e64df9a3ae08a0664d70d10ba6f876fca3dc44ecd  xapian-bindings-1.4.11.tar.xz"