pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/uucp * Use subst framework instead of custom code ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9b2eb8c18369
branches:  trunk
changeset: 530200:9b2eb8c18369
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Mon Jun 18 14:45:28 2007 +0000

description:
* 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.

diffstat:

 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          |  31 ++++++++++++++------
 7 files changed, 97 insertions(+), 30 deletions(-)

diffs (217 lines):

diff -r a18f3abbd0fb -r 9b2eb8c18369 net/uucp/MESSAGE
--- a/net/uucp/MESSAGE  Mon Jun 18 09:35:59 2007 +0000
+++ b/net/uucp/MESSAGE  Mon Jun 18 14:45:28 2007 +0000
@@ -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 -r a18f3abbd0fb -r 9b2eb8c18369 net/uucp/Makefile
--- a/net/uucp/Makefile Mon Jun 18 09:35:59 2007 +0000
+++ b/net/uucp/Makefile Mon Jun 18 14:45:28 2007 +0000
@@ -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 @@
 
 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 @@
 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_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 @@
        @${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 -r a18f3abbd0fb -r 9b2eb8c18369 net/uucp/PLIST
--- a/net/uucp/PLIST    Mon Jun 18 09:35:59 2007 +0000
+++ b/net/uucp/PLIST    Mon Jun 18 14:45:28 2007 +0000
@@ -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/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/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 -r a18f3abbd0fb -r 9b2eb8c18369 net/uucp/files/etc/mountcritlocal
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/uucp/files/etc/mountcritlocal Mon Jun 18 14:45:28 2007 +0000
@@ -0,0 +1,1 @@
+rm -f /var/spool/lock/LCK.* /var/spool/uucp/STST/*
diff -r a18f3abbd0fb -r 9b2eb8c18369 net/uucp/files/etc/rc.d/mountcritlocal
--- a/net/uucp/files/etc/rc.d/mountcritlocal    Mon Jun 18 09:35:59 2007 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-rm -f /var/spool/lock/LCK.* /var/spool/uucp/STST/*
diff -r a18f3abbd0fb -r 9b2eb8c18369 net/uucp/files/rmail/Makefile
--- a/net/uucp/files/rmail/Makefile     Mon Jun 18 09:35:59 2007 +0000
+++ b/net/uucp/files/rmail/Makefile     Mon Jun 18 14:45:28 2007 +0000
@@ -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@
+
+SRCS=  rmail.c
+OBJS=  rmail.o
+
+all: ${PROG}
 
-.include <bsd.prog.mk>
+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 -r a18f3abbd0fb -r 9b2eb8c18369 net/uucp/files/uucpd/Makefile
--- a/net/uucp/files/uucpd/Makefile     Mon Jun 18 09:35:59 2007 +0000
+++ b/net/uucp/files/uucpd/Makefile     Mon Jun 18 14:45:28 2007 +0000
@@ -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
+# $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
 
-PROG=  uucpd
-MAN=   uucpd.8
-BINDIR=        @PREFIX@/libexec
-MANDIR=        @PREFIX@/man
-LDADD+= -lcrypt -lutil
-DPADD+=        ${LIBCRYPT} ${LIBUTIL}
-CPPFLAGS+=-DSUPPORT_UTMP -DSUPPORT_UTMPX
+all: ${PROG}
+
+install: all
+       @INSTALL_PROGRAM@ ${PROG} ${BINDIR}/${PROG}
+       @INSTALL_MAN@ ${MAN} ${MANDIR}/man8
 
-.include <bsd.prog.mk>
+.c.o:
+       ${CC} ${CPPFLAGS} ${CFLAGS} -c $<
+
+${PROG}: ${OBJS}
+       ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}



Home | Main Index | Thread Index | Old Index