From 052dbc0b86b4940ffd3102a1199239b1be4b98a3 Mon Sep 17 00:00:00 2001 From: jlam Date: Mon, 18 Jun 2007 14:45:28 +0000 Subject: * Use subst framework instead of custom code for replacing rmail and uucpd Makefiles. * Modify rmail and uucpd makefiles to be standalone instead of requiring BSD make. * Fix build on MacOS X where libcrypt and libutil don't exist. * Fix build on MacOS X and older NetBSDs that don't support utmpx. * Install the example UUCP /etc snippets into the examples directory for the benefit of binary package users. * Sort the PLIST. Bump PKGREVISION to 4. --- net/uucp/MESSAGE | 9 ++++-- net/uucp/Makefile | 51 ++++++++++++++++++++++++++++------ net/uucp/PLIST | 14 +++++++--- net/uucp/files/etc/mountcritlocal | 1 + net/uucp/files/etc/rc.d/mountcritlocal | 1 - net/uucp/files/rmail/Makefile | 20 ++++++++++--- net/uucp/files/uucpd/Makefile | 35 +++++++++++++++-------- 7 files changed, 99 insertions(+), 32 deletions(-) create mode 100644 net/uucp/files/etc/mountcritlocal delete mode 100644 net/uucp/files/etc/rc.d/mountcritlocal (limited to 'net') diff --git a/net/uucp/MESSAGE b/net/uucp/MESSAGE index 50dfbc8455b..5e803a05409 100644 --- a/net/uucp/MESSAGE +++ b/net/uucp/MESSAGE @@ -1,7 +1,10 @@ =========================================================================== -$NetBSD: MESSAGE,v 1.1 2007/03/15 20:03:01 christos Exp $ +$NetBSD: MESSAGE,v 1.2 2007/06/18 14:45:28 jlam Exp $ -There are snippets of code in files/etc you might want to add to your -etc files. Sorry some of this could be automated. +There are snippets to make the system UUCP-aware that could be added to +scripts and configuration files in /etc. These snippets are located in +the ${PKGBASE} examples directory: + + ${PREFIX}/share/examples/uucp =========================================================================== diff --git a/net/uucp/Makefile b/net/uucp/Makefile index 7b8cc5ab366..e36c9db411f 100644 --- a/net/uucp/Makefile +++ b/net/uucp/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.7 2007/06/15 18:15:20 jlam Exp $ +# $NetBSD: Makefile,v 1.8 2007/06/18 14:45:28 jlam Exp $ DISTNAME= uucp-1.07 -PKGREVISION= 3 +PKGREVISION= 4 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_GNU:=uucp/} @@ -11,6 +11,8 @@ HOMEPAGE= http://www.airs.com/ian/uucp.html USE_TOOLS+= mkdir:run pwd:run rmdir:run +.include "../../mk/bsd.prefs.mk" + PKG_SYSCONFSUBDIR= uucp GNU_CONFIGURE= yes CONFIGURE_ARGS+= --with-user=${UUCP_USER} @@ -25,6 +27,10 @@ UUCP_USER?= uucp PKG_GROUPS= ${UUCP_GROUP} PKG_USERS= ${UUCP_USER}:${UUCP_GROUP} +PKG_GECOS.${UUCP_USER}= UNIX-to-UNIX Copy +PKG_HOMES.${UUCP_USER}= ${UUCP_PUBDIR} +PKG_SHELL.${UUCP_USER}= ${PREFIX}/libexec/uucp/uucico + INFO_FILES= # PLIST # UUCP installs many set-uid "uucp" binaries. @@ -51,6 +57,35 @@ OWN_DIRS_PERMS= ${UUCP_LOCKDIR} ${UUCP_USER} ${UUCP_GROUP} 0755 OWN_DIRS_PERMS+= ${UUCP_SPOOLDIR} ${UUCP_USER} ${UUCP_GROUP} 0755 OWN_DIRS_PERMS+= ${UUCP_PUBDIR} ${UUCP_USER} ${UUCP_GROUP} 1777 +SUBST_CLASSES+= nbsd +SUBST_STAGE.nbsd= post-configure +SUBST_MESSAGE.nbsd= Fixing Makefiles for rmail and uucpd. +SUBST_FILES.nbsd= rmail/Makefile uucpd/Makefile +SUBST_VARS.nbsd= PREFIX PKGMANDIR UUCPD_CPPFLAGS UUCPD_LIBS \ + INSTALL_PROGRAM INSTALL_MAN + +# The necessary libraries and compiler flags for building uucpd are +# platform-specific. +# +UUCPD_CPPFLAGS.${OPSYS}= # empty +.if exists(/usr/include/utmp.h) +UUCPD_CPPFLAGS.${OPSYS}+= -DSUPPORT_UTMP +.endif +.if exists(/usr/include/utmpx.h) +UUCPD_CPPFLAGS.${OPSYS}+= -DSUPPORT_UTMPX +.endif +UUCPD_CPPFLAGS.Darwin= -DSUPPORT_UTMP +UUCPD_CPPFLAGS.*= # empty +UUCPD_LIBS.Darwin= # empty +UUCPD_LIBS.*= -lcrypt -lutil +OPSYSVARS+= UUCPD_CPPFLAGS UUCPD_LIBS + +INSTALLATION_DIRS= bin libexec ${PKGMANDIR}/man8 share/examples/uucp + +post-extract: + ${CP} -R ${FILESDIR}/rmail ${WRKSRC} + ${CP} -R ${FILESDIR}/uucpd ${WRKSRC} + # Generate a policy_local.h header file that holds the paths used by UUCP. post-configure: @${RM} -f ${WRKSRC}/policy_local.h @@ -60,11 +95,11 @@ post-configure: @${ECHO} "#define ${_var_} \""${UUCP_${_var_}:Q}"\"" \ >> ${WRKSRC}/policy_local.h .endfor -.for _var_ in rmail uucpd - @${MKDIR} ${WRKSRC}/${_var_} - @(cd ${FILESDIR}/${_var_} && for f in [a-zM]*; do \ - ${SED} -e "s,@PREFIX@,${PREFIX}," < $$f > ${WRKSRC}/${_var_}/$$f; \ - done) -.endfor + +post-install: + cd ${FILESDIR}/etc; for f in [a-z]*; do \ + ${TEST} -f $$f || continue; \ + ${INSTALL_DATA} $$f ${PREFIX}/share/examples/uucp; \ + done .include "../../mk/bsd.pkg.mk" diff --git a/net/uucp/PLIST b/net/uucp/PLIST index 041bd1c97ae..54a7dac19a1 100644 --- a/net/uucp/PLIST +++ b/net/uucp/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.3 2007/03/16 20:02:04 christos Exp $ +@comment $NetBSD: PLIST,v 1.4 2007/06/18 14:45:28 jlam Exp $ bin/cu bin/uucp bin/uulog @@ -9,6 +9,7 @@ bin/uuto bin/uux bin/rmail info/uucp.info +libexec/uucpd man/man1/cu.1 man/man1/uucp.1 man/man1/uustat.1 @@ -17,11 +18,16 @@ man/man8/uucico.8 man/man8/uuxqt.8 man/man8/rmail.8 man/man8/uucpd.8 -man/cat8/uucpd.0 -man/cat8/rmail.0 sbin/uuchk sbin/uucico sbin/uuconv sbin/uusched sbin/uuxqt -libexec/uucpd +share/examples/uucp/daily +share/examples/uucp/ftpusers +share/examples/uucp/master.passwd +share/examples/uucp/mountcritlocal +share/examples/uucp/newsyslog.conf +share/examples/uucp/syslog.conf +share/examples/uucp/weekly +@dirrm share/examples/uucp diff --git a/net/uucp/files/etc/mountcritlocal b/net/uucp/files/etc/mountcritlocal new file mode 100644 index 00000000000..c0311605a67 --- /dev/null +++ b/net/uucp/files/etc/mountcritlocal @@ -0,0 +1 @@ +rm -f /var/spool/lock/LCK.* /var/spool/uucp/STST/* diff --git a/net/uucp/files/etc/rc.d/mountcritlocal b/net/uucp/files/etc/rc.d/mountcritlocal deleted file mode 100644 index c0311605a67..00000000000 --- a/net/uucp/files/etc/rc.d/mountcritlocal +++ /dev/null @@ -1 +0,0 @@ -rm -f /var/spool/lock/LCK.* /var/spool/uucp/STST/* diff --git a/net/uucp/files/rmail/Makefile b/net/uucp/files/rmail/Makefile index 8d0d7af31bc..6a2b73d2bdd 100644 --- a/net/uucp/files/rmail/Makefile +++ b/net/uucp/files/rmail/Makefile @@ -1,9 +1,21 @@ -# $NetBSD: Makefile,v 1.2 2007/03/16 17:52:29 christos Exp $ -# @(#)Makefile 8.1 (Berkeley) 5/31/93 +# $NetBSD: Makefile,v 1.3 2007/06/18 14:45:29 jlam Exp $ PROG= rmail MAN= rmail.8 BINDIR= @PREFIX@/bin -MANDIR= @PREFIX@/man +MANDIR= @PREFIX@/@PKGMANDIR@ -.include +SRCS= rmail.c +OBJS= rmail.o + +all: ${PROG} + +install: all + @INSTALL_PROGRAM@ ${PROG} ${BINDIR}/${PROG} + @INSTALL_MAN@ ${MAN} ${MANDIR}/man8 + +.c.o: + ${CC} ${CPPFLAGS} ${CFLAGS} -c $< + +${PROG}: ${OBJS} + ${CC} ${LDFLAGS} -o $@ ${OBJS} diff --git a/net/uucp/files/uucpd/Makefile b/net/uucp/files/uucpd/Makefile index a655c95a17b..f2a34f750e0 100644 --- a/net/uucp/files/uucpd/Makefile +++ b/net/uucp/files/uucpd/Makefile @@ -1,12 +1,23 @@ -# $NetBSD: Makefile,v 1.2 2007/03/16 17:52:30 christos Exp $ -# from: @(#)Makefile 8.1 (Berkeley) 6/4/93 - -PROG= uucpd -MAN= uucpd.8 -BINDIR= @PREFIX@/libexec -MANDIR= @PREFIX@/man -LDADD+= -lcrypt -lutil -DPADD+= ${LIBCRYPT} ${LIBUTIL} -CPPFLAGS+=-DSUPPORT_UTMP -DSUPPORT_UTMPX - -.include +# $NetBSD: Makefile,v 1.3 2007/06/18 14:45:29 jlam Exp $ + +PROG= uucpd +MAN= uucpd.8 +BINDIR= @PREFIX@/libexec +MANDIR= @PREFIX@/@PKGMANDIR@ +CPPFLAGS+= @UUCPD_CPPFLAGS@ +LIBS+= @UUCPD_LIBS@ + +SRCS= uucpd.c +OBJS= uucpd.o + +all: ${PROG} + +install: all + @INSTALL_PROGRAM@ ${PROG} ${BINDIR}/${PROG} + @INSTALL_MAN@ ${MAN} ${MANDIR}/man8 + +.c.o: + ${CC} ${CPPFLAGS} ${CFLAGS} -c $< + +${PROG}: ${OBJS} + ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS} -- cgit v1.2.3