summaryrefslogtreecommitdiff
path: root/news/nntpcache
diff options
context:
space:
mode:
authorobache <obache>2008-06-15 13:08:52 +0000
committerobache <obache>2008-06-15 13:08:52 +0000
commit50f26611485ac811d9238bd6790de3f32d47d582 (patch)
tree17d16f9bb2f66d3fcf75429d442ca8b988831a0b /news/nntpcache
parentbeb53db1b180d50da78179d8f4a6de13ae3208ab (diff)
downloadpkgsrc-50f26611485ac811d9238bd6790de3f32d47d582.tar.gz
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 (limited to 'news/nntpcache')
-rw-r--r--news/nntpcache/Makefile71
-rw-r--r--news/nntpcache/PLIST69
-rw-r--r--news/nntpcache/files/nntpcached.rc7
-rw-r--r--news/nntpcache/files/nntpcached.sh16
-rw-r--r--news/nntpcache/options.mk3
5 files changed, 108 insertions, 58 deletions
diff --git a/news/nntpcache/Makefile b/news/nntpcache/Makefile
index 772df887388..9a7cc5e140f 100644
--- a/news/nntpcache/Makefile
+++ b/news/nntpcache/Makefile
@@ -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 @@ MAINTAINER= pkgsrc-users@NetBSD.org
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
+
+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
-post-configure:
- @${SED} -e "s:%%PREFIX%%:${PREFIX}:g" \
- ${FILESDIR}/nntpcached.rc > ${WRKSRC}/nntpcached.sh
+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 --git a/news/nntpcache/PLIST b/news/nntpcache/PLIST
index 05e64bbbf7a..647f4784a3a 100644
--- a/news/nntpcache/PLIST
+++ b/news/nntpcache/PLIST
@@ -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
-sbin/innreport.sh
-sbin/newshound
-sbin/newshound.pl
-sbin/nntpcached
-libexec/unixauth
-libexec/nntpcached.debug
+@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
-@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
+sbin/innreport.sh
+sbin/newshound
+sbin/newshound.pl
+sbin/nntpcached
share/doc/nntpcache/ChangeLog
share/doc/nntpcache/FAQ
share/doc/nntpcache/FAQ.html
@@ -47,4 +17,29 @@ share/doc/nntpcache/LICENSING
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 --git a/news/nntpcache/files/nntpcached.rc b/news/nntpcache/files/nntpcached.rc
deleted file mode 100644
index eaa2ef8d23b..00000000000
--- a/news/nntpcache/files/nntpcached.rc
+++ /dev/null
@@ -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 --git a/news/nntpcache/files/nntpcached.sh b/news/nntpcache/files/nntpcached.sh
new file mode 100644
index 00000000000..00c0a2cb158
--- /dev/null
+++ b/news/nntpcache/files/nntpcached.sh
@@ -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 --git a/news/nntpcache/options.mk b/news/nntpcache/options.mk
index 0b4ebca1224..6e3efbf2487 100644
--- a/news/nntpcache/options.mk
+++ b/news/nntpcache/options.mk
@@ -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 @@ PKG_SUPPORTED_OPTIONS= nntpcache-pgp
.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)