head	1.6;
access;
symbols
	pkgsrc-2013Q2:1.6.0.48
	pkgsrc-2013Q2-base:1.6
	pkgsrc-2012Q4:1.6.0.46
	pkgsrc-2012Q4-base:1.6
	pkgsrc-2011Q4:1.6.0.44
	pkgsrc-2011Q4-base:1.6
	pkgsrc-2011Q2:1.6.0.42
	pkgsrc-2011Q2-base:1.6
	pkgsrc-2009Q4:1.6.0.40
	pkgsrc-2009Q4-base:1.6
	pkgsrc-2008Q4:1.6.0.38
	pkgsrc-2008Q4-base:1.6
	pkgsrc-2008Q3:1.6.0.36
	pkgsrc-2008Q3-base:1.6
	cube-native-xorg:1.6.0.34
	cube-native-xorg-base:1.6
	pkgsrc-2008Q2:1.6.0.32
	pkgsrc-2008Q2-base:1.6
	pkgsrc-2008Q1:1.6.0.30
	pkgsrc-2008Q1-base:1.6
	pkgsrc-2007Q4:1.6.0.28
	pkgsrc-2007Q4-base:1.6
	pkgsrc-2007Q3:1.6.0.26
	pkgsrc-2007Q3-base:1.6
	pkgsrc-2007Q2:1.6.0.24
	pkgsrc-2007Q2-base:1.6
	pkgsrc-2007Q1:1.6.0.22
	pkgsrc-2007Q1-base:1.6
	pkgsrc-2006Q4:1.6.0.20
	pkgsrc-2006Q4-base:1.6
	pkgsrc-2006Q3:1.6.0.18
	pkgsrc-2006Q3-base:1.6
	pkgsrc-2006Q2:1.6.0.16
	pkgsrc-2006Q2-base:1.6
	pkgsrc-2006Q1:1.6.0.14
	pkgsrc-2006Q1-base:1.6
	pkgsrc-2005Q4:1.6.0.12
	pkgsrc-2005Q4-base:1.6
	pkgsrc-2005Q3:1.6.0.10
	pkgsrc-2005Q3-base:1.6
	pkgsrc-2005Q2:1.6.0.8
	pkgsrc-2005Q2-base:1.6
	pkgsrc-2005Q1:1.6.0.6
	pkgsrc-2005Q1-base:1.6
	pkgsrc-2004Q4:1.6.0.4
	pkgsrc-2004Q4-base:1.6
	pkgsrc-2004Q3:1.6.0.2
	pkgsrc-2004Q3-base:1.6;
locks; strict;
comment	@# @;


1.6
date	2004.08.22.00.10.51;	author schmonz;	state dead;
branches;
next	1.5;

1.5
date	2004.08.02.20.05.42;	author schmonz;	state Exp;
branches;
next	1.4;

1.4
date	2004.08.02.17.28.10;	author schmonz;	state Exp;
branches;
next	1.3;

1.3
date	2004.08.02.04.53.00;	author schmonz;	state Exp;
branches;
next	1.2;

1.2
date	2004.08.02.03.57.17;	author schmonz;	state Exp;
branches;
next	1.1;

1.1
date	2004.07.21.22.35.59;	author schmonz;	state Exp;
branches;
next	;


desc
@@


1.6
log
@Using bsd.options.mk, add several common build-time options. The
complete list:

        badrcptto bigdns darwin netqmail nullenvsender
        outgoingip qregex realrcptto smtpauth syncdir
        tls

This obviates the need for a separate netqmail package. As a result,
reintegrate Makefile.common into Makefile, and simplify a handful
of definitions. If you used the netqmail package, set PKG_OPTIONS.qmail
to "netqmail bigdns" to build with the same patches as before.

Note that most of these options result in patches being applied,
and that any given combination of patches may not apply cleanly.
If there's a combination you need that doesn't work, or build
options you need that aren't available, let me know.

On Darwin, the "darwin" option is set by default, as it's needed
in order to build. The patch includes <nameser8_compat.h>, which
is present on Panther, but not on older systems. We provide a
buildlink stand-in where needed.

On Linux, the "netqmail" option is set by default, as with recent
glibc it's necessary to #include <errno.h> in order to build.

On other platforms, no options are set by default.

Bump PKGREVISION.
@
text
@# $NetBSD: Makefile.common,v 1.5 2004/08/02 20:05:42 schmonz Exp $
#

QMAIL_VERS=		qmail-1.03
DISTNAME=		netqmail-1.05
MASTER_SITES=		http://qmail.org/

DEPENDS+=		checkpassword-[0-9]*:../../sysutils/checkpassword
DEPENDS+=		daemontools-[0-9]*:../../sysutils/daemontools
DEPENDS+=		qmail-users>=1.0:../../mail/qmail-users
DEPENDS+=		ucspi-tcp-[0-9]*:../../net/ucspi-tcp

CONFLICTS+=		courier-maildirmake-[0-9]*
CONFLICTS+=		mirrordir-[0-9]*
CONFLICTS+=		mutt<=1.4.2.1nb1
CONFLICTS+=		pulsar<=0.1.1

PKG_INSTALLATION_TYPES=	overwrite pkgviews

WRKSRC=			${WRKDIR}/${DISTNAME}/${PKGNAME_NOREV}

.if defined(PKG_PHASE) && ${PKG_PHASE} == "extract"
WRKSRC=			${WRKDIR}/${DISTNAME}
.endif

ALL_TARGET= 		it man
INSTALL_TARGET=		setup check

FILESDIR=		${.CURDIR}/../../mail/qmail/files
MESSAGE_SRC=		${.CURDIR}/../../mail/qmail/MESSAGE
PLIST_SRC=		${.CURDIR}/../../mail/qmail/PLIST
DISTINFO_FILE=		${.CURDIR}/../../mail/netqmail/distinfo

USE_PKGINSTALL=		yes
DEINSTALL_EXTRA_TMPL+=	${.CURDIR}/../../mail/qmail/DEINSTALL
INSTALL_EXTRA_TMPL+=	${.CURDIR}/../../mail/qmail/INSTALL
MAKE_DIRS+=		${PKG_SYSCONFDIR} ${PKG_SYSCONFDIR}/alias ${EGDIR}/boot
MAKE_DIRS+=		${PKG_SYSCONFDIR}/control ${DOCDIR}
MAKE_DIRS+=		${PKG_SYSCONFDIR}/users
OWN_DIRS+=		${QMAILDIR} ${QMAIL_QUEUE_DIR}
PKG_SYSCONFSUBDIR=	qmail

DOCDIR=			${PREFIX}/share/doc/qmail
EGDIR=			${PREFIX}/share/examples/qmail
SHAREDIR=		${PREFIX}/share/qmail
MESSAGE_SUBST+=		DOCDIR=${DOCDIR} EGDIR=${EGDIR} PKGBASE=${PKGBASE}
FILES_SUBST+=		DOCDIR=${DOCDIR} EGDIR=${EGDIR} SHAREDIR=${SHAREDIR}
FILES_SUBST+=		QMAILDIR=${QMAILDIR} QMAIL_QUEUE_DIR=${QMAIL_QUEUE_DIR}
FILES_SUBST+=		QMAIL_QUEUE_EXTRA=${QMAIL_QUEUE_EXTRA}
FILES_SUBST+=		PKGNAME=${PKGNAME}
PLIST_SUBST+=		OSXSUFX=${OSXSUFX}

SETUP_PROGRAMS=		dnsfq dnsip dnsptr hostname install ipmeprint
SETUP_SCRIPTS=		config config-fast

MANDIRS=		man
.for i in cat man
.  for j in 1 5 7 8
MANDIRS+=		man/${i}${j}
.  endfor
.endfor
INSTALLATION_DIRS=	bin ${MANDIRS}
INSTALLATION_DIRS+=	share/doc/qmail share/examples/qmail share/qmail

.include "../../mk/bsd.prefs.mk"

.if ${OPSYS} == "Darwin"
OSXSUFX=		.doc
PATCHFILES=		panther.patch
PATCH_SITES=		http://http.netdevice.com:9080/qmail/patch/
. if defined(PKG_PHASE) && ${PKG_PHASE} == "patch"
PATCH_DIST_STRIP=	-p1
. endif
.else
OSXSUFX=		# empty
.endif

BUILD_DEFS+=		QMAILDIR QMAIL_QUEUE_DIR QMAIL_QUEUE_EXTRA

.if !empty(QMAIL_QUEUE_DIR:M${QMAILDIR}/*)
PKG_FAIL_REASON+=	"QMAIL_QUEUE_DIR must not be under ${QMAILDIR}"
.endif

.if !empty(QMAIL_QUEUE_EXTRA)
QUEUE_EXTRA=		"T${QMAIL_QUEUE_EXTRA}\\0"
QUEUE_EXTRALEN!=	${EXPR} `${ECHO} ${QUEUE_EXTRA} | ${WC} -c` - 2
SUBST_CLASSES+=		logging
SUBST_STAGE.logging=	do-configure
SUBST_FILES.logging=	extra.h
SUBST_SED.logging=	-e 's|0|${QUEUE_EXTRALEN}|g'
SUBST_SED.logging+=	-e 's|""|${QUEUE_EXTRA}|g'
.endif

post-extract:
	@@extract_file=${QMAIL_VERS}.tar.gz; export extract_file;	\
	cd ${WRKSRC}; ${EXTRACT_CMD}; cd ${QMAIL_VERS};			\
	${APPLY_NETQMAIL}

do-configure:
	${ECHO} ${CC} ${CFLAGS} > ${WRKSRC}/conf-cc
	${ECHO} ${CC} ${_STRIPFLAG_CC} > ${WRKSRC}/conf-ld
	${ECHO} ${QMAILDIR} > ${WRKSRC}/conf-qmail

post-build:
	@@${SED} ${FILES_SUBST_SED} ${FILESDIR}/README.pkgsrc            \
		> ${WRKDIR}/README.pkgsrc

post-install:
	# qmail's installer sets strange permissions; set them back
.	if (${PKG_INSTALLATION_TYPE} == "overwrite")
.	  for i in bin boot
	    ${CHGRP} ${BINGRP} ${QMAILDIR}/${i}
.	  endfor
.	  for i in doc
	    ${CHGRP} ${SHAREGRP} ${QMAILDIR}/${i}
.	  endfor
.	  for i in ${MANDIRS}
	    ${CHGRP} ${MANGRP} ${QMAILDIR}/${i}
.	  endfor
.	endif

	${INSTALL_DATA} ${WRKDIR}/README.pkgsrc ${DOCDIR}

	${INSTALL_PROGRAM_DIR} ${SHAREDIR}/setup
	for i in ${SETUP_PROGRAMS}; do					\
		${INSTALL_PROGRAM} ${WRKSRC}/$$i ${SHAREDIR}/setup;	\
	done
	for i in ${SETUP_SCRIPTS}; do					\
		${INSTALL_SCRIPT} ${WRKSRC}/$$i ${SHAREDIR}/setup;	\
	done
@


1.5
log
@Cosmetic only: tab out the first few lines to the same indentation
level as the rest of the file.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.4 2004/08/02 17:28:10 schmonz Exp $
@


1.4
log
@Add a "README.pkgsrc" document and refer to it in MESSAGE. Ride
the PKGREVISION bump from 12 hours ago.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.3 2004/08/02 04:53:00 schmonz Exp $
d4 13
a16 13
QMAIL_VERS=	qmail-1.03
DISTNAME=	netqmail-1.05
MASTER_SITES=	http://qmail.org/

DEPENDS+=	checkpassword-[0-9]*:../../sysutils/checkpassword
DEPENDS+=	daemontools-[0-9]*:../../sysutils/daemontools
DEPENDS+=	qmail-users>=1.0:../../mail/qmail-users
DEPENDS+=	ucspi-tcp-[0-9]*:../../net/ucspi-tcp

CONFLICTS+=	courier-maildirmake-[0-9]*
CONFLICTS+=	mirrordir-[0-9]*
CONFLICTS+=	mutt<=1.4.2.1nb1
CONFLICTS+=	pulsar<=0.1.1
@


1.3
log
@The Mac OS X Panther patch needs a different PATCH_DIST_STRIP from
the netqmail patch.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.2 2004/08/02 03:57:17 schmonz Exp $
d46 3
a48 7
MESSAGE_SUBST+=		EGDIR=${EGDIR}
MESSAGE_SUBST+=		PKGBASE=${PKGBASE}
FILES_SUBST+=		DOCDIR=${DOCDIR}
FILES_SUBST+=		EGDIR=${EGDIR}
FILES_SUBST+=		SHAREDIR=${SHAREDIR}
FILES_SUBST+=		QMAILDIR=${QMAILDIR}
FILES_SUBST+=		QMAIL_QUEUE_DIR=${QMAIL_QUEUE_DIR}
d50 2
a51 1
PLIST_SUBST+=		OSXSUFX+=${OSXSUFX}
d104 4
d122 2
a123 1
	${INSTALL_DATA_DIR} ${SHAREDIR}
@


1.2
log
@Remove add-on scripts and config files from the qmail and netqmail
packages. They now simply compile and install qmail and its
prerequisites. (The add-on scripts and config files will be revivified
as a separate qmail-run package. Thus, QMAIL_AUTOCONFIG is no longer
needed.)

The user is notified at install time that one popular, well-regarded
way to enable qmail is to follow the directions in "Life with
qmail", and that another way is to install the qmail-run package.

These changes, based on discussion with Charles Cazabon, are intended
to make life easier for the helpful people on the qmail mailing
list by clearly marking custom add-ons as such.

Other changes:

Since netqmail is a tarball containing the qmail tarball plus the
netqmail bits, we can use it for both packages and share more logic
between the two packages: MASTER_SITES, DISTINFO_FILE, WRKSRC, and
the post-extract target.

Now that there's one place to put the distinfo, add Eben Pratt's
simple patch to build and install on Mac OS X 10.3 (the patch is
not applied on other OSes).

Bump PKGREVISION of both packages.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.common,v 1.1 2004/07/21 22:35:59 schmonz Exp $
d74 1
d76 1
@


1.1
log
@Short story:

1) Mostly conform to hier(7) and honor PKG_SYSCONFDIR.
2) Follow more closely Dave Sill's "Life with qmail" (LWQ).
3) Add a bunch of features to the rc.d scripts.
4) Remove some (but not all) obstacles to binary packaging.
5) Introduce QMAIL_AUTOCONFIG, QMAIL_QUEUE_DIR, and QMAIL_QUEUE_EXTRA.
6) Enable pkgviews installation.
7) Bump PKGREVISION.


Long story:

1) Mostly conform to hier(7) and honor PKG_SYSCONFDIR.

     Based on a January 1997 post by mrg to the qmail list: prior
     to installation, we create symlinks in ${QMAILDIR} that point
     into ${LOCALBASE} or ${PKG_SYSCONFDIR}, causing installation
     to place files in those locations while allowing the canonical
     /var/qmail paths to continue to work. The notable deviation
     from hier(7) is that even though some binaries ought to go in
     sbin, they've all been lumped into bin for simplicity.

     Pleasant effects:
     * We no longer need to set LOCALBASE (a big no-no), and as a
       result also no longer need to set NO_MTREE, RCD_SCRIPTS_EXAMPLEDIR,
       or EVAL_PREFIX. This will also allow a few qmail-related
       packages to do likewise.
     * The commands and manual pages are in easily accessible paths
       by default.
     * Package installation and deinstallation work much better.

     Side effects:
     * There were a few minor conflicts with mail/courier-maildirmake,
       mail/mutt, and mail/pulsar. The latest versions of each are
       fine, so we add CONFLICTS only for older versions. (Thanks
       to those packages' maintainers!) There's also a conflict
       with security/mirrordir, which has a "bin/forward" command
       and corresponding section 1 man page.

     * Some directories under ${PREFIX} get chown'd to group qmail.
       Rather than modify the qmail installer, the affected
       directories are simply chown'd back afterward during
       post-install if PKG_INSTALLATION_TYPE is "overwrite". (If
       it's "pkgviews", then only the package's depot directory is
       affected, so we leave it alone.)

2) Follow more closely Dave Sill's "Life with qmail" (LWQ).

     Similarities:
     * Installs into /var/qmail from source.
     * Installs ucspi-tcp and daemontools.
     * Uses tcpserver(1).
     * Uses tcp.smtp.cdb for relay access control.
     * Uses control/defaultdelivery.
     * Uses control/concurrencyincoming.
     * Requires that control/rcpthosts exist to prevent open relays.
     * Uses similar chains of commands in run scripts.
     * Provides a script much like qmailctl.

     Differences:
     * This package does the following work for you automatically:
       * Creates user accounts.
       * Fetches, extracts, patches, configures, and compiles the source.
       * Installs binaries.
       * Runs ./config-fast.
       * Creates tcp.smtp{,cdb} and tcp.pop3d{,cdb}.
       * Creates control/concurrencyincoming.
       * Creates control/defaultdelivery (defaulting to "./Mailbox").
       * Creates the three required system aliases.
     * LWQ suggests doing some things this package doesn't do:
       * Applying patches.
       * Copying a script from /var/qmail/boot to /var/qmail/rc.
       * Configuring svscan(8) to run at boot.
       * Creating and populating /service.
       * Using supervise(8) and multilog(8).
       * Using the qmailctl script to control qmail.
       * Using the inst_check script to verify the installation.
       * Storing tcp.smtp{,cdb} in /etc.
       * Renaming the system sendmail(8) and marking it non-executable.
     * Instead, this package:
       * Builds from unmodified source. (See also mail/netqmail.)
       * Uses NetBSD-style rc.d scripts (including one similar to qmailctl).
       * Sends log messages to syslog(3).
       * Stores tcp.smtp{,cdb} and tcp.pop3{,cdb} in ${PKG_SYSCONFDIR}.
       * Provides an example mailer.conf(5).

3) Add a bunch of features to the rc.d scripts.

     Rename the qmail script and rcvar to qmailsend. Add "doqueue"
     (synonyms: alrm, flush) and "queue" commands, add "hup" as a
     synonym for "reload", and determine default delivery instruction
     from control/defaultdelivery (LWQ). Add control/defaultdelivery
     to required_files. Rename qmailsend_flags to
     qmailsend_defaultdelivery, which overrides control/defaultdelivery
     if set.

     In the qmailpop3d and qmailsmtpd scripts, enforce resource
     limits with softlimit(8) (LWQ). Add dependency on sysutils/daemontools
     for this. Rename qmailfoo_flags to qmailfoo_tcpflags. Add
     qmailfoo_tcphost (default: 0, meaning "any address") and
     qmailfoo_tcpport (default: 110 and 25, respectively). Add
     qmailfoo_softlimit (default: 2000000). Add qmailfoo_pretcpserver
     and qmailfoo_prefoo (default: empty), useful for inserting
     commands such as rblsmtpd(1) or relay-ctrl into the chain.
     Log to splogger's default syslog facility ("mail"), and use
     the name of the script as the tag.

     In the qmailpop3d, qmailsend, and qmailsmtpd scripts, add
     qmailfoo_postenv (defaults: empty, PATH=${PREFIX}/bin:$PATH,
     and QMAILQUEUE=${PREFIX}/bin/qmail-queue, respectively), useful
     primarily for setting environment variables for each service.
     Add "pause" and "cont" commands (LWQ). They send -STOP and
     -CONT signals, respectively. Add "stat" as a synonym for
     "status" (LWQ).

     In the qmailpop3d script, add -x to qmailpop3d_tcpflags and
     add "cdb" command. Add qmailpop3d_checkpassword (useful for
     authenticating against alternate user databases) and
     qmailpop3d_maildirname (useful if your maildirs are named
     something other than "Maildir"). Add tcp.pop3.cdb to
     required_files.

     In the qmailsmtpd script, add -x and remove -H from
     qmailsmtpd_tcpflags, limit the number of incoming connections
     to control/concurrencyincoming, and add "cdb" command (LWQ).
     Add control/concurrencyincoming and tcp.smtp.cdb to required_files.

     Add qmailqread script and ${PREFIX}/bin/qmail-qread-client,
     based on Steinar Haug's example on www.qmail.org. If enabled,
     this allows local non-root users to see the queue.

     Add qmail script (structure copied from net/samba/files/samba.sh).
     Its interface is very similar to LWQ's qmailctl: it provides
     the commands "start stop restart rcvar pause cont stat status
     cdb doqueue reload queue alrm flush hup help". These commands
     can be run either directly from the appropriate service-specific
     script(s), or from this qmail script (which will call the
     right script(s) for you).

4) Remove some (but not all) obstacles to binary packaging.

     Each of these is better explained elsewhere. Summary:
     * Installs into the normal ${LOCALBASE}.
     * /var/qmail paths still work.
     * No patches are applied. (See also mail/netqmail.)

5) Introduce QMAIL_AUTOCONFIG, QMAIL_QUEUE_DIR, and QMAIL_QUEUE_EXTRA.

     QMAIL_AUTOCONFIG (default: YES): whether to automatically
     create basic config files.

     QMAIL_QUEUE_DIR (default: ${VARBASE}/spool/qmail): the path
     to the queue.

     QMAIL_QUEUE_EXTRA (default: empty): an additional recipient
     that will be added to every delivery. This is used primarily
     for logging. If this is set to a non-empty value, the necessary
     dot-qmail(5) file is created automatically at install time.

6) Enable pkgviews installation.

7) Bump PKGREVISION.

     Other user-visible changes:

     This package no longer applies patches to qmail. mail/netqmail,
     to be imported shortly, does.

     Restrictions on the redistribution of modified qmail apply
     not only to binaries but also to source. Clarify this in
     RESTRICTED.

     Add "newaliases", "hoststat", and "purgestat" entries to the
     sample mailer.conf. Install it to ${PREFIX}/share/examples/${PKGBASE},
     as other pkgsrc mailers do. ("newaliases" is actually provided
     by the fastforward package, and isn't needed unless you're
     using it.)

     Explain how to enable qmail in MESSAGE (cribbed from the
     postfix package).

Thanks to zuntum, snj, salo, and jlam for ideas, discussion, and review.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.23 2004/04/24 05:29:36 schmonz Exp $
d4 4
d20 6
d32 1
a40 1
RCD_SCRIPTS=		qmail qmailqread qmailpop3d qmailsend qmailsmtpd
a51 1
FILES_SUBST+=		QMAIL_AUTOCONFIG=${QMAIL_AUTOCONFIG}
d54 1
d70 10
a79 2
BUILD_DEFS+=		QMAILDIR QMAIL_AUTOCONFIG
BUILD_DEFS+=		QMAIL_QUEUE_DIR QMAIL_QUEUE_EXTRA
d95 5
a104 6
post-build:
	@@${SED} ${FILES_SUBST_SED} ${FILESDIR}/mailer.conf		\
		> ${WRKDIR}/mailer.conf.qmail
	@@${SED} ${FILES_SUBST_SED} ${FILESDIR}/qmail-qread-client.sh	\
		> ${WRKDIR}/qmail-qread-client

a118 3
	${INSTALL_DATA} ${WRKDIR}/mailer.conf.qmail ${EGDIR}/mailer.conf
	${INSTALL_SCRIPT} ${WRKDIR}/qmail-qread-client ${PREFIX}/bin

@

