aboutsummaryrefslogtreecommitdiffstats
path: root/testing/sphinx/APKBUILD
blob: d169864ad43da45a4c04f920148ad08c8d00b728 (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
# Contributor: Francesco Colista <francesco.colista@gmail.com>
# Maintainer: Francesco Colista <francesco.colista@gmail.com>
pkgname=sphinx
pkgver=2.2.4
pkgrel=1
pkgdesc="Free open-source SQL full-text search engine"
url="http://www.sphinxsearch.com"
arch="all"
license="GPL2"
depends=""
depends_dev="postgresql-dev mysql-dev unixodbc-dev expat-dev libiconv snowball-dev"
makedepends="$depends_dev"
install=""
pkgusers="$pkgname"
pkggroups="$pkgname"
subpackages="$pkgname-doc $pkgname-php $pkgname-python"
source="http://sphinxsearch.com/files/$pkgname-$pkgver-release.tar.gz
	sphinx.initd
	sphinx.confd
	sphinx-pagesize.patch"

_builddir="$srcdir"/$pkgname-$pkgver-release

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
}

build() {
	cd "$_builddir"
	./configure --prefix=/usr \
		--exec-prefix=/usr \
		--localstatedir=/var/lib/sphinx \
		--sysconfdir=/etc/sphinx \
		--docdir=/usr/share/doc/sphinx \
		--mandir=/usr/share/man \
		--with-pgsql \
		--with-mysql \
		--with-unixodbc \
		--with-libexpat \
		--with-iconv \
		--with-libstemmer \
		--with-syslog \
		--enable-id64
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install
	install -Dm755 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname \
			|| return 1
	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname \
	                || return 1
	chown -R sphinx:sphinx "$pkgdir"/var/lib/sphinx
}


php() {
	pkgdesc="PHP api for sphinx search engine"
	arch="noarch"
	mkdir -p "$subpkgdir"/usr/share/php/$pkgname/api
	for i in $(ls $_builddir/api/*.php); do 
		mv $i "$subpkgdir"/usr/share/php/$pkgname/api ;
	done
}


python() {

	pkgdesc="Python api for sphinx search engine"
	arch="noarch"
	mkdir -p "$subpkgdir"/usr/lib/python2.7/site-packages/$pkgname/
	for i in $(ls $_builddir/api/*.py); do 
		mv $i "$subpkgdir"/usr/lib/python2.7/site-packages/$pkgname/ ;
	done
}

doc() {
	default_doc;
	mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/misc
	cp -r "$_builddir"/misc/* "$subpkgdir"/usr/share/doc/$pkgname/misc

}

md5sums="84ecc700490b2db1b868cce82878f36f  sphinx-2.2.4-release.tar.gz
b64a6ef4efc424d94a43d73e5f17d833  sphinx.initd
275efea3b1c4964955637862f60706bb  sphinx.confd
8360e9ce8df0147dfe5b596f61023272  sphinx-pagesize.patch"
sha256sums="c76a88789ca1d7d86df9869718ad217ae8a72740b9e84f2b98b61fa47feb64ef  sphinx-2.2.4-release.tar.gz
b2398551b4a87001927f0b9d5da45852160f62a2a296a28ca83ecce4a5c6c77b  sphinx.initd
92758356582373cb0691541ad7844ad86bfee8792023fe933aa7c4eec47713ed  sphinx.confd
ccc6e8992a182ba396d52075104469cdac8b61e02799497ed48216683e513858  sphinx-pagesize.patch"
sha512sums="9379e6487543e712e5a1a1b60cdfe1bbf34e0f7e0a71c710cf3e1dc2a45898a38648361e3789c2f602fae0d680b7c1ba3bac610e0f9dc7599d33d40f6fdb2c72  sphinx-2.2.4-release.tar.gz
3123405af4f22f6032c1e163a2c5637486ffcf5d87e2f798671b744aa00bf51ebd9921d619b6dce85b95db0d2c2cfce26d1f95659d320d9254c14abc52ed9fef  sphinx.initd
8dbbb3b75bfbde5c6d2bee801df8c7a82650d3943dd667a4330cae473cbf18390aff5eb8d6aa6e5d69c4c995065d48289047b9166fa756c6015bf71f2b13a8f0  sphinx.confd
9563c5a926e5be30477781038ccf115a809a32bbcbc02c5b82e7985fca76185005968b5f0442772ec598b2ff17ef5c185582e24ae74775e5358abc88192345f2  sphinx-pagesize.patch"