aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanger <danger@FreeBSD.org>2010-08-12 06:27:05 +0800
committerdanger <danger@FreeBSD.org>2010-08-12 06:27:05 +0800
commitf7f3f70859e4e87f1b9447de835df6da5aab9f36 (patch)
tree6c9240703551aa4b9c6d053b8fa824ee0cfd7704
parentb081afda7ce0dbd965bb7ebe2ae1deba9de328e6 (diff)
downloadfreebsd-ports-gnome-f7f3f70859e4e87f1b9447de835df6da5aab9f36.tar.gz
freebsd-ports-gnome-f7f3f70859e4e87f1b9447de835df6da5aab9f36.tar.zst
freebsd-ports-gnome-f7f3f70859e4e87f1b9447de835df6da5aab9f36.zip
- update to 1.10 beta
- mostly inspired by textproc/sphinxsearch, thanks to Mattew Submitted by: Mattew Seamn <m.seaman@infracaninophile.co.uk>
-rw-r--r--textproc/sphinxsearch-devel/Makefile139
-rw-r--r--textproc/sphinxsearch-devel/distinfo6
-rw-r--r--textproc/sphinxsearch-devel/files/patch-src_searchd.cpp25
-rw-r--r--textproc/sphinxsearch-devel/files/pkg-install.in123
-rw-r--r--textproc/sphinxsearch-devel/files/sphinxsearch.sh.in12
-rw-r--r--textproc/sphinxsearch-devel/pkg-plist5
6 files changed, 95 insertions, 215 deletions
diff --git a/textproc/sphinxsearch-devel/Makefile b/textproc/sphinxsearch-devel/Makefile
index 8cdbb199fb2e..b076593a91d8 100644
--- a/textproc/sphinxsearch-devel/Makefile
+++ b/textproc/sphinxsearch-devel/Makefile
@@ -1,6 +1,6 @@
# New ports collection makefile for: Sphinx full-text search engine
-# Date created: 18 January 2008
-# Whom: Daniel Gerzo <danger@FreeBSD.org>
+# Date created: 18 January 2008
+# Whom: Daniel Gerzo <danger@FreeBSD.org>
#
# $FreeBSD$
#
@@ -8,30 +8,83 @@
# this port. You need a patched version of mysql server for that.
PORTNAME= sphinxsearch
-PORTVERSION= 0.9.9.r2
+PORTVERSION= 1.10b
PORTEPOCH= 1
CATEGORIES= textproc databases
MASTER_SITES= http://www.sphinxsearch.com/downloads/
PKGNAMESUFFIX?= -devel
-DISTNAME= sphinx-0.9.9-rc2
+DISTNAME= sphinx-1.10-beta
PATCH_DIST_STRIP=-p1
MAINTAINER= danger@FreeBSD.org
COMMENT= Sphinx Full-Text Search Engine
+LICENSE= GPLv2
+
LATEST_LINK= sphinxsearch-devel
CONFLICTS= sphinxsearch-[0-9]*
-OPTIONS= MYSQL "MySQL support" on \
- PGSQL "PostgreSQL support" off \
- OPTIMIZED_CFLAGS "Use compiler optimization (-O3)" off
+# If expat is present on the system and configure finds it, it will
+# unconditionally link the output binary against it. There's no way
+# of turning this off. So for consistency, make sure it's always on.
+LIB_DEPENDS= expat.6:${PORTSDIR}/textproc/expat2
+
+OPTIONS= MYSQL "MySQL support" on \
+ PGSQL "PostgreSQL support" off \
+ ICONV "Iconv support" on \
+ OPTIMIZED_CFLAGS "Use compiler optimization (-O3)" off \
+ ID64 "use 64-bit document and word IDs" off \
+ UNIXODBC "unixODBC support" off
+
+.include <bsd.port.options.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_ICONV) && !defined(WITHOUT_ICONV)
+CONFIGURE_ARGS+= --with-iconv
+USE_ICONV= yes
+.else
+CONFIGURE_ARGS+= --without-iconv
+.endif
+
+.if defined(WITH_OPTIMIZED_CFLAGS)
+CXXFLAGS+= -O3 -fomit-frame-pointer
+.endif
+
+# Changes document and word IDs to a 64bit type, useful if you have
+# more than about 4.2E9 such items to deal with. Means corresponding
+# changes in DB schema. Disabled by default.
+.if defined(WITH_ID64)
+CONFIGURE_ARGS+= --enable-id64
+.endif
+
+.if defined(WITH_UNIXODBC)
+CONFIGURE_ARGS+= --with-unixodbc
+LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
+.else
+CONFIGURE_ARGS+= --without-unixodbc
+.endif
+
+USERS?= _sphinx
+GROUPS?= _sphinx
-SPHINX_USR?= _sphinx
-SPHINX_UID?= 312
-SPHINX_GRP?= _sphinx
-SPHINX_GID?= 312
SPHINX_DIR?= /var/db/${PORTNAME}
SPHINX_RUN?= /var/run/${PORTNAME}
SPHINX_LOG?= /var/log/${PORTNAME}
@@ -43,72 +96,45 @@ GNU_CONFIGURE= yes
CONFIGURE_ENV+= CC=${CC} CPPFLAGS="${CXXFLAGS}"
CFGFILE= ${PREFIX}/etc/sphinx.conf
USE_RC_SUBR= sphinxsearch.sh
-SUB_LIST+= PORTNAME=${PORTNAME} \
- CFGFILE=${CFGFILE} \
- SPHINX_USR=${SPHINX_USR} \
- SPHINX_UID=${SPHINX_UID} \
- SPHINX_GRP=${SPHINX_GRP} \
- SPHINX_GID=${SPHINX_GID} \
+SUB_LIST+= PORTNAME=${PORTNAME} \
+ CFGFILE=${CFGFILE} \
+ SPHINX_USR=${USERS} \
+ SPHINX_GRP=${GROUPS} \
SPHINX_DIR=${SPHINX_DIR} \
SPHINX_RUN=${SPHINX_RUN} \
SPHINX_LOG=${SPHINX_LOG}
-SUB_FILES+= pkg-install pkg-deinstall
-
-.if !defined(NOPORTDOCS)
-DOCS= doc/sphinx.css doc/sphinx.html doc/sphinx.txt doc/sphinx.xml
-.endif
+SUB_FILES+= pkg-deinstall
.if !defined(NOPORTEXAMPLES)
-EXAMPLES= example.sql api/sphinxapi.php api/test.php api/test2.php
+EXAMPLES= example.sql api
+PORTEXAMPLES= *
.endif
-.include <bsd.port.pre.mk>
+.if !defined(NOPORTDOCS)
+DOCS= doc/sphinx.css doc/sphinx.html doc/sphinx.txt doc/sphinx.xml
+.endif
.if ${ARCH} == "sparc64" && ${OSVERSION} < 700000
BROKEN= Does not build on sparc64-6
.endif
-# 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!${SPHINX_RUN}/searchd.pid!" \
+ -e "s!@CONFDIR@/log/searchd.pid!${SPHINX_RUN}/searchd.pid!" \
-e "s!@CONFDIR@/log/query.log!${SPHINX_LOG}/sphinx-query.log!" \
- -e "s!@CONFDIR@/log/searchd.log!${SPHINX_LOG}/searchd.log!" \
- -e "s!@CONFDIR@!${SPHINX_DIR}!" \
+ -e "s!@CONFDIR@/log/searchd.log!${SPHINX_LOG}/searchd.log!" \
+ -e "s!@CONFDIR@!${SPHINX_DIR}!" \
${WRKSRC}/sphinx.conf.in
-pre-install:
- @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-
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/search ${PREFIX}/bin/search
${INSTALL_PROGRAM} ${WRKSRC}/src/searchd ${PREFIX}/sbin/searchd
- ${INSTALL_DATA} ${WRKSRC}/sphinx.conf.dist ${CFGFILE}.sample
+ ${INSTALL_DATA} ${WRKSRC}/sphinx.conf.dist ${CFGFILE}.sample
install-docs:
.if !defined(NOPORTDOCS)
@@ -122,16 +148,13 @@ install-examples:
.if !defined(NOPORTEXAMPLES)
@${MKDIR} ${EXAMPLESDIR}
.for example in ${EXAMPLES}
- ${INSTALL_DATA} ${WRKSRC}/${example} ${EXAMPLESDIR}
+ @cd ${WRKSRC} && ${COPYTREE_SHARE} ${example} ${EXAMPLESDIR}
.endfor
.endif
-post-install: post-install-cfg
- @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-
post-install-cfg:
@if [ ! -f ${CFGFILE} ]; then \
${CP} -p ${CFGFILE}.sample ${CFGFILE} ; \
fi
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/textproc/sphinxsearch-devel/distinfo b/textproc/sphinxsearch-devel/distinfo
index 0478b3eff22c..44bfb1e60e76 100644
--- a/textproc/sphinxsearch-devel/distinfo
+++ b/textproc/sphinxsearch-devel/distinfo
@@ -1,3 +1,3 @@
-MD5 (sphinx-0.9.9-rc2.tar.gz) = 1ca266613bfdb0e6952d9ca1af93f7cc
-SHA256 (sphinx-0.9.9-rc2.tar.gz) = b367291e8556c0fa07ecaf96917759dbff6e7e3487d44f703589bb7765f160e1
-SIZE (sphinx-0.9.9-rc2.tar.gz) = 1205937
+MD5 (sphinx-1.10-beta.tar.gz) = 5b52ce9e93a73c66d37bc3a2402f14fa
+SHA256 (sphinx-1.10-beta.tar.gz) = 51b3e5f3254b4d93d6dce91a44451486e5b0f82a1e44799481158e1f95fc1c60
+SIZE (sphinx-1.10-beta.tar.gz) = 1518778
diff --git a/textproc/sphinxsearch-devel/files/patch-src_searchd.cpp b/textproc/sphinxsearch-devel/files/patch-src_searchd.cpp
deleted file mode 100644
index 9602335ba2d9..000000000000
--- a/textproc/sphinxsearch-devel/files/patch-src_searchd.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-See http://sphinxsearch.com/bugs/view.php?id=326
-
---- src/searchd.cpp.orig 2009-04-07 00:08:27.000000000 +0200
-+++ src/searchd.cpp 2009-05-16 17:15:34.000000000 +0200
-@@ -3878,8 +3878,19 @@
- if ( !g_bCpuStats )
- return 0;
-
-+#if defined(CLOCK_PROCESS_CPUTIME_ID)
-+// CPU time (user+sys), Linux style
-+#define LOC_CLOCK CLOCK_PROCESS_CPUTIME_ID
-+#elif defined(CLOCK_PROF)
-+// CPU time (user+sys), FreeBSD style
-+#define LOC_CLOCK CLOCK_PROF
-+#else
-+// POSIX fallback (wall time)
-+#define LOC_CLOCK CLOCK_REALTIME
-+#endif
-+
- struct timespec tp;
-- if ( clock_gettime ( CLOCK_PROCESS_CPUTIME_ID, &tp ) )
-+ if ( clock_gettime ( LOC_CLOCK, &tp ) )
- return 0;
-
- return tp.tv_sec*1000000 + tp.tv_nsec/1000;
diff --git a/textproc/sphinxsearch-devel/files/pkg-install.in b/textproc/sphinxsearch-devel/files/pkg-install.in
deleted file mode 100644
index 37e03b835600..000000000000
--- a/textproc/sphinxsearch-devel/files/pkg-install.in
+++ /dev/null
@@ -1,123 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-PATH=/usr/sbin:/usr/bin:/bin ; export PATH
-
-sphinx_dir=%%SPHINX_DIR%%
-sphinx_usr=%%SPHINX_USR%%
-sphinx_uid=%%SPHINX_UID%%
-sphinx_grp=%%SPHINX_GRP%%
-sphinx_gid=%%SPHINX_GID%%
-sphinx_run=%%SPHINX_RUN%%
-sphinx_log=%%SPHINX_LOG%%
-sphinx_name=%%PORTNAME%%
-
-sphinx_gcos="Sphinxsearch Owner"
-sphinx_home=/nonexistent
-sphinx_shell=/sbin/nologin
-
-create_group() {
- local user uid group gid gcos home shell
-
- user=$1
- uid=$2
- group=$3
- gid=$4
- gcos=$5
- home=$6
- shell=$7
-
- if pw groupadd -n $group -g $gid ; then
- echo "===> Group $group created"
- else
- cat <<-EOERRORMSG
- *** Failed to create the $group group.
-
- Please add the $user user and $group group
- manually with the commands:
-
- pw groupadd -n $group -g $gid
- pw useradd -n $user -u $uid -g $group -c "$gcos" \\
- -d $home -s $shell -h -
-
- and retry installing this package.
- EOERRORMSG
- exit 1
- fi
-}
-
-
-create_user() {
- local user uid group gid gcos home shell
-
- user=$1
- uid=$2
- group=$3
- gid=$4
- gcos=$5
- home=$6
- shell=$7
-
- if pw useradd -n $user -u $uid -g $group -c "$gcos" -d $home \
- -s $shell -h - ; then
- echo "===> Created $user user"
- else
- cat <<-EOERRORMSG
- *** Failed to create the $user user.
-
- Please add the $user user manually with the command:
-
- pw useradd -n $user -u $uid -g $group -c "$gcos" \\
- -d $home -s $shell -h -
-
- and retry installing this package.
- EOERRORMSG
- exit 1
- fi
-}
-
-
-case $2 in
- PRE-INSTALL)
-
- # Create the sphinx user and group if they do not already exist
-
- if pw user show -n $sphinx_usr >/dev/null 2>&1 ; then
- echo "===> Using pre-existing user $sphinx_usr"
- else
- if ! pw group show -n $sphinx_grp >/dev/null 2>&1 ; then
- create_group $sphinx_usr $sphinx_uid $sphinx_grp $sphinx_gid \
- "$sphinx_gcos" $sphinx_home $sphinx_shell
- fi
- create_user $sphinx_usr $sphinx_uid $sphinx_grp $sphinx_gid \
- "$sphinx_gcos" $sphinx_home $sphinx_shell
- fi
- ;;
- POST-INSTALL)
-
- # Create and set ownership of the Sphinx working directory
- if [ -d $sphinx_dir ]; then
- echo "==> Using pre-existing directory $sphinx_dir"
- else
- echo "==> Creating the Sphinx working directory: $sphinx_dir"
- mkdir -m 755 $sphinx_dir || exit 1
- fi
-
- # Create and set ownership of the Sphinx data directory
- if [ -d $sphinx_dir/data ]; then
- echo "==> Using pre-existing directory $sphinx_dir/data"
- else
- echo "==> Creating the Sphinx data directory: $sphinx_dir/data"
- mkdir -m 755 $sphinx_dir/data || exit 1
- fi
-
- echo "===> Adjusting file ownership in $sphinx_dir"
- chown -R $sphinx_usr:$sphinx_grp $sphinx_dir || exit 1
- ;;
-esac
-
-#
-# That's All Folks!
-#
diff --git a/textproc/sphinxsearch-devel/files/sphinxsearch.sh.in b/textproc/sphinxsearch-devel/files/sphinxsearch.sh.in
index 5fe3887eafa5..3fe9402370ac 100644
--- a/textproc/sphinxsearch-devel/files/sphinxsearch.sh.in
+++ b/textproc/sphinxsearch-devel/files/sphinxsearch.sh.in
@@ -24,6 +24,9 @@
# -- group to run searchd as
# %%PORTNAME%%_logdir="%%SPHINX_LOG%%"
# -- directory searchd writes logs to
+# %%PORTNAME%%_dir="%%SPHINX_DIR%%"
+# -- working directory used by searchd et al:
+# must match setting in ${%%PORTNAME%%_conffile}
#
. /etc/rc.subr
@@ -38,12 +41,14 @@ load_rc_config ${name}
: ${%%PORTNAME%%_user="%%SPHINX_USR%%"}
: ${%%PORTNAME%%_group="%%SPHINX_GRP%%"}
: ${%%PORTNAME%%_logdir="%%SPHINX_LOG%%"}
+: ${%%PORTNAME%%_dir="%%SPHINX_DIR%%"}
command=%%PREFIX%%/sbin/searchd
pidfile=${%%PORTNAME%%_pidfile}
required_files=${%%PORTNAME%%_conffile}
+start_precmd=%%PORTNAME%%_prestart
-%%PORTNAME%%_precmd ()
+%%PORTNAME%%_prestart ()
{
piddir=$(dirname ${%%PORTNAME%%_pidfile})
if [ ! -d ${piddir} ]; then
@@ -55,6 +60,11 @@ required_files=${%%PORTNAME%%_conffile}
chown -R ${%%PORTNAME%%_user}:${%%PORTNAME%%_group} \
${%%PORTNAME%%_logdir}
fi
+ if [ ! -d ${%%PORTNAME%%_dir} ]; then
+ mkdir -m 755 -p ${%%PORTNAME%%_dir} ${%%PORTNAME%%_dir}/data
+ chown -R ${%%PORTNAME%%_user}:${%%PORTNAME%%_group} \
+ ${%%PORTNAME%%_dir}
+ fi
}
case "${%%PORTNAME%%_flags}" in
diff --git a/textproc/sphinxsearch-devel/pkg-plist b/textproc/sphinxsearch-devel/pkg-plist
index 492225a4c72b..6b70ba9ab41b 100644
--- a/textproc/sphinxsearch-devel/pkg-plist
+++ b/textproc/sphinxsearch-devel/pkg-plist
@@ -8,9 +8,4 @@ etc/sphinx.conf.sample
%%PORTDOCS%%%%DOCSDIR%%/sphinx.html
%%PORTDOCS%%%%DOCSDIR%%/sphinx.txt
%%PORTDOCS%%%%DOCSDIR%%/sphinx.xml
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/example.sql
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sphinxapi.php
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/test.php
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/test2.php
%%PORTDOCS%%@dirrm %%DOCSDIR%%
-%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%