aboutsummaryrefslogtreecommitdiff
path: root/textproc/sphinxsearch
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2006-11-18 22:54:07 +0000
committerMartin Wilke <miwi@FreeBSD.org>2006-11-18 22:54:07 +0000
commit793b724c23f41355f770505af4fcb5daa0438c9b (patch)
treeef0e94e2e809816279ac1170c791d7954cf8208f /textproc/sphinxsearch
parente63ebea241b4e182a50cbf2e218282877b0ff68d (diff)
downloadports-793b724c23f41355f770505af4fcb5daa0438c9b.tar.gz
ports-793b724c23f41355f770505af4fcb5daa0438c9b.zip
Notes
Diffstat (limited to 'textproc/sphinxsearch')
-rw-r--r--textproc/sphinxsearch/Makefile100
-rw-r--r--textproc/sphinxsearch/distinfo3
-rw-r--r--textproc/sphinxsearch/files/sphinxsearch.sh.in38
-rw-r--r--textproc/sphinxsearch/pkg-descr14
-rw-r--r--textproc/sphinxsearch/pkg-plist16
5 files changed, 171 insertions, 0 deletions
diff --git a/textproc/sphinxsearch/Makefile b/textproc/sphinxsearch/Makefile
new file mode 100644
index 000000000000..1bff34e16b10
--- /dev/null
+++ b/textproc/sphinxsearch/Makefile
@@ -0,0 +1,100 @@
+# New ports collection makefile for: Sphinx full-text search engine
+# Date created: 12 November 2006
+# Whom: Matthew Seaman <m.seaman@infracaninophile.co.uk>
+#
+# $FreeBSD$
+#
+# Note: the Sphinx Storage Engine MySQL plugin is not supported by
+# this port at the moment. Maybe later.
+
+PORTNAME= sphinxsearch
+PORTVERSION= 0.9.7.r1
+CATEGORIES= textproc databases
+MASTER_SITES= http://www.sphinxsearch.com/downloads/
+DISTNAME= sphinx-${PORTVERSION:C@\.r([0-9]+)$@-rc\1@}
+
+MAINTAINER= m.seaman@infracaninophile.co.uk
+COMMENT= Sphinx Full-Text Search Engine
+
+OPTIONS= MYSQL "MySQL support" on \
+ PGSQL "PostgreSQL support" off \
+ OPTIMIZED_CFLAGS "Use compiler optimization (-O3)" off
+
+# Yes, the conflation of CPPFLAGS and CXXFLAGS is deliberate. No,
+# don't ask.
+
+GNU_CONFIGURE= yes
+CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+CONFIGURE_ENV+= CC=${CC} CPPFLAGS="${CXXFLAGS}"
+CFGFILE= ${PREFIX}/etc/sphinx.conf
+USE_RC_SUBR= sphinxsearch.sh
+SUB_LIST+= PORTNAME=${PORTNAME} \
+ CFGFILE=${CFGFILE}
+.if !defined(NOPORTDOCS)
+EXAMPLES= example.sql api/sphinxapi.php api/test.php api/test2.php
+DOCS= doc/sphinx.css doc/sphinx.html doc/sphinx.txt doc/sphinx.xml
+.endif
+
+.include <bsd.port.pre.mk>
+
+# The port will successfully compile with both PGSQL and MYSQL support
+# simultaneously. Not sure how useful that is in practice though.
+
+.if defined(WITH_MYSQL) && !defined(WITHOUT_MYSQL)
+CONFIGURE_ARGS+= --with-mysql
+USE_MYSQL= yes
+.else
+CONFIGURE_ARGS+= --without-mysql
+.endif
+
+.if defined(WITH_PGSQL) && !defined(WITHOUT_PGSQL)
+CONFIGURE_ARGS+= --with-pgsql
+USE_PGSQL= yes
+.else
+CONFIGURE_ARGS+= --without-pgsql
+.endif
+
+.if defined(WITH_OPTIMIZED_CFLAGS)
+CXXFLAGS+= -O3 -fomit-frame-pointer
+.endif
+
+# Fix up the sample configuration file to correspond to FreeBSD norms
+
+post-patch:
+ ${REINPLACE_CMD} \
+ -e 's!@CONFDIR@/log/searchd.pid!/var/run/searchd.pid!' \
+ -e 's!@CONFDIR@/log/query.log!/var/log/sphinx-query.log!' \
+ -e 's!@CONFDIR@/log/searchd.log!/var/log/searchd.log!' \
+ -e 's!@CONFDIR@!/var/db/sphinxsearch!' \
+ ${WRKSRC}/sphinx.conf.in
+
+do-install: install-bin install-docs install-examples
+
+install-bin:
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/indexer ${PREFIX}/bin/indexer
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/search ${PREFIX}/bin/search
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/searchd ${PREFIX}/sbin/searchd
+ ${INSTALL_DATA} ${WRKSRC}/sphinx.conf.dist ${CFGFILE}.sample
+
+install-docs:
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+.for doc in ${DOCS}
+ ${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR}
+.endfor
+.endif
+
+install-examples:
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${EXAMPLESDIR}
+.for example in ${EXAMPLES}
+ ${INSTALL_DATA} ${WRKSRC}/${example} ${EXAMPLESDIR}
+.endfor
+.endif
+
+post-install:
+ @if [ ! -f ${CFGFILE} ]; then \
+ ${CP} -p ${CFGFILE}.sample ${CFGFILE} ; \
+ fi
+
+.include <bsd.port.post.mk>
diff --git a/textproc/sphinxsearch/distinfo b/textproc/sphinxsearch/distinfo
new file mode 100644
index 000000000000..06a549589547
--- /dev/null
+++ b/textproc/sphinxsearch/distinfo
@@ -0,0 +1,3 @@
+MD5 (sphinx-0.9.7-rc1.tar.gz) = 50d6a09cd0e89e2f3e4264825329ccfc
+SHA256 (sphinx-0.9.7-rc1.tar.gz) = d0569afad64d03ae290857b5f724c79e70d2cb7490bd3ba21afb4130756a9e00
+SIZE (sphinx-0.9.7-rc1.tar.gz) = 239486
diff --git a/textproc/sphinxsearch/files/sphinxsearch.sh.in b/textproc/sphinxsearch/files/sphinxsearch.sh.in
new file mode 100644
index 000000000000..fd93cc6b661d
--- /dev/null
+++ b/textproc/sphinxsearch/files/sphinxsearch.sh.in
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: %%PORTNAME%%
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable %%PORTNAME%%:
+#
+# %%PORTNAME%%_enable="YES"
+#
+# Other rc.conf variables:
+#
+# %%PORTNAME%%_conffile="%%CFGFILE%%"
+# -- path to config file
+# %%PORTNAME%%_pidfile="/var/run/searchd.pid"
+# -- location of pidfile: must match setting
+# in ${%%PORTNAME%%_conffile}
+#
+
+. /etc/rc.subr
+
+name=%%PORTNAME%%
+rcvar=`set_rcvar`
+
+%%PORTNAME%%_enable=${%%PORTNAME%%_enable-"NO"}
+%%PORTNAME%%_conffile=${%%PORTNAME%%_conffile-"%%CFGFILE%%"}
+%%PORTNAME%%_pidfile=${%%PORTNAME%%_pidfile-"/var/run/searchd.pid"}
+
+command=%%PREFIX%%/sbin/searchd
+pidfile=${%%PORTNAME%%_pidfile}
+required_files=${%%PORTNAME%%_conffile}
+%%PORTNAME%%_flags="--config ${%%PORTNAME%%_conffile}"
+
+load_rc_config ${name}
+run_rc_command "$1"
diff --git a/textproc/sphinxsearch/pkg-descr b/textproc/sphinxsearch/pkg-descr
new file mode 100644
index 000000000000..59b3fdaa98a7
--- /dev/null
+++ b/textproc/sphinxsearch/pkg-descr
@@ -0,0 +1,14 @@
+Sphinx is a full-text search engine, distributed under GPL version
+2. Commercial license is also available for embedded use.
+
+Generally, it's a standalone search engine, meant to provide fast,
+size-efficient and relevant fulltext search functions to other
+applications. Sphinx was specially designed to integrate well with SQL
+databases and scripting languages. Currently built-in data sources
+support fetching data either via direct connection to MySQL, or from
+an XML pipe.
+
+As for the name, Sphinx is an acronym which is officially decoded as
+SQL Phrase Index.
+
+WWW: http://www.sphinxsearch.com/
diff --git a/textproc/sphinxsearch/pkg-plist b/textproc/sphinxsearch/pkg-plist
new file mode 100644
index 000000000000..72eeabf7f437
--- /dev/null
+++ b/textproc/sphinxsearch/pkg-plist
@@ -0,0 +1,16 @@
+bin/indexer
+bin/search
+sbin/searchd
+@unexec if cmp -s %D/etc/sphinx.conf.sample %D/etc/sphinx.conf; then rm -f %D/etc/sphinx.conf; fi
+etc/sphinx.conf.sample
+@exec if [ ! -f %D/etc/sphinx.conf ] ; then cp -p %D/%F %B/sphinx.conf; fi
+%%PORTDOCS%%%%DOCSDIR%%/sphinx.css
+%%PORTDOCS%%%%DOCSDIR%%/sphinx.html
+%%PORTDOCS%%%%DOCSDIR%%/sphinx.txt
+%%PORTDOCS%%%%DOCSDIR%%/sphinx.xml
+%%PORTDOCS%%%%EXAMPLESDIR%%/example.sql
+%%PORTDOCS%%%%EXAMPLESDIR%%/sphinxapi.php
+%%PORTDOCS%%%%EXAMPLESDIR%%/test.php
+%%PORTDOCS%%%%EXAMPLESDIR%%/test2.php
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
+%%PORTDOCS%%@dirrm %%EXAMPLESDIR%%