Convert this package to the bsd.pkg.install.mk framework:

- Install configuration files under the examples hierarchy.
- Use CONF_FILES_PERMS to put the configuration files in place.
- Use SUPPORT_FILES_PERMS to put the empty log file in place.
- Use RCD_SCRIPTS to handle the rc.d script.

While here, add ICBD_OWNER to BUILD_DEFS and use ROOT_USER and ROOT_GROUP
where appropiate.

As a result, bump PKGREVISION to 1.
This commit is contained in:
jmmv 2003-07-29 16:25:56 +00:00
parent 662fb82528
commit 840c30e882
5 changed files with 53 additions and 37 deletions

View file

@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.4 2003/07/29 15:55:14 jmmv Exp $
# $NetBSD: Makefile,v 1.5 2003/07/29 16:25:56 jmmv Exp $
#
DISTNAME= i2cbd-2.0_BETA0
PKGREVISION= 1
CATEGORIES= chat
MASTER_SITES= ${MASTER_SITE_LOCAL}
@ -9,29 +10,43 @@ MAINTAINER= hubertf@NetBSD.org
HOMEPAGE= http://www.draga.com/~jwise/i2cb/
COMMENT= Next generation Internet Citizens Band chat server
USE_BUILDLINK2= YES
USE_PKGINSTALL= YES
.include "../../mk/bsd.prefs.mk"
ICBD_OWNER?= root
PLIST_SUBST+= ICBD_OWNER=${ICBD_OWNER} \
CHOWN=${CHOWN} \
TOUCH=${TOUCH}
BUILD_DEFS+= ICBD_OWNER
ICBD_OWNER?= ${ROOT_USER}
PLIST_SUBST+= ICBD_OWNER=${ICBD_OWNER}
PKG_SYSCONFSUBDIR= icbd
EGDIR= ${PREFIX}/share/examples/i2cbd
EGFILES= motd icbd_help icbd.deny news.1
CONF_FILES_PERMS=
.for f in ${EGFILES}
CONF_FILES_PERMS+= ${EGDIR}/$f ${PKG_SYSCONFDIR}/$f \
${ICBD_OWNER} ${ROOT_GROUP} 644
.endfor
.undef f
SUPPORT_FILES_PERMS= ${EGDIR}/empty.log /var/log/icbd.log \
${ICBD_OWNER} ${ROOT_GROUP} 644
post-extract:
-${RM} -f ${WRKSRC}/*/.depend
-${RM} -f ${WRKSRC}/*/.depend
post-build:
${TOUCH} ${WRKDIR}/empty.log
${SED} -e 's,@PREFIX@,${PREFIX},' \
< ${WRKSRC}/etc/icbd.sh > ${WRKDIR}/icbd.sh
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/etc/icbd
${CHOWN} ${ICBD_OWNER} ${PREFIX}/etc/icbd
${CHMOD} 755 ${PREFIX}/etc/icbd
for f in motd icbd_help icbd.deny news.1 ; do \
${INSTALL_DATA} ${WRKSRC}/etc/$$f ${PREFIX}/etc/icbd ; \
done
${CHOWN} -R ${ICBD_OWNER} ${PREFIX}/etc/icbd
${TOUCH} /var/log/icbd.log
${CHOWN} ${ICBD_OWNER} /var/log/icbd.log
${SED} \
-e 's,@PREFIX@,${PREFIX},' \
<${WRKSRC}/etc/icbd.sh >${WRKDIR}/icbd.sh
${INSTALL_SCRIPT} ${WRKDIR}/icbd.sh ${PREFIX}/etc/rc.d/icbd
${INSTALL_DATA_DIR} ${EGDIR}
.for f in ${EGFILES}
${INSTALL_DATA} ${WRKSRC}/etc/$f ${EGDIR}
.endfor
.undef f
${INSTALL_DATA} ${WRKDIR}/empty.log ${EGDIR}
${INSTALL_SCRIPT} ${WRKDIR}/icbd.sh ${PREFIX}/etc/rc.d/icbd
.include "../../mk/bsd.pkg.mk"

View file

@ -1,11 +1,12 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2002/11/14 00:59:31 hubertf Exp $
etc/icbd/icbd.deny
etc/icbd/icbd_help
etc/icbd/motd
etc/icbd/news.1
@comment $NetBSD: PLIST,v 1.2 2003/07/29 16:25:56 jmmv Exp $
etc/rc.d/icbd
man/man8/icbd.8
man/man8/icbdb.8
sbin/icbd
sbin/icbdb
@dirrm etc/icbd
share/examples/i2cbd/empty.log
share/examples/i2cbd/icbd.deny
share/examples/i2cbd/icbd_help
share/examples/i2cbd/motd
share/examples/i2cbd/news.1
@dirrm share/examples/i2cbd

View file

@ -1,7 +1,7 @@
$NetBSD: distinfo,v 1.1.1.1 2002/11/14 00:59:31 hubertf Exp $
$NetBSD: distinfo,v 1.2 2003/07/29 16:25:56 jmmv Exp $
SHA1 (i2cbd-2.0_BETA0.tar.gz) = dd76db90442f3ccd8e3048cbdb313740ddcfb792
Size (i2cbd-2.0_BETA0.tar.gz) = 70622 bytes
SHA1 (patch-aa) = 943ce10c7ce2e070113b3d8a8621d3b1624f6a40
SHA1 (patch-ab) = 25a4f46bf378163b19df8fb0c3c23679b2fa4b18
SHA1 (patch-aa) = 0151f8e68be11e759425d2e9569df3d465c50931
SHA1 (patch-ab) = 8bdf6b8f1b59f16a9e996fe51fd0ceb9a0b35115
SHA1 (patch-ac) = ca8e6b7324a22fb9ecabf2374e34febb55196e28

View file

@ -1,4 +1,4 @@
$NetBSD: patch-aa,v 1.1.1.1 2002/11/14 00:59:31 hubertf Exp $
$NetBSD: patch-aa,v 1.2 2003/07/29 16:25:56 jmmv Exp $
--- config.h.orig Tue Oct 30 20:37:28 2001
+++ config.h
@ -10,10 +10,10 @@ $NetBSD: patch-aa,v 1.1.1.1 2002/11/14 00:59:31 hubertf Exp $
-#define ICBDMOTD "/usr/local/etc/icbd/motd"
-#define ICBDHELP "/usr/local/etc/icbd/icbd_help"
-#define ACCESS_FILE "/usr/local/etc/icbd/icbd.deny"
+#define USERDB PREFIX "/etc/icbd/userdb.db"
+#define ICBDMOTD PREFIX "/etc/icbd/motd"
+#define ICBDHELP PREFIX "/etc/icbd/icbd_help"
+#define ACCESS_FILE PREFIX "/etc/icbd/icbd.deny"
+#define USERDB PKG_SYSCONFDIR "/userdb.db"
+#define ICBDMOTD PKG_SYSCONFDIR "/motd"
+#define ICBDHELP PKG_SYSCONFDIR "/icbd_help"
+#define ACCESS_FILE PKG_SYSCONFDIR "/icbd.deny"
#define ICBDLOG "/var/log/icbd.log"
#define PID_FILE "/var/run/icbd.pid"
#define INIT_BRICKS 5 /* initial number of bricks to be thrown */

View file

@ -1,6 +1,6 @@
$NetBSD: patch-ab,v 1.1.1.1 2002/11/14 00:59:31 hubertf Exp $
$NetBSD: patch-ab,v 1.2 2003/07/29 16:25:56 jmmv Exp $
--- config.mk.orig Tue Oct 30 20:50:40 2001
--- config.mk.orig 2001-10-30 20:50:40.000000000 +0100
+++ config.mk
@@ -3,7 +3,6 @@
# For copying and distribution information, see the file COPYING.
@ -10,12 +10,12 @@ $NetBSD: patch-ab,v 1.1.1.1 2002/11/14 00:59:31 hubertf Exp $
BINDIR = ${PREFIX}/sbin
MANDIR = ${PREFIX}/man
MAN8DIR = ${PREFIX}/man/man8
@@ -19,7 +18,7 @@
@@ -19,7 +18,7 @@ EXTRAWARNS = -Wshadow -Wpointer-arith -W
# affect portability to some platforms. The others here are irrelevant.
BADWARNS = -Wwrite-strings -Wconversion -Waggregate-return -Wredundant-decls
DEBUG = -DDEBUG -DVERBOSE -g
-CFLAGS = ${WARNS} ${EXTRAWARNS} ${DEBUG}
+CFLAGS = ${WARNS} ${EXTRAWARNS} ${DEBUG} -DPREFIX=\"${PREFIX}\"
+CFLAGS = ${WARNS} ${EXTRAWARNS} ${DEBUG} -DPREFIX=\"${PREFIX}\" -DPKG_SYSCONFDIR=\"${PKG_SYSCONFDIR}\"
LDFLAGS =
LIBS = -lutil