| @@ -1,159 +1,164 @@ | | | @@ -1,159 +1,164 @@ |
1 | # $NetBSD: Makefile,v 1.215 2008/02/18 17:45:34 ghen Exp $ | | 1 | # $NetBSD: Makefile,v 1.216 2008/03/14 01:13:36 taca Exp $ |
2 | | | 2 | |
3 | DISTNAME= postfix-2.5.1 | | 3 | DISTNAME= postfix-2.5.1 |
| | | 4 | PKGREVISION= 1 |
4 | CATEGORIES= mail | | 5 | CATEGORIES= mail |
5 | MASTER_SITES= ftp://ftp.porcupine.org/mirrors/postfix-release/official/ | | 6 | MASTER_SITES= ftp://ftp.porcupine.org/mirrors/postfix-release/official/ |
6 | DIST_SUBDIR= postfix | | 7 | DIST_SUBDIR= postfix |
7 | | | 8 | |
8 | MAINTAINER= martti@NetBSD.org | | 9 | MAINTAINER= martti@NetBSD.org |
9 | HOMEPAGE= http://www.postfix.org/ | | 10 | HOMEPAGE= http://www.postfix.org/ |
10 | COMMENT= Postfix SMTP server and tools | | 11 | COMMENT= Postfix SMTP server and tools |
11 | #LICENSE= postfix-license | | 12 | #LICENSE= postfix-license |
12 | | | 13 | |
13 | CONFLICTS+= courier-mta-[0-9]* fastforward>=0.51nb2 sendmail-[0-9]* | | 14 | CONFLICTS+= courier-mta-[0-9]* fastforward>=0.51nb2 sendmail-[0-9]* |
14 | | | 15 | |
15 | PKG_INSTALLATION_TYPES= overwrite pkgviews | | 16 | PKG_INSTALLATION_TYPES= overwrite pkgviews |
16 | | | 17 | |
17 | USE_TOOLS+= perl | | 18 | USE_TOOLS+= perl |
18 | CHECK_HEADERS_SKIP+= src/global/mail_params.h | | 19 | CHECK_HEADERS_SKIP+= src/global/mail_params.h |
19 | | | 20 | |
20 | .include "../../mk/bsd.prefs.mk" | | 21 | .include "../../mk/bsd.prefs.mk" |
21 | | | 22 | |
22 | # POSTFIX_QUEUE_DIR is the default queue directory for Postfix. This is | | 23 | # POSTFIX_QUEUE_DIR is the default queue directory for Postfix. This is |
23 | # merely a default, and may be changed by setting "queue_directory" in | | 24 | # merely a default, and may be changed by setting "queue_directory" in |
24 | # ${PKG_SYSCONFDIR}/main.cf. | | 25 | # ${PKG_SYSCONFDIR}/main.cf. |
25 | # | | 26 | # |
| | | 27 | POSTFIX_DATA_DIR?= ${VARBASE}/db/postfix |
26 | POSTFIX_QUEUE_DIR?= ${VARBASE}/spool/postfix | | 28 | POSTFIX_QUEUE_DIR?= ${VARBASE}/spool/postfix |
27 | BUILD_DEFS+= VARBASE POSTFIX_QUEUE_DIR | | 29 | BUILD_DEFS+= VARBASE POSTFIX_DATA_DIR POSTFIX_QUEUE_DIR |
28 | | | 30 | |
29 | # CCARGS is a list of options to pass to the preprocessor/compiler. | | 31 | # CCARGS is a list of options to pass to the preprocessor/compiler. |
30 | # AUXLIBS is a list of options to pass to the linker. | | 32 | # AUXLIBS is a list of options to pass to the linker. |
31 | # | | 33 | # |
32 | CCARGS= -DUSE_SASL_AUTH | | 34 | CCARGS= -DUSE_SASL_AUTH |
33 | AUXLIBS= ${LDFLAGS} | | 35 | AUXLIBS= ${LDFLAGS} |
34 | FIX_RPATH+= AUXLIBS | | | |
35 | | | 36 | |
36 | # Set some default paths to override ${WRKSRC}/src/global/mail_params.h. | | 37 | # Set some default paths to override ${WRKSRC}/src/global/mail_params.h. |
| | | 38 | CCARGS+= -DDEF_DATA_DIR=\"${POSTFIX_DATA_DIR}\" |
37 | CCARGS+= -DDEF_QUEUE_DIR=\"${POSTFIX_QUEUE_DIR}\" | | 39 | CCARGS+= -DDEF_QUEUE_DIR=\"${POSTFIX_QUEUE_DIR}\" |
38 | CCARGS+= -DDEF_DAEMON_DIR=\"${LIBEXECDIR}\" | | 40 | CCARGS+= -DDEF_DAEMON_DIR=\"${LIBEXECDIR}\" |
39 | CCARGS+= -DDEF_COMMAND_DIR=\"${PREFIX}/sbin\" | | 41 | CCARGS+= -DDEF_COMMAND_DIR=\"${PREFIX}/sbin\" |
40 | CCARGS+= -DDEF_CONFIG_DIR=\"${PKG_SYSCONFDIR}\" | | 42 | CCARGS+= -DDEF_CONFIG_DIR=\"${PKG_SYSCONFDIR}\" |
41 | CCARGS+= -DDEF_SENDMAIL_PATH=\"${PREFIX}/sbin/sendmail\" | | 43 | CCARGS+= -DDEF_SENDMAIL_PATH=\"${PREFIX}/sbin/sendmail\" |
42 | CCARGS+= -DDEF_MAILQ_PATH=\"${PREFIX}/bin/mailq\" | | 44 | CCARGS+= -DDEF_MAILQ_PATH=\"${PREFIX}/bin/mailq\" |
43 | CCARGS+= -DDEF_NEWALIAS_PATH=\"${PREFIX}/bin/newaliases\" | | 45 | CCARGS+= -DDEF_NEWALIAS_PATH=\"${PREFIX}/bin/newaliases\" |
44 | CCARGS+= -DDEF_MANPAGE_DIR=\"${PREFIX}/${PKGMANDIR}\" | | 46 | CCARGS+= -DDEF_MANPAGE_DIR=\"${PREFIX}/${PKGMANDIR}\" |
45 | CCARGS+= -DDEF_SAMPLE_DIR=\"${EXAMPLEDIR}\" | | 47 | CCARGS+= -DDEF_SAMPLE_DIR=\"${EXAMPLEDIR}\" |
46 | CCARGS+= -DDEF_README_DIR=\"${DOCDIR}\" | | 48 | CCARGS+= -DDEF_README_DIR=\"${DOCDIR}\" |
47 | | | 49 | |
48 | REPLACE_PERL+= auxiliary/qshape/qshape.pl | | 50 | REPLACE_PERL+= auxiliary/qshape/qshape.pl |
49 | | | 51 | |
50 | # Override those same default paths in the installed example main.cf. | | 52 | # Override those same default paths in the installed example main.cf. |
51 | SUBST_CLASSES+= postfix | | 53 | SUBST_CLASSES+= postfix |
52 | SUBST_STAGE.postfix= post-configure | | 54 | SUBST_STAGE.postfix= post-configure |
53 | SUBST_FILES.postfix= conf/main.cf src/global/mail_params.h | | 55 | SUBST_FILES.postfix= conf/main.cf src/global/mail_params.h |
54 | SUBST_SED.postfix= \ | | 56 | SUBST_SED.postfix= \ |
| | | 57 | -e 's|^\(data_directory\) =.*|\1 = ${POSTFIX_DATA_DIR}|' |
| | | 58 | SUBST_SED.postfix+= \ |
55 | -e 's|^\(queue_directory\) =.*|\1 = ${POSTFIX_QUEUE_DIR}|' | | 59 | -e 's|^\(queue_directory\) =.*|\1 = ${POSTFIX_QUEUE_DIR}|' |
56 | SUBST_SED.postfix+= \ | | 60 | SUBST_SED.postfix+= \ |
57 | -e 's|^\(command_directory\) =.*|\1 = ${PREFIX}/sbin|' | | 61 | -e 's|^\(command_directory\) =.*|\1 = ${PREFIX}/sbin|' |
58 | SUBST_SED.postfix+= \ | | 62 | SUBST_SED.postfix+= \ |
59 | -e 's|^\(daemon_directory\) =.*|\1 = ${LIBEXECDIR}|' | | 63 | -e 's|^\(daemon_directory\) =.*|\1 = ${LIBEXECDIR}|' |
60 | SUBST_SED.postfix+= \ | | 64 | SUBST_SED.postfix+= \ |
61 | -e 's|^\(sendmail_path\) =.*|\1 = ${PREFIX}/sbin/sendmail|' | | 65 | -e 's|^\(sendmail_path\) =.*|\1 = ${PREFIX}/sbin/sendmail|' |
62 | SUBST_SED.postfix+= \ | | 66 | SUBST_SED.postfix+= \ |
63 | -e 's|^\(newaliases_path\) =.*|\1 = ${PREFIX}/bin/newaliases|' | | 67 | -e 's|^\(newaliases_path\) =.*|\1 = ${PREFIX}/bin/newaliases|' |
64 | SUBST_SED.postfix+= \ | | 68 | SUBST_SED.postfix+= \ |
65 | -e 's|^\(mailq_path\) =.*|\1 = ${PREFIX}/bin/mailq|' | | 69 | -e 's|^\(mailq_path\) =.*|\1 = ${PREFIX}/bin/mailq|' |
66 | SUBST_SED.postfix+= \ | | 70 | SUBST_SED.postfix+= \ |
67 | -e 's|^\(setgid_group\) =.*|\1 = maildrop|' | | 71 | -e 's|^\(setgid_group\) =.*|\1 = maildrop|' |
68 | SUBST_SED.postfix+= \ | | 72 | SUBST_SED.postfix+= \ |
69 | -e 's|^\(manpage_directory\) =.*|\1 = ${PREFIX}/${PKGMANDIR}|' | | 73 | -e 's|^\(manpage_directory\) =.*|\1 = ${PREFIX}/${PKGMANDIR}|' |
70 | SUBST_SED.postfix+= \ | | 74 | SUBST_SED.postfix+= \ |
71 | -e 's|^\(sample_directory\) =.*|\1 = ${EXAMPLEDIR}|' | | 75 | -e 's|^\(sample_directory\) =.*|\1 = ${EXAMPLEDIR}|' |
72 | SUBST_SED.postfix+= \ | | 76 | SUBST_SED.postfix+= \ |
73 | -e 's|^\(readme_directory\) =.*|\1 = ${DOCDIR}|' | | 77 | -e 's|^\(readme_directory\) =.*|\1 = ${DOCDIR}|' |
74 | SUBST_SED.postfix+= \ | | 78 | SUBST_SED.postfix+= \ |
75 | -e '/^\#define DEF_SGID_GROUP[ ]/s,postdrop,maildrop,g' | | 79 | -e '/^\#define DEF_SGID_GROUP[ ]/s,postdrop,maildrop,g' |
76 | | | 80 | |
77 | # options.mk appends to CCARGS and AUXLIBS the options needed to build | | 81 | # options.mk appends to CCARGS and AUXLIBS the options needed to build |
78 | # Postfix with support for various add-on modules. | | 82 | # Postfix with support for various add-on modules. |
79 | # | | 83 | # |
80 | .include "options.mk" | | 84 | .include "options.mk" |
81 | | | 85 | |
82 | PKG_SYSCONFSUBDIR= postfix | | 86 | PKG_SYSCONFSUBDIR= postfix |
83 | LIBEXECDIR= ${PREFIX}/libexec/postfix | | 87 | LIBEXECDIR= ${PREFIX}/libexec/postfix |
84 | DOCDIR= ${PREFIX}/share/doc/postfix | | 88 | DOCDIR= ${PREFIX}/share/doc/postfix |
85 | EXAMPLEDIR= ${PREFIX}/share/examples/postfix | | 89 | EXAMPLEDIR= ${PREFIX}/share/examples/postfix |
86 | | | 90 | |
87 | FILES_SUBST+= EXAMPLEDIR=${EXAMPLEDIR:Q} | | 91 | FILES_SUBST+= EXAMPLEDIR=${EXAMPLEDIR:Q} |
88 | MESSAGE_SUBST+= EXAMPLEDIR=${EXAMPLEDIR} | | 92 | MESSAGE_SUBST+= EXAMPLEDIR=${EXAMPLEDIR} |
89 | MESSAGE_SUBST+= DOCDIR=${DOCDIR} | | 93 | MESSAGE_SUBST+= DOCDIR=${DOCDIR} |
90 | | | 94 | |
91 | MESSAGE_SRC+= ${PKGDIR}/MESSAGE | | 95 | MESSAGE_SRC+= ${PKGDIR}/MESSAGE |
92 | .if exists(${PKGDIR}/MESSAGE.${OPSYS}) | | 96 | .if exists(${PKGDIR}/MESSAGE.${OPSYS}) |
93 | MESSAGE_SRC+= ${PKGDIR}/MESSAGE.${OPSYS} | | 97 | MESSAGE_SRC+= ${PKGDIR}/MESSAGE.${OPSYS} |
94 | .endif | | 98 | .endif |
95 | PLIST_SRC+= ${PKGDIR}/PLIST | | 99 | PLIST_SRC+= ${PKGDIR}/PLIST |
96 | | | 100 | |
97 | BUILD_TARGET= # empty | | 101 | BUILD_TARGET= # empty |
98 | MAKE_ENV+= CC=${CC:Q} OPT=${CFLAGS:Q} | | 102 | MAKE_ENV+= CC=${CC:Q} OPT=${CFLAGS:Q} |
99 | MAKE_ENV+= AUXLIBS=${AUXLIBS:Q} CCARGS=${CCARGS:Q} | | 103 | MAKE_ENV+= AUXLIBS=${AUXLIBS:Q} CCARGS=${CCARGS:Q} |
100 | | | 104 | |
101 | RCD_SCRIPTS= postfix | | 105 | RCD_SCRIPTS= postfix |
102 | OWN_DIRS+= ${POSTFIX_QUEUE_DIR} ${POSTFIX_QUEUE_DIR}/etc | | 106 | OWN_DIRS+= ${POSTFIX_QUEUE_DIR} ${POSTFIX_QUEUE_DIR}/etc |
| | | 107 | OWN_DIRS_PERMS+= ${POSTFIX_DATA_DIR} postfix postfix 0700 |
103 | MAKE_DIRS+= ${PKG_SYSCONFDIR} | | 108 | MAKE_DIRS+= ${PKG_SYSCONFDIR} |
104 | | | 109 | |
105 | PKG_GROUPS?= postfix maildrop | | 110 | PKG_GROUPS?= postfix maildrop |
106 | PKG_USERS?= postfix:postfix | | 111 | PKG_USERS?= postfix:postfix |
107 | PKG_GECOS.postfix= Postfix User | | 112 | PKG_GECOS.postfix= Postfix User |
108 | PKG_HOME.postfix= ${POSTFIX_QUEUE_DIR} | | 113 | PKG_HOME.postfix= ${POSTFIX_QUEUE_DIR} |
109 | | | 114 | |
110 | CONF_FILES= # empty | | 115 | CONF_FILES= # empty |
111 | .for i in main.cf master.cf postfix-files | | 116 | .for i in main.cf master.cf postfix-files |
112 | CONF_FILES+= ${EXAMPLEDIR}/${i} ${PKG_SYSCONFDIR}/${i} | | 117 | CONF_FILES+= ${EXAMPLEDIR}/${i} ${PKG_SYSCONFDIR}/${i} |
113 | .endfor | | 118 | .endfor |
114 | CONF_FILES_PERMS= # empty | | 119 | CONF_FILES_PERMS= # empty |
115 | .for i in post-install postfix-script | | 120 | .for i in post-install postfix-script |
116 | CONF_FILES_PERMS+= ${EXAMPLEDIR}/${i} ${PKG_SYSCONFDIR}/${i} \ | | 121 | CONF_FILES_PERMS+= ${EXAMPLEDIR}/${i} ${PKG_SYSCONFDIR}/${i} \ |
117 | ${ROOT_USER} ${ROOT_GROUP} 755 | | 122 | ${ROOT_USER} ${ROOT_GROUP} 755 |
118 | .endfor | | 123 | .endfor |
119 | | | 124 | |
120 | MAKE_ENV+= DEBUG= # empty | | 125 | MAKE_ENV+= DEBUG= # empty |
121 | | | 126 | |
122 | SUBST_CLASSES+= paths | | 127 | SUBST_CLASSES+= paths |
123 | SUBST_FILES.paths= ${WRKDIR}/mailer.conf | | 128 | SUBST_FILES.paths= ${WRKDIR}/mailer.conf |
124 | SUBST_SED.paths+= -e 's,@PREFIX@,${PREFIX},g' | | 129 | SUBST_SED.paths+= -e 's,@PREFIX@,${PREFIX},g' |
125 | SUBST_STAGE.paths= post-patch | | 130 | SUBST_STAGE.paths= post-patch |
126 | | | 131 | |
127 | post-extract: | | 132 | post-extract: |
128 | cp ${FILESDIR}/mailer.conf ${WRKDIR}/mailer.conf | | 133 | cp ${FILESDIR}/mailer.conf ${WRKDIR}/mailer.conf |
129 | rm -f ${WRKSRC}/auxiliary/MacOSX/Postfix.StartupItem/Postfix | | 134 | rm -f ${WRKSRC}/auxiliary/MacOSX/Postfix.StartupItem/Postfix |
130 | | | 135 | |
131 | do-configure: | | 136 | do-configure: |
132 | cd ${WRKSRC} && \ | | 137 | cd ${WRKSRC} && \ |
133 | env ${MAKE_ENV} ${MAKE} -f Makefile.init makefiles \ | | 138 | env ${MAKE_ENV} ${MAKE} -f Makefile.init makefiles \ |
134 | 'CCARGS=${CCARGS}' 'AUXLIBS=${AUXLIBS}' | | 139 | 'CCARGS=${CCARGS}' 'AUXLIBS=${AUXLIBS}' |
135 | | | 140 | |
136 | post-build: | | 141 | post-build: |
137 | .if !empty(PKG_OPTIONS:Msasl) | | 142 | .if !empty(PKG_OPTIONS:Msasl) |
138 | ${ECHO} "pwcheck_method: ${PWCHECK_METHOD}" > ${WRKDIR}/smtpd.conf | | 143 | ${ECHO} "pwcheck_method: ${PWCHECK_METHOD}" > ${WRKDIR}/smtpd.conf |
139 | .endif | | 144 | .endif |
140 | | | 145 | |
141 | do-install: | | 146 | do-install: |
142 | ${INSTALL_DATA_DIR} ${LIBEXECDIR} | | 147 | ${INSTALL_DATA_DIR} ${LIBEXECDIR} |
143 | ${INSTALL_DATA_DIR} ${EXAMPLEDIR} | | 148 | ${INSTALL_DATA_DIR} ${EXAMPLEDIR} |
144 | ${INSTALL_DATA_DIR} ${DOCDIR} | | 149 | ${INSTALL_DATA_DIR} ${DOCDIR} |
145 | rm -f ${WRKSRC}/conf/*.orig | | 150 | rm -f ${WRKSRC}/conf/*.orig |
146 | .if !empty(PKG_OPTIONS:Msasl) | | 151 | .if !empty(PKG_OPTIONS:Msasl) |
147 | ${INSTALL_DATA} ${WRKDIR}/smtpd.conf ${EXAMPLEDIR} | | 152 | ${INSTALL_DATA} ${WRKDIR}/smtpd.conf ${EXAMPLEDIR} |
148 | .endif | | 153 | .endif |
149 | ${INSTALL_SCRIPT} ${WRKSRC}/conf/post-install ${EXAMPLEDIR} | | 154 | ${INSTALL_SCRIPT} ${WRKSRC}/conf/post-install ${EXAMPLEDIR} |
150 | ${INSTALL_SCRIPT} ${WRKSRC}/conf/postfix-script ${EXAMPLEDIR} | | 155 | ${INSTALL_SCRIPT} ${WRKSRC}/conf/postfix-script ${EXAMPLEDIR} |
151 | ${INSTALL_DATA} ${WRKDIR}/mailer.conf ${EXAMPLEDIR}/mailer.conf | | 156 | ${INSTALL_DATA} ${WRKDIR}/mailer.conf ${EXAMPLEDIR}/mailer.conf |
152 | cd ${WRKSRC} && sh ./postfix-install -non-interactive \ | | 157 | cd ${WRKSRC} && sh ./postfix-install -non-interactive \ |
153 | config_directory="${EXAMPLEDIR}" | | 158 | config_directory="${EXAMPLEDIR}" |
154 | ${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/qshape/qshape.pl \ | | 159 | ${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/qshape/qshape.pl \ |
155 | ${PREFIX}/sbin/qshape | | 160 | ${PREFIX}/sbin/qshape |
156 | ${INSTALL_MAN} ${WRKSRC}/man/man1/qshape.1 \ | | 161 | ${INSTALL_MAN} ${WRKSRC}/man/man1/qshape.1 \ |
157 | ${PREFIX}/${PKGMANDIR}/man1 | | 162 | ${PREFIX}/${PKGMANDIR}/man1 |
158 | | | 163 | |
159 | .include "../../mk/bsd.pkg.mk" | | 164 | .include "../../mk/bsd.pkg.mk" |