summaryrefslogtreecommitdiff
path: root/pcr/sphinx
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2015-05-21 19:26:27 -0500
committerOmar Vega Ramos <ovruni@gnu.org.pe>2015-05-21 19:26:27 -0500
commitb9424df3adea55192b1ed3c8647f8b9d7dea1fee (patch)
treefbd91f178c744dcfd1e026c728a93befb24d8627 /pcr/sphinx
parent01dc5112e9e2acb6881d291af4420c0bcfd4689f (diff)
sphinx: add new package to [pcr]
Diffstat (limited to 'pcr/sphinx')
-rw-r--r--pcr/sphinx/PKGBUILD58
-rw-r--r--pcr/sphinx/sphinx.conf.d5
-rw-r--r--pcr/sphinx/sphinx.install11
-rw-r--r--pcr/sphinx/sphinx.rc.d44
-rw-r--r--pcr/sphinx/sphinx.service15
-rw-r--r--pcr/sphinx/sphinx.tmpfiles.conf1
6 files changed, 134 insertions, 0 deletions
diff --git a/pcr/sphinx/PKGBUILD b/pcr/sphinx/PKGBUILD
new file mode 100644
index 000000000..96f149275
--- /dev/null
+++ b/pcr/sphinx/PKGBUILD
@@ -0,0 +1,58 @@
+# Maintainer (Arch): Isaac Aronson <i at linux dotcom>
+# Contributor (Arch): Dan Serban
+# Contributor (Arch): Jim Casteel
+# Contributor (Arch): dryes <joswiseman@gmail>
+# Contributor (Arch): Vishnevsky Roman <aka dot x0x01 at gmail dot com>
+# Contributor (Arch): Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
+# Contributor (Arch): Aldo Culquicondor <alculquicondor@gmail.com>
+# Contributor (Arch): Florijan Hamzic <florijanh@gmail.com>
+# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+pkgname='sphinx'
+pkgver=2.2.9
+pkgrel=1
+pkgdesc='Free open-source SQL full-text search engine.'
+arch=('i686' 'x86_64')
+url='http://www.sphinxsearch.com/'
+license=('GPL')
+depends=('unixodbc' 'expat' 'libmysqlclient' 'postgresql-libs')
+optdepends=('postgresql')
+backup=('etc/conf.d/sphinx')
+install='sphinx.install'
+source=("http://sphinxsearch.com/files/${pkgname}-${pkgver}-release.tar.gz"
+ 'sphinx.conf.d'
+ 'sphinx.rc.d'
+ 'sphinx.service'
+ 'sphinx.tmpfiles.conf')
+
+build() {
+ sed -i '15199,15199 s/x00/x21/' "${srcdir}/${pkgname}-${pkgver}-release/src/searchd.cpp"
+
+ cd "${srcdir}/${pkgname}-${pkgver}-release"
+ ./configure --prefix=/usr --exec-prefix=/usr --localstatedir=/var/lib/sphinx \
+ --sysconfdir=/etc/sphinx --with-pgsql --enable-id64
+
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}-release"
+
+ make DESTDIR="${pkgdir}" install
+
+ for _f in "${pkgdir}/usr/bin/"*; do
+ ln -s "/usr/bin/${_f##*/}" "${pkgdir}/usr/bin/sphinx-${_f##*/}"
+ done
+
+ install -Dm755 "${srcdir}/sphinx.rc.d" "${pkgdir}/etc/rc.d/sphinx"
+ install -Dm644 "${srcdir}/sphinx.conf.d" "${pkgdir}/etc/conf.d/sphinx"
+ install -Dm644 "${srcdir}/sphinx.service" "${pkgdir}/usr/lib/systemd/system/sphinx.service"
+ install -d "${pkgdir}/usr/share/sphinx/lib"
+ install -Dm644 api/sphinxapi.php "${pkgdir}/usr/share/sphinx/lib/sphinxapi.php"
+ install -Dm644 api/sphinxapi.py "${pkgdir}/usr/share/sphinx/lib/sphinxapi.py"
+ install -Dm644 "${srcdir}/sphinx.tmpfiles.conf" "${pkgdir}/usr/lib/tmpfiles.d/sphinx.conf"
+}
+md5sums=('1fcc3d180c0559bdeb93602ef248caf4'
+ '48e3e1857919d26d5104a48caffb531b'
+ 'faaa8310af97ff1dbdaf08612e442020'
+ 'fe06a8aff0520a6f75596ee43d2e5935'
+ '22ec4cd0471a1d52702d57d78614b8d8')
diff --git a/pcr/sphinx/sphinx.conf.d b/pcr/sphinx/sphinx.conf.d
new file mode 100644
index 000000000..c809e56fa
--- /dev/null
+++ b/pcr/sphinx/sphinx.conf.d
@@ -0,0 +1,5 @@
+#
+# Arguments to be passed to the sphinx daemon
+#
+
+SPHINX_ARGS=""
diff --git a/pcr/sphinx/sphinx.install b/pcr/sphinx/sphinx.install
new file mode 100644
index 000000000..bb4d80f4a
--- /dev/null
+++ b/pcr/sphinx/sphinx.install
@@ -0,0 +1,11 @@
+post_install() {
+ groupadd sphinx
+ useradd -d /var/lib/sphinx -g sphinx sphinx
+ chown -R sphinx:sphinx /var/lib/sphinx
+}
+
+## arg 1: the old package version
+post_remove() {
+ userdel sphinx
+ groupdel sphinx
+}
diff --git a/pcr/sphinx/sphinx.rc.d b/pcr/sphinx/sphinx.rc.d
new file mode 100644
index 000000000..053be0fd4
--- /dev/null
+++ b/pcr/sphinx/sphinx.rc.d
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/sphinx
+
+PID=$(pidof -o %PPID /usr/bin/sphinx-searchd)
+case $1 in
+start)
+ stat_busy "Starting Sphinx Daemon"
+
+ if [[ -z $PID ]] && /usr/bin/sphinx-searchd $SPHINX_ARGS; then
+
+ PID=$(pidof -o %PPID /var/lib/sphinx/log/searchd.pid)
+ echo "$PID" > /var/lib/sphinx/log/searchd.pid
+ add_daemon sphinx
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+stop)
+ stat_busy "Stopping Sphinx Daemon"
+ if [[ ! -z $PID ]] && kill "$PID" &>/dev/null; then
+ rm_daemon sphinx
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+restart)
+ $0 stop
+ $0 start
+ ;;
+
+*)
+ echo "Usage: $0 {start|stop|restart}" >&2
+ exit 1
+
+esac
diff --git a/pcr/sphinx/sphinx.service b/pcr/sphinx/sphinx.service
new file mode 100644
index 000000000..cb22f01ce
--- /dev/null
+++ b/pcr/sphinx/sphinx.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Sphinx - SQL Full Text Search Engine
+After=local-fs.target network.target mysqld.service
+
+[Service]
+Type=forking
+Restart=always
+PIDFile=/var/lib/sphinx/log/searchd.pid
+ExecStart=/usr/bin/searchd --config /etc/sphinx/sphinx.conf
+ExecStop=/usr/bin/searchd --config /etc/sphinx/sphinx.conf --stopwait
+#User=sphinx
+#Group=sphinx
+
+[Install]
+WantedBy=multi-user.target
diff --git a/pcr/sphinx/sphinx.tmpfiles.conf b/pcr/sphinx/sphinx.tmpfiles.conf
new file mode 100644
index 000000000..084b47ab7
--- /dev/null
+++ b/pcr/sphinx/sphinx.tmpfiles.conf
@@ -0,0 +1 @@
+d /run/sphinx 0755 sphinx sphinx -