pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/news/nntpcache Some improvements and fixes:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/acbbc4fb26bf
branches:  trunk
changeset: 543364:acbbc4fb26bf
user:      obache <obache%pkgsrc.org@localhost>
date:      Sun Jun 15 13:08:52 2008 +0000

description:
Some improvements and fixes:
 * Add usual rc script.
 * Include some perl scripts, add perl:run and replace interpreter line.
   Fixes PR 38893.
 * Use VARBASE instead of hard coded /var.
 * Fix user and group mismatch between configure detection and pkgsrc.
   configure try to detect "ntpcache", "news", "daemon", and "adm".
   pkgsrc had used hard coded "news".
   Now using NNTPCACHE_USER and NNTPCACHE_GROUP.
 * Change to use CONF_FILES framework instead of installing to etc directly.
 * Use *_PERMS instead of some PLIST trick.

Bump PKGREVISION.

diffstat:

 news/nntpcache/Makefile            |  71 +++++++++++++++++++++++++++++++------
 news/nntpcache/PLIST               |  69 +++++++++++++++++-------------------
 news/nntpcache/files/nntpcached.rc |   7 ---
 news/nntpcache/files/nntpcached.sh |  16 ++++++++
 news/nntpcache/options.mk          |   3 +-
 5 files changed, 108 insertions(+), 58 deletions(-)

diffs (230 lines):

diff -r 8d0103ae2d3a -r acbbc4fb26bf news/nntpcache/Makefile
--- a/news/nntpcache/Makefile   Sun Jun 15 12:52:45 2008 +0000
+++ b/news/nntpcache/Makefile   Sun Jun 15 13:08:52 2008 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.33 2008/06/12 01:01:47 obache Exp $
+# $NetBSD: Makefile,v 1.34 2008/06/15 13:08:52 obache Exp $
 
 DISTNAME=              nntpcache-3.0.2
+PKGREVISION=           1
 CATEGORIES=            news
 MASTER_SITES=          http://www.xs4all.nl/~suelette/
 
@@ -8,28 +9,72 @@
 HOMEPAGE=              http://iq.org/~proff/nntpcache.org/
 COMMENT=               NNTP multi-server caching daemon
 
-LICENSE=               fee-based-commercial-use
+LICENSE=               nntpcache-license
+
+.include "../../mk/bsd.prefs.mk"
+
+NNTPCACHE_USER?=       news
+NNTPCACHE_GROUP?=      news
+PKG_GROUPS=            ${NNTPCACHE_GROUP}
+PKG_USERS=             ${NNTPCACHE_USER}:${NNTPCACHE_GROUP}
+PKG_GROUPS_VARS+=      NNTPCACHE_GROUP
+PKG_USERS_VARS+=       NNTPCACHE_USER
+
+NNTPCACHE_DIR=         ${VARBASE}/spool/nntpcache
+
+REQD_DIRS_PERMS+=      ${NNTPCACHE_DIR} ${NNTPCACHE_USER} ${NNTPCACHE_GROUP} 700
 
 .include "options.mk"
 
 GNU_CONFIGURE=         yes
-CONFIGURE_ARGS+=       --localstatedir=${VARBASE}/spool
+CONFIGURE_ENV+=                cacheDir=${NNTPCACHE_DIR}
+CONFIGURE_ENV+=                configDir=${PKG_SYSCONFDIR}
 CONFIGURE_ENV+=                INSTALL_SCRIPT=${INSTALL_SCRIPT:Q}
-USE_TOOLS+=            gmake
+CONFIGURE_ENV+=                nc_cv_UID=${NNTPCACHE_USER}
+CONFIGURE_ENV+=                nc_cv_GID=${NNTPCACHE_GROUP}
+USE_TOOLS+=            gmake perl:run
 BUILD_DEFS+=           VARBASE
 
-INSTALL_TARGET=                SUBDIRS="cf src filters http doc pgp contrib/newshound contrib/perlnewshound innreport scripts unixauth" \
-                       install
-INSTALLATION_DIRS=     libexec share/doc/nntpcache
+PKG_SYSCONFSUBDIR=     nntpcache
+
+INSTALL_MAKE_FLAGS+=   SUBDIRS="cf src filters http doc pgp contrib/newshound contrib/perlnewshound innreport scripts unixauth"
+INSTALL_MAKE_FLAGS+=   sysconfdir=${PREFIX}/share/examples/nntpcache
+INSTALLATION_DIRS=     libexec share/doc/nntpcache share/examples/nntpcache
+
+RCD_SCRIPTS=           nntpcached
 
-post-configure:
-       @${SED} -e "s:%%PREFIX%%:${PREFIX}:g"  \
-               ${FILESDIR}/nntpcached.rc > ${WRKSRC}/nntpcached.sh
+REQD_FILES_PERMS+=     share/examples/nntpcache/VERSION        \
+                       ${NNTPCACHE_DIR}/VERSION                \
+                       ${NNTPCACHE_USER} ${NNTPCACHE_GROUP} 600
+PKG_SYSCONFDIR_PERMS+= ${NNTPCACHE_USER} ${NNTPCACHE_GROUP} 700
+CONF_FILES_PERMS+=     share/examples/nntpcache/nntpcache.access       \
+                       ${PKG_SYSCONFDIR}/nntpcache.access              \
+                       ${NNTPCACHE_USER} ${NNTPCACHE_GROUP} 600
+CONF_FILES_PERMS+=     share/examples/nntpcache/nntpcache.config       \
+                       ${PKG_SYSCONFDIR}/nntpcache.config              \
+                       ${NNTPCACHE_USER} ${NNTPCACHE_GROUP} 600
+CONF_FILES_PERMS+=     share/examples/nntpcache/nntpcache.servers      \
+                       ${PKG_SYSCONFDIR}/nntpcache.servers             \
+                       ${NNTPCACHE_USER} ${NNTPCACHE_GROUP} 600
+CONF_FILES_PERMS+=     share/examples/nntpcache/pubring.asc            \
+                       ${PKG_SYSCONFDIR}/pubring.asc                   \
+                       ${NNTPCACHE_USER} ${NNTPCACHE_GROUP} 600
+CONF_FILES_PERMS+=     share/examples/nntpcache/pubring.asc            \
+                       ${PKG_SYSCONFDIR}/pubring.asc                   \
+                       ${NNTPCACHE_USER} ${NNTPCACHE_GROUP} 600
+CONF_FILES_PERMS+=     share/examples/nntpcache/pubring.pgp            \
+                       ${PKG_SYSCONFDIR}/pubring.pgp                   \
+                       ${NNTPCACHE_USER} ${NNTPCACHE_GROUP} 600
+CONF_FILES_PERMS+=     share/examples/nntpcache/spam.filter            \
+                       ${PKG_SYSCONFDIR}/spam.filter                   \
+                       ${NNTPCACHE_USER} ${NNTPCACHE_GROUP} 600
+SPECIAL_PERMS+=                libexec/unixauth ${ROOT_USER} ${NNTPCACHE_GROUP} 4554
+
+REPLACE_PERL+= innreport/innreport.pl innreport/innreport.pm
+REPLACE_PERL+= contrib/perlnewshound/newshound.pl
 
 post-install:
-       ${INSTALL_DATA_DIR} ${PREFIX}/etc/rc.d
-       ${INSTALL_SCRIPT} ${WRKSRC}/nntpcached.sh ${PREFIX}/etc/rc.d/nntpcached
        cd ${WRKSRC} && ${INSTALL_DATA} README INSTALL FAQ FAQ.html LICENSING \
-               README.INN README.pam ChangeLog ${PREFIX}/share/doc/nntpcache/
+               README.INN README.pam ChangeLog ${DESTDIR}${PREFIX}/share/doc/nntpcache/
 
 .include "../../mk/bsd.pkg.mk"
diff -r 8d0103ae2d3a -r acbbc4fb26bf news/nntpcache/PLIST
--- a/news/nntpcache/PLIST      Sun Jun 15 12:52:45 2008 +0000
+++ b/news/nntpcache/PLIST      Sun Jun 15 13:08:52 2008 +0000
@@ -1,44 +1,14 @@
-@comment $NetBSD: PLIST,v 1.9 2002/12/09 16:01:36 tron Exp $
-etc/nntpcache/VERSION
-etc/nntpcache/innreport.conf-dist
-etc/nntpcache/innreport.pl
-etc/nntpcache/innreport.pm
-etc/nntpcache/newshound.conf-dist
-etc/nntpcache/nntpcache.access-dist
-etc/nntpcache/nntpcache.access
-etc/nntpcache/nntpcache.config-dist
-etc/nntpcache/nntpcache.config
-etc/nntpcache/nntpcache.servers-dist
-etc/nntpcache/nntpcache.servers
-etc/nntpcache/pubring.asc-dist
-etc/nntpcache/pubring.asc
-etc/nntpcache/pubring.pgp-dist
-etc/nntpcache/pubring.pgp
-etc/nntpcache/spam.filter
-etc/nntpcache/http/index.html
-etc/nntpcache/http/moose.gif
-etc/nntpcache/http/nntpcache.jpg
-@exec ${MKDIR} %D/etc/nntpcache/http/innreport/pics
-@exec ${CHOWN} -R news:news %D/etc/nntpcache
-@exec ${CHMOD} 700 %D/etc/nntpcache
-@unexec ${RMDIR} -p %D/etc/nntpcache/http/innreport/pics 2>/dev/null || ${TRUE}
-etc/rc.d/nntpcached
+@comment $NetBSD: PLIST,v 1.10 2008/06/15 13:08:52 obache Exp $
+libexec/nntpcache-gdb.sh
+libexec/nntpcache.gdb
+libexec/nntpcached.debug
+libexec/unixauth
+man/man8/newshound.8
+man/man8/nntpcached.8
 sbin/innreport.sh
 sbin/newshound
 sbin/newshound.pl
 sbin/nntpcached
-libexec/unixauth
-libexec/nntpcached.debug
-libexec/nntpcache-gdb.sh
-libexec/nntpcache.gdb
-man/man8/newshound.8
-man/man8/nntpcached.8
-@unexec ${RMDIR} %D/etc/nntpcache 2>/dev/null || ${TRUE}
-@exec ${MKDIR} /var/spool/nntpcache
-@exec cp %D/etc/nntpcache/VERSION /var/spool/nntpcache/VERSION
-@exec ${CHOWN} -R news:news /var/spool/nntpcache
-@exec ${CHMOD} 700 /var/spool/nntpcache
-@unexec ${RM} -rf /var/spool/nntpcache
 share/doc/nntpcache/ChangeLog
 share/doc/nntpcache/FAQ
 share/doc/nntpcache/FAQ.html
@@ -47,4 +17,29 @@
 share/doc/nntpcache/README
 share/doc/nntpcache/README.INN
 share/doc/nntpcache/README.pam
+share/examples/nntpcache/VERSION
+share/examples/nntpcache/http/index.html
+share/examples/nntpcache/http/moose.gif
+share/examples/nntpcache/http/nntpcache.jpg
+share/examples/nntpcache/innreport.conf-dist
+share/examples/nntpcache/innreport.pl
+share/examples/nntpcache/innreport.pm
+share/examples/nntpcache/newshound.conf-dist
+share/examples/nntpcache/nntpcache.access
+share/examples/nntpcache/nntpcache.access-dist
+share/examples/nntpcache/nntpcache.config
+share/examples/nntpcache/nntpcache.config-dist
+share/examples/nntpcache/nntpcache.servers
+share/examples/nntpcache/nntpcache.servers-dist
+share/examples/nntpcache/pubring.asc
+share/examples/nntpcache/pubring.asc-dist
+share/examples/nntpcache/pubring.pgp
+share/examples/nntpcache/pubring.pgp-dist
+share/examples/nntpcache/spam.filter
+@exec ${MKDIR} %D/share/examples/nntpcache/http/innreport/pics
+share/examples/rc.d/nntpcached
+@dirrm share/examples/nntpcache/http/innreport/pics
+@dirrm share/examples/nntpcache/http/innreport
+@dirrm share/examples/nntpcache/http
+@dirrm share/examples/nntpcache
 @dirrm share/doc/nntpcache
diff -r 8d0103ae2d3a -r acbbc4fb26bf news/nntpcache/files/nntpcached.rc
--- a/news/nntpcache/files/nntpcached.rc        Sun Jun 15 12:52:45 2008 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: nntpcached.rc,v 1.2 2002/09/23 15:32:56 grant Exp $
-#
-
-PATH=%%PREFIX%%/sbin:/bin:/usr/bin
-[ -x %%PREFIX%%/sbin/nntpcached ] && nntpcached && echo -n ' nntpcached'
diff -r 8d0103ae2d3a -r acbbc4fb26bf news/nntpcache/files/nntpcached.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/news/nntpcache/files/nntpcached.sh        Sun Jun 15 13:08:52 2008 +0000
@@ -0,0 +1,16 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: nntpcached.sh,v 1.1 2008/06/15 13:08:52 obache Exp $
+#
+# PROVIDE: nntpcached
+# REQUIRE: NETWORKING SERVERS
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name="nntpcached"
+rcvar=${name}
+command="@PREFIX@/sbin/${name}"
+
+load_rc_config ${name}
+run_rc_command "$1"
diff -r 8d0103ae2d3a -r acbbc4fb26bf news/nntpcache/options.mk
--- a/news/nntpcache/options.mk Sun Jun 15 12:52:45 2008 +0000
+++ b/news/nntpcache/options.mk Sun Jun 15 13:08:52 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.3 2006/05/31 18:22:25 ghen Exp $
+# $NetBSD: options.mk,v 1.4 2008/06/15 13:08:52 obache Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.nntpcache
 PKG_SUPPORTED_OPTIONS= nntpcache-pgp
@@ -12,6 +12,7 @@
 
 .if !empty(PKG_OPTIONS:Mnntpcache-pgp)
 DEPENDS+=              pgp-2.*:../../security/pgp2
+CONFIGURE_ENV+=                ac_cv_path_PGP=${PREFIX}/bin/pgp
 .endif
 
 .if !empty(PKG_OPTIONS:Mopenldap)



Home | Main Index | Thread Index | Old Index