From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Sep 20 15:20:06 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F57A106566B for ; Sun, 20 Sep 2009 15:20:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 570818FC24 for ; Sun, 20 Sep 2009 15:20:06 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n8KFK6wA001015 for ; Sun, 20 Sep 2009 15:20:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n8KFK6MX001014; Sun, 20 Sep 2009 15:20:06 GMT (envelope-from gnats) Resent-Date: Sun, 20 Sep 2009 15:20:06 GMT Resent-Message-Id: <200909201520.n8KFK6MX001014@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Matthew Seaman Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4AA21065697 for ; Sun, 20 Sep 2009 15:18:24 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 478F68FC20 for ; Sun, 20 Sep 2009 15:18:24 +0000 (UTC) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) by smtp.infracaninophile.co.uk (8.14.3/8.14.3) with ESMTP id n8KFIIWr034997 for ; Sun, 20 Sep 2009 16:18:18 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.14.3/8.14.3/Submit) id n8KFIIhb034996; Sun, 20 Sep 2009 16:18:18 +0100 (BST) (envelope-from matthew) Message-Id: <200909201518.n8KFIIhb034996@happy-idiot-talk.infracaninophile.co.uk> Date: Sun, 20 Sep 2009 16:18:18 +0100 (BST) From: Matthew Seaman To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/138987: [maintainer] textproc/sphinxsearch -- use bsd.options.mk, etc X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthew Seaman List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 15:20:06 -0000 >Number: 138987 >Category: ports >Synopsis: [maintainer] textproc/sphinxsearch -- use bsd.options.mk, etc >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: Sun Sep 20 15:20:05 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Matthew Seaman >Release: FreeBSD 7.2-STABLE i386 >Organization: Infracaninophile >Environment: System: FreeBSD happy-idiot-talk.infracaninophile.co.uk 7.2-STABLE FreeBSD 7.2-STABLE #7: Sat Sep 19 23:39:03 BST 2009 root@happy-idiot-talk.infracaninophile.co.uk:/usr/obj/usr/src/sys/HAPPY-IDIOT-TALK i386 >Description: Update the port to use the latest facilities provided by the bsd.port.mk infrastructure: * bsd.options.mk * USERS / GROUPS for automatic creation of users from UIDs and GIDs files. * consolidate all directory creation into ${PREFIX}/etc/rc.d/sphinxsearch -- this eliminates the pkg-install script. * minor changes to placate portlint. Note for committer: Deleted file files/pkg-install.sh.in >How-To-Repeat: >Fix: --- sphinxsearch.diff begins here --- diff -Nur /usr/ports/textproc/sphinxsearch/Makefile sphinxsearch/Makefile --- /usr/ports/textproc/sphinxsearch/Makefile 2008-11-12 06:32:48.000000000 +0000 +++ sphinxsearch/Makefile 2009-09-20 16:13:46.000000000 +0100 @@ -17,8 +17,6 @@ MAINTAINER= m.seaman@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 +.include # 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 +.include 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 < 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 --- sphinxsearch.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: