ports/141117: textproc/sphinxsearch -- upgrade to 0.9.9 and misc. changes

Matthew Seaman m.seaman at infracaninophile.co.uk
Wed Dec 2 19:00:11 UTC 2009


>Number:         141117
>Category:       ports
>Synopsis:       textproc/sphinxsearch -- upgrade to 0.9.9 and misc. changes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 02 19:00:09 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Matthew Seaman
>Release:        FreeBSD 8.0-STABLE i386
>Organization:
Infracaninophile
>Environment:
System: FreeBSD happy-idiot-talk.infracaninophile.co.uk 8.0-STABLE FreeBSD 8.0-STABLE #11: Sat Nov 28 05:03:31 GMT 2009 root at happy-idiot-talk.infracaninophile.co.uk:/usr/obj/usr/src/sys/HAPPY-IDIOT-TALK i386


	
>Description:

This update incorporates the changes from ports/138987 which seems to have
disappeared into limbo.

Routine bugfix update to version 0.9.9.

Added files:

    pkg-message

Important note:

    Now uses the IANA sanctioned port numbers 9306 and 9312.


>How-To-Repeat:
	
>Fix:

	

--- sphinxsearch.diff begins here ---
diff -Nur /usr/ports/textproc/sphinxsearch/Makefile sphinxsearch/Makefile
--- /usr/ports/textproc/sphinxsearch/Makefile	2008-11-09 22:55:46.000000000 +0000
+++ sphinxsearch/Makefile	2009-12-02 17:38:19.000000000 +0000
@@ -9,7 +9,7 @@
 # See http://www.infracaninophile.co.uk/articles/sphinxse.html
 
 PORTNAME=	sphinxsearch
-PORTVERSION=	0.9.8.1
+PORTVERSION=	0.9.9
 CATEGORIES=	textproc databases
 MASTER_SITES=	http://www.sphinxsearch.com/downloads/
 DISTNAME=	sphinx-${PORTVERSION}
@@ -17,8 +17,6 @@
 MAINTAINER=	m.seaman at infracaninophile.co.uk
 COMMENT=	Sphinx Full-Text Search Engine
 
-CONFLICTS=	sphinxsearch-devel-[0-9]*
-
 # 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.
@@ -33,42 +31,9 @@
 ## FFR
 ##		LIBSTEMMER	 "compile with libstemmer support"  off
 
-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}
-
-# Yes, the conflation of CPPFLAGS and CXXFLAGS is deliberate.  No,
-# don't ask.
-
-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} \
-		SPHINX_DIR=${SPHINX_DIR} \
-		SPHINX_RUN=${SPHINX_RUN} \
-		SPHINX_LOG=${SPHINX_LOG}
-SUB_FILES+=	pkg-install pkg-deinstall
-
-.if !defined(NOPORTEXAMPLES)
-EXAMPLES=	example.sql api
-PORTEXAMPLES=	*
-.endif
-
-.if !defined(NOPORTDOCS)
-DOCS=		doc/sphinx.css doc/sphinx.html doc/sphinx.txt doc/sphinx.xml
-.endif
+CONFLICTS=	sphinxsearch-devel-[0-9]*
 
-.include <bsd.port.pre.mk>
+.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.
@@ -122,6 +87,38 @@
 ## CONFIGURE_ARGS+=	--without-libstemmer
 ## .endif
 
+USERS?=		_sphinx
+GROUPS?=	_sphinx
+
+SPHINX_DIR?=	/var/db/${PORTNAME}
+SPHINX_RUN?=	/var/run/${PORTNAME}
+SPHINX_LOG?=	/var/log/${PORTNAME}
+
+# Yes, the conflation of CPPFLAGS and CXXFLAGS is deliberate.  No,
+# don't ask.
+
+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=${USERS}	 \
+		SPHINX_GRP=${GROUPS}	 \
+		SPHINX_DIR=${SPHINX_DIR} \
+		SPHINX_RUN=${SPHINX_RUN} \
+		SPHINX_LOG=${SPHINX_LOG}
+SUB_FILES+=	pkg-deinstall
+
+.if !defined(NOPORTEXAMPLES)
+EXAMPLES=	example.sql api
+PORTEXAMPLES=	*
+.endif
+
+.if !defined(NOPORTDOCS)
+DOCS=		doc/sphinx.css doc/sphinx.html doc/sphinx.txt doc/sphinx.xml
+.endif
+
 # Fix up the sample configuration file to correspond to FreeBSD norms
 
 post-patch:
@@ -132,9 +129,6 @@
 	    -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:
@@ -159,12 +153,9 @@
 .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 -Nur /usr/ports/textproc/sphinxsearch/distinfo sphinxsearch/distinfo
--- /usr/ports/textproc/sphinxsearch/distinfo	2008-11-09 22:55:46.000000000 +0000
+++ sphinxsearch/distinfo	2009-12-02 17:38:42.000000000 +0000
@@ -1,3 +1,3 @@
-MD5 (sphinx-0.9.8.1.tar.gz) = 428a14df41fb425e664d9e2d6178c037
-SHA256 (sphinx-0.9.8.1.tar.gz) = ef69b2b52381173da92bf2df79dfc8c5271c4b3f156c356bb4ef82ca035dc013
-SIZE (sphinx-0.9.8.1.tar.gz) = 949660
+MD5 (sphinx-0.9.9.tar.gz) = 7b9b618cb9b378f949bb1b91ddcc4f54
+SHA256 (sphinx-0.9.9.tar.gz) = bf8f55ffc095ff6b628f0cbc7eb54761811140140679a1c869cc1b17c42803e4
+SIZE (sphinx-0.9.9.tar.gz) = 1218359
diff -Nur /usr/ports/textproc/sphinxsearch/files/pkg-deinstall.in sphinxsearch/files/pkg-deinstall.in
--- /usr/ports/textproc/sphinxsearch/files/pkg-deinstall.in	2007-01-30 23:13:36.000000000 +0000
+++ sphinxsearch/files/pkg-deinstall.in	2009-09-20 15:33:59.000000000 +0100
@@ -6,15 +6,15 @@
 sphinx_usr=%%SPHINX_USR%%
 sphinx_grp=%%SPHINX_GRP%%
 sphinx_dir=%%SPHINX_DIR%%
-sphinx_name=%%PORTNAME%%
+portname=%%PORTNAME%%
 
 case $2 in
     POST-DEINSTALL)
 
     cat <<EOMSG
 
-The $sphinx_name port has been deleted.  If you are not
-upgrading and don't intend to use $sphinx_name any more
+The $portname port has been deleted.  If you are not
+upgrading and don't intend to use $portname any more
 then you may wish to delete the $sphinx_usr account,
 and the $sphinx_grp group together with the working
 directory $sphinx_dir; which can be done with the
diff -Nur /usr/ports/textproc/sphinxsearch/files/pkg-install.in sphinxsearch/files/pkg-install.in
--- /usr/ports/textproc/sphinxsearch/files/pkg-install.in	2007-01-30 23:13:36.000000000 +0000
+++ sphinxsearch/files/pkg-install.in	1970-01-01 01:00:00.000000000 +0100
@@ -1,123 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/textproc/sphinxsearch/files/pkg-install.in,v 1.1 2007/01/30 23:13:36 pav Exp $
-#
-
-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 -Nur /usr/ports/textproc/sphinxsearch/files/sphinxsearch.sh.in sphinxsearch/files/sphinxsearch.sh.in
--- /usr/ports/textproc/sphinxsearch/files/sphinxsearch.sh.in	2008-04-27 09:50:49.000000000 +0100
+++ sphinxsearch/files/sphinxsearch.sh.in	2009-09-20 15:46:54.000000000 +0100
@@ -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,6 +41,7 @@
 : ${%%PORTNAME%%_user="%%SPHINX_USR%%"}
 : ${%%PORTNAME%%_group="%%SPHINX_GRP%%"}
 : ${%%PORTNAME%%_logdir="%%SPHINX_LOG%%"}
+: ${%%PORTNAME%%_dir="%%SPHINX_DIR%%"}
 
 command=%%PREFIX%%/sbin/searchd
 pidfile=${%%PORTNAME%%_pidfile}
@@ -56,6 +60,11 @@
 	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 -Nur /usr/ports/textproc/sphinxsearch/pkg-message sphinxsearch/pkg-message
--- /usr/ports/textproc/sphinxsearch/pkg-message	1970-01-01 01:00:00.000000000 +0100
+++ sphinxsearch/pkg-message	2009-12-02 18:43:13.000000000 +0000
@@ -0,0 +1,17 @@
+
+   Note: for people upgrading from earlier versions to sphinx-0.9.9
+   ================================================================
+
+   Please be aware that sphinx now uses these IANA[1] sanctioned port
+   numbers by default:
+
+    sphinxql        9306/tcp    Sphinx search server (MySQL listener)
+    #                           Andrew Aksyonoff <shodan&sphinxsearch.com> 20 October 2009
+
+    sphinxapi       9312/tcp    Sphinx search server
+    #                           Andrew Aksyonoff <shodan&sphinxsearch.com> 20 October 2009
+
+   This is a change from the port numbers used by default in earlier
+   versions.
+
+       [1] http://www.iana.org/assignments/port-numbers
--- sphinxsearch.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list