1 # $NetBSD: Makefile,v 1.65 2012/05/20 09:04:26 marino Exp $
4 DISTNAME
= ${PKGNAME_NOREV}
8 MASTER_SITES
= http
://qmail.org
/
10 MAINTAINER
= schmonz@NetBSD.org
11 HOMEPAGE
= http
://cr.yp.to
/qmail.html
12 COMMENT
= Secure
, reliable
, efficient
, simple
, and fast MTA
13 LICENSE
= public-domain
15 DEPENDS
+= checkpassword-
[0-9]*:..
/..
/sysutils
/checkpassword
16 DEPENDS
+= daemontools-
[0-9]*:..
/..
/sysutils
/daemontools
17 DEPENDS
+= ucspi-tcp-
[0-9]*:..
/..
/net
/ucspi-tcp
19 CONFLICTS
+= courier-maildirmake-
[0-9]*
20 CONFLICTS
+= courier-mta-
[0-9]*
21 CONFLICTS
+= mirrordir-
[0-9]*
22 CONFLICTS
+= mutt
<=1.4.2.1nb1
23 CONFLICTS
+= netqmail-
[0-9]*
24 CONFLICTS
+= pulsar
<=0.1.1
26 NOT_FOR_UNPRIVILEGED
= yes
28 WRKSRC
= ${WRKDIR}/${DISTNAME}
30 PKG_DESTDIR_SUPPORT
= destdir
31 PKG_INSTALLATION_TYPES
= overwrite pkgviews
34 DJB_CONFIG_CMDS
= ${ECHO} ${DESTDIR
:Q
}${QMAILDIR
:Q
} > conf-destdir
35 DJB_BUILD_TARGETS
= man
38 PKG_SYSCONFSUBDIR
= qmail
39 OWN_DIRS
+= ${PKG_SYSCONFDIR} ${PKG_SYSCONFDIR}/alias
40 OWN_DIRS
+= ${PKG_SYSCONFDIR}/control
${PKG_SYSCONFDIR}/users
41 OWN_DIRS
+= ${QMAILDIR} ${QMAIL_QUEUE_DIR}
43 DOCDIR
= ${PREFIX}/share
/doc
/qmail
44 EGDIR
= ${PREFIX}/share
/examples
/qmail
45 SHAREDIR
= ${PREFIX}/share
/qmail
46 PLIST_SUBST
+= DARWINSUFX
=${DARWINSUFX
:Q
}
47 MESSAGE_SUBST
+= DOCDIR
=${DOCDIR
:Q
} EGDIR
=${EGDIR
:Q
}
48 FILES_SUBST
+= DOCDIR
=${DOCDIR
:Q
} EGDIR
=${EGDIR
:Q
}
49 FILES_SUBST
+= PKGMANDIR
=${PKGMANDIR
:Q
} SHAREDIR
=${SHAREDIR
:Q
}
50 FILES_SUBST
+= QMAILDIR
=${QMAILDIR
:Q
}
51 FILES_SUBST
+= QMAIL_QUEUE_DIR
=${QMAIL_QUEUE_DIR
:Q
}
52 FILES_SUBST
+= QMAIL_QUEUE_EXTRA
=${QMAIL_QUEUE_EXTRA
:Q
}
53 FILES_SUBST
+= VIRUSCAN_SIGS_SRCFILE
=${VIRUSCAN_SIGS_SRCFILE
:Q
}
54 FILES_SUBST
+= PKGNAME
=${PKGNAME
:Q
}
56 SETUP_PROGRAMS
= dnsfq dnsip dnsptr hostname
install ipmeprint
57 SETUP_SCRIPTS
= config config-fast
63 INSTALLATION_DIRS
= bin
${MANDIRS} ${DOCDIR} ${SHAREDIR}
64 INSTALLATION_DIRS
+= ${EGDIR}/alias
${EGDIR}/boot
${EGDIR}/control
65 INSTALLATION_DIRS
+= ${EGDIR}/users
67 .
include "../../mk/bsd.prefs.mk"
69 BUILD_DEFS
+= QMAILDIR QMAIL_QUEUE_DIR QMAIL_QUEUE_EXTRA
71 .if
!empty
(QMAIL_QUEUE_DIR
:M
${QMAILDIR}/*)
72 PKG_FAIL_REASON
+= "QMAIL_QUEUE_DIR must not be under ${QMAILDIR}"
75 .if
!empty
(QMAIL_QUEUE_EXTRA
)
77 QUEUE_EXTRA
= "T${QMAIL_QUEUE_EXTRA}\\0"
78 QUEUE_EXTRALEN_cmd
= ${EXPR} `${ECHO_N} ${QMAIL_QUEUE_EXTRA} | ${WC} -c` + 2
79 SUBST_CLASSES
+= logging
80 SUBST_STAGE.logging
= do-configure
81 SUBST_FILES.logging
= extra.h
82 SUBST_SED.logging
= -e
's|0|${QUEUE_EXTRALEN_cmd:sh}|g'
83 SUBST_SED.logging
+= -e
's|""|${QUEUE_EXTRA}|g'
84 SUBST_MESSAGE.logging
= Setting QUEUE_EXTRA.
87 SUBST_CLASSES
+= caseclash
88 SUBST_STAGE.caseclash
= do-configure
89 SUBST_FILES.caseclash
= hier.c
90 SUBST_SED.caseclash
= -e
's|"INSTALL"|"INSTALL${DARWINSUFX}"|g'
91 SUBST_SED.caseclash
+= -e
's|"SENDMAIL"|"SENDMAIL${DARWINSUFX}"|g'
94 SUBST_STAGE.paths
= do-configure
95 SUBST_FILES.paths
= README.pkgsrc
96 SUBST_SED.paths
= -e
's,@PKGNAME@,${PKGNAME:Q},g'
97 SUBST_SED.paths
+= -e
's,@PKG_INFO@,${PKG_INFO:Q},g'
98 SUBST_SED.paths
+= -e
's,@GREP@,${GREP:Q},g'
100 SUBST_FILES.djbware
+= cdb_seek.c dns.c
102 USERGROUP_PHASE
= configure
103 PKG_GROUPS
= qmail nofiles
104 PKG_USERS
+= alias
:nofiles
105 PKG_USERS
+= qmaill
:nofiles qmaild
:nofiles qmailp
:nofiles
106 PKG_USERS
+= qmailq
:qmail qmailr
:qmail qmails
:qmail
107 .for user in
${PKG_USERS
:C
/\
:.
*//}
108 PKG_HOME.
${user}= ${QMAILDIR}
110 PKG_HOME.alias
= ${QMAILDIR}/alias
112 SPECIAL_PERMS
+= ${PREFIX}/bin
/qmail-queue qmailq qmail
4555
114 .if
${OPSYS} == "Darwin"
121 ${CP} ${FILESDIR}/README.pkgsrc
${WRKSRC}
122 .if
${OPSYS} == "Darwin"
123 . for i in INSTALL SENDMAIL
124 mv
${WRKSRC}/${i} ${WRKSRC}/${i}${DARWINSUFX}
129 . if
${USE_DESTDIR} != "no"
130 ${MKDIR} ${DESTDIR}${QMAILDIR}
131 ${MKDIR} ${DESTDIR}${QMAIL_QUEUE_DIR}
132 # keep in sync with INSTALL:PRE-INSTALL
133 ${LN} -s
${DESTDIR}${EGDIR}/alias
${DESTDIR}${QMAILDIR}/alias
134 ${LN} -s
${DESTDIR}${PREFIX}/bin
${DESTDIR}${QMAILDIR}/bin
135 ${LN} -s
${DESTDIR}${EGDIR}/boot
${DESTDIR}${QMAILDIR}/boot
136 ${LN} -s
${DESTDIR}${EGDIR}/control
${DESTDIR}${QMAILDIR}/control
137 ${LN} -s
${DESTDIR}${DOCDIR} ${DESTDIR}${QMAILDIR}/doc
138 ${LN} -s
${DESTDIR}${PREFIX}/${PKGMANDIR} ${DESTDIR}${QMAILDIR}/man
139 ${LN} -s
${DESTDIR}${QMAIL_QUEUE_DIR} ${DESTDIR}${QMAILDIR}/queue
140 ${LN} -s
${DESTDIR}${EGDIR}/users
${DESTDIR}${QMAILDIR}/users
144 # qmail's installer sets strange permissions, set them back
145 . if
(${PKG_INSTALLATION_TYPE} == "overwrite")
147 ${CHGRP} ${BINGRP} ${DESTDIR}${QMAILDIR}/${i}
150 ${CHGRP} ${SHAREGRP} ${DESTDIR}${QMAILDIR}/${i}
152 . for i in
${MANDIRS}
153 ${CHGRP} ${MANGRP} ${DESTDIR}${QMAILDIR}/${i}
157 ${INSTALL_DATA} ${WRKSRC}/README.pkgsrc
${DESTDIR}${DOCDIR}
159 ${INSTALL_PROGRAM_DIR} ${DESTDIR}${SHAREDIR}/setup
160 for i in
${SETUP_PROGRAMS}; do \
161 ${INSTALL_PROGRAM} ${WRKSRC}/$$i \
162 ${DESTDIR}${SHAREDIR}/setup
; \
164 for i in
${SETUP_SCRIPTS}; do \
165 ${INSTALL_SCRIPT} ${WRKSRC}/$$i \
166 ${DESTDIR}${SHAREDIR}/setup
; \
169 .
include "../../mk/djbware.mk"
170 .
include "../../mk/bsd.pkg.mk"