diff options
author | Francesco Colista <francesco.colista@gmail.com> | 2012-10-25 13:50:22 +0000 |
---|---|---|
committer | Francesco Colista <francesco.colista@gmail.com> | 2012-10-25 13:50:22 +0000 |
commit | c1f79a98d7d882957b9bd4a0a6ce5f9e2f497cc0 (patch) | |
tree | 383091305f8b7c4a3544065d0b6f5b28058ee03c | |
parent | d485a0b7a7259e67b841e8de251432a2d5c5b6b9 (diff) | |
download | aports-c1f79a98d7d882957b9bd4a0a6ce5f9e2f497cc0.tar.bz2 aports-c1f79a98d7d882957b9bd4a0a6ce5f9e2f497cc0.tar.xz |
testing/sphinx: added api and misc script. searchd run as user
-rw-r--r-- | testing/sphinx/APKBUILD | 54 | ||||
-rw-r--r-- | testing/sphinx/sphinx.confd | 2 | ||||
-rw-r--r-- | testing/sphinx/sphinx.initd | 2 |
3 files changed, 42 insertions, 16 deletions
diff --git a/testing/sphinx/APKBUILD b/testing/sphinx/APKBUILD index 8de899b28..88ce5b672 100644 --- a/testing/sphinx/APKBUILD +++ b/testing/sphinx/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Francesco Colista <francesco.colista@gmail.com> pkgname=sphinx pkgver=2.0.6 -pkgrel=1 +pkgrel=2 pkgdesc="Free open-source SQL full-text search engine" url="http://www.sphinxsearch.com" arch="all" @@ -11,20 +11,13 @@ depends="" depends_dev="postgresql-dev mysql-dev unixodbc-dev expat-dev libiconv snowball-dev" makedepends="$depends_dev" install="" -subpackages="$pkgname-doc" +pkgusers="$pkgname" +pkggroups="$pkgname" +subpackages="$pkgname-doc $pkgname-php $pkgname-python" source="http://sphinxsearch.com/files/$pkgname-$pkgver-release.tar.gz - sphinx.initd" - + sphinx.initd + sphinx.confd" _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" @@ -32,6 +25,8 @@ build() { --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 \ @@ -41,17 +36,46 @@ build() { --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="de6be5ee20b1bfafa2a0cea7155a8331 sphinx-2.0.6-release.tar.gz -38a9a10e6b927c597005d571be737f70 sphinx.initd" +b64a6ef4efc424d94a43d73e5f17d833 sphinx.initd +275efea3b1c4964955637862f60706bb sphinx.confd" diff --git a/testing/sphinx/sphinx.confd b/testing/sphinx/sphinx.confd new file mode 100644 index 000000000..44082f99c --- /dev/null +++ b/testing/sphinx/sphinx.confd @@ -0,0 +1,2 @@ +SPHINX_USER=sphinx +SPHINX_GROUP=sphinx diff --git a/testing/sphinx/sphinx.initd b/testing/sphinx/sphinx.initd index c6799653f..b5e1d3de3 100644 --- a/testing/sphinx/sphinx.initd +++ b/testing/sphinx/sphinx.initd @@ -21,7 +21,7 @@ start() { checkconfig || return $? ebegin "Starting sphinx searchd" - start-stop-daemon --start --exec /usr/bin/searchd + start-stop-daemon --start -u ${SPHINX_USER} -g ${SPHINX_GROUP} --exec /usr/bin/searchd eend $? "Failed to start sphinx searchd" } |