pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/gofish gofish doesn't actually need any hardcoded ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/78510e68c5e5
branches:  trunk
changeset: 530267:78510e68c5e5
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Jun 20 17:46:03 2007 +0000

description:
gofish doesn't actually need any hardcoded uids or gids, as the gofish
daemon will do a lookup using getpwnam() to derive the correct uid/gid
of the gopher/gofish user.  As such, make the following changes:

(1) Remove GOPHER_{UID,GID}.
(2) Allow GOPHER_{USER,GROUP} to be user-settable.
(3) Correctly substitute for the gopher user, not the uid and gid, in
    the example gofish.conf.
(4) Use the subst framework instead of rolling our own code.

Bump the PKGREVISION to 2.

This should allow this package to be built in the bulk builds.

diffstat:

 net/gofish/Makefile |  48 ++++++++++++++++++++++--------------------------
 1 files changed, 22 insertions(+), 26 deletions(-)

diffs (73 lines):

diff -r e78e28eca54b -r 78510e68c5e5 net/gofish/Makefile
--- a/net/gofish/Makefile       Wed Jun 20 17:20:45 2007 +0000
+++ b/net/gofish/Makefile       Wed Jun 20 17:46:03 2007 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.8 2007/02/22 19:26:53 wiz Exp $
+# $NetBSD: Makefile,v 1.9 2007/06/20 17:46:03 jlam Exp $
 
 DISTNAME=              gofish-1.1
-PKGREVISION=           1
+PKGREVISION=           2
 CATEGORIES=            net
 MASTER_SITES=          ${MASTER_SITE_SOURCEFORGE:=gofish/}
 
@@ -13,39 +13,35 @@
 USE_PKGLOCALEDIR=      yes
 GNU_CONFIGURE=         yes
 
-CONFIGURE_ARGS+=       --sysconfdir=${PKG_SYSCONFDIR:Q} \
-                       --localstatedir=${VARBASE:Q}
+CONFIGURE_ARGS+=       --with-gopheruser=${GOPHER_USER:Q}
+CONFIGURE_ARGS+=       --sysconfdir=${PKG_SYSCONFDIR:Q}
+CONFIGURE_ARGS+=       --localstatedir=${VARBASE:Q}
 
 EGDIR=                 ${PREFIX}/share/examples/gofish
-RUNTIMEDIR=    ${VARBASE}/gopher
-
-GOPHER_USER=   gopher
-GOPHER_GROUP=  gopher
-GOPHER_UID=            30
-GOPHER_GID=            30
+RUNTIMEDIR=            ${VARBASE}/gopher
 
-PKG_GROUPS=    ${GOPHER_GROUP}
-PKG_USERS=     ${GOPHER_USER}:${GOPHER_GROUP}
-PKG_GID.${GOPHER_GROUP}=       ${GOPHER_GID}
-PKG_UID.${GOPHER_USER}=                ${GOPHER_UID}
-
-OWN_DIRS_PERMS=        ${RUNTIMEDIR} ${GOPHER_USER} ${GOPHER_GROUP} 0750
+GOPHER_USER?=          gopher
+GOPHER_GROUP?=         gopher
+PKG_GROUPS=            ${GOPHER_GROUP}
+PKG_USERS=             ${GOPHER_USER}:${GOPHER_GROUP}
+PKG_GROUPS_VARS+=      GOPHER_GROUP
+PKG_USERS_VARS+=       GOPHER_USER
 
 RCD_SCRIPTS=           gopherd
 
-CONF_FILES=    ${EGDIR}/gofish.conf ${PKG_SYSCONFDIR}/gofish.conf \
-               ${EGDIR}/gofish-www.conf ${PKG_SYSCONFDIR}/gofish-www.conf
+OWN_DIRS_PERMS=                ${RUNTIMEDIR} ${GOPHER_USER} ${GOPHER_GROUP} 0750
 
-FILES_SUBST+=  RUNTIMEDIR=${RUNTIMEDIR:Q}
+.for FILE in gofish.conf gofish-www.conf
+CONF_FILES+=           ${EGDIR}/${FILE} ${PKG_SYSCONFDIR}/${FILE}
+.endfor
+
+FILES_SUBST+=          RUNTIMEDIR=${RUNTIMEDIR:Q}
 FILES_SUBST+=          PKG_USERS=${PKG_USERS:Q}
 
-post-configure:
-       ${MV} ${WRKSRC}/gofish.conf ${WRKSRC}/gofish.conf.orig
-       ${SED}  -e "s/;uid = -1/uid = ${GOPHER_UID}/g"  \
-               -e "s/;gid = -1/gid = ${GOPHER_GID}/g"  \
-               ${WRKSRC}/gofish.conf.orig              \
-               > ${WRKSRC}/gofish.conf
-
+SUBST_CLASSES+=                user
+SUBST_MESSAGE.user=    Fixing name of gopher user in files.
+SUBST_FILES.user=      gofish.conf
+SUBST_SED.user=                -e "s/;user = gopher/user = ${GOPHER_USER}/g"   
 
 post-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/gofish



Home | Main Index | Thread Index | Old Index