pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mail/postfix Reduce the number of patches needed by Po...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7397b4c30305
branches:  trunk
changeset: 479188:7397b4c30305
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sat Aug 07 07:58:32 2004 +0000

description:
Reduce the number of patches needed by Postfix by using the subst
framework and also by explicitly specifying more default values for
Postfix parameters.  Also pass -I/usr/pkg/include/sasl to the compiler
when building using Cyrus SASLv2, which allows me to remove the patches
that added an unnecessary USE_SASL2_AUTH check.

diffstat:

 mail/postfix/Makefile         |  37 +++++++++++++++++---------
 mail/postfix/distinfo         |   7 +----
 mail/postfix/options.mk       |   8 +++--
 mail/postfix/patches/patch-ab |  23 ----------------
 mail/postfix/patches/patch-ac |  23 ----------------
 mail/postfix/patches/patch-ae |  29 --------------------
 mail/postfix/patches/patch-af |  60 -------------------------------------------
 mail/postfix/patches/patch-ah |  23 ----------------
 8 files changed, 30 insertions(+), 180 deletions(-)

diffs (292 lines):

diff -r 57e80000e1e6 -r 7397b4c30305 mail/postfix/Makefile
--- a/mail/postfix/Makefile     Sat Aug 07 07:55:56 2004 +0000
+++ b/mail/postfix/Makefile     Sat Aug 07 07:58:32 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.147 2004/08/05 03:04:33 jlam Exp $
+# $NetBSD: Makefile,v 1.148 2004/08/07 07:58:32 jlam Exp $
 
 DISTNAME=      postfix-2.1.4
 CATEGORIES=    mail
@@ -33,13 +33,34 @@
 AUXLIBS=       # empty
 FIX_RPATH+=    AUXLIBS
 
-CCARGS+=       -DDEF_CONFIG_DIR=\"${PKG_SYSCONFDIR}\"
+# Set some default paths to override ${WRKSRC}/src/global/mail_params.h.
 CCARGS+=       -DDEF_QUEUE_DIR=\"${POSTFIX_QUEUE_DIR}\"
+CCARGS+=       -DDEF_DAEMON_DIR=\"${LIBEXECDIR}\"
 CCARGS+=       -DDEF_COMMAND_DIR=\"${PREFIX}/sbin\"
-CCARGS+=       -DDEF_DAEMON_DIR=\"${LIBEXECDIR}\"
+CCARGS+=       -DDEF_CONFIG_DIR=\"${PKG_SYSCONFDIR}\"
 CCARGS+=       -DDEF_SENDMAIL_PATH=\"${PREFIX}/sbin/sendmail\"
 CCARGS+=       -DDEF_MAILQ_PATH=\"${PREFIX}/bin/mailq\"
 CCARGS+=       -DDEF_NEWALIAS_PATH=\"${PREFIX}/bin/newaliases\"
+CCARGS+=       -DDEF_MANPAGE_DIR=\"${PREFIX}/man\"
+CCARGS+=       -DDEF_SAMPLE_DIR=\"${EXAMPLEDIR}\"
+CCARGS+=       -DDEF_README_DIR=\"${DOCDIR}\"
+
+# Override those same default paths in the installed example main.cf.
+SUBST_CLASSES+=                postfix
+SUBST_STAGE.postfix=   post-configure
+SUBST_FILES.postfix=   conf/main.cf src/global/mail_params.h
+SUBST_SED.postfix=     \
+       -e "s|^\(queue_directory\) =.*|\1 = ${POSTFIX_QUEUE_DIR}|"      \
+       -e "s|^\(command_directory\) =.*|\1 = ${PREFIX}/sbin|"          \
+       -e "s|^\(daemon_directory\) =.*|\1 = ${LIBEXECDIR}|"            \
+       -e "s|^\(sendmail_path\) =.*|\1 = ${PREFIX}/sbin/sendmail|"     \
+       -e "s|^\(newaliases_path\) =.*|\1 = ${PREFIX}/bin/newaliases|"  \
+       -e "s|^\(mailq_path\) =.*|\1 = ${PREFIX}/bin/mailq|"            \
+       -e "s|^\(setgid_group\) =.*|\1 = maildrop|"                     \
+       -e "s|^\(manpage_directory\) =.*|\1 = ${PREFIX}/man|"           \
+       -e "s|^\(sample_directory\) =.*|\1 = ${EXAMPLEDIR}|"            \
+       -e "s|^\(readme_directory\) =.*|\1 = ${DOCDIR}|"                \
+       -e "/^\#define DEF_SGID_GROUP[  ]/s,postdrop,maildrop,g"
 
 # options.mk appends to CCARGS and AUXLIBS the options needed to build
 # Postfix with support for various add-on modules.
@@ -88,16 +109,6 @@
 CONF_FILES+=           ${EXAMPLEDIR}/smtpd.conf ${SASLLIBDIR}/smtpd.conf
 .endif
 
-POSTFIX_CONF_FILES=    conf/main.cf src/util/sys_defs.h                \
-                       src/global/mail_params.h postfix-install
-
-pre-configure:
-       @for i in ${POSTFIX_CONF_FILES}; do                             \
-               ${CP} ${WRKSRC}/$${i} ${WRKSRC}/$${i}.dist;             \
-               ${SED} ${FILES_SUBST_SED} ${WRKSRC}/$${i}.dist          \
-                       > ${WRKSRC}/$${i};                              \
-       done
-
 do-configure:
        cd ${WRKSRC} &&                                                 \
        ${SETENV} ${MAKE_ENV} ${MAKE} -f Makefile.init makefiles        \
diff -r 57e80000e1e6 -r 7397b4c30305 mail/postfix/distinfo
--- a/mail/postfix/distinfo     Sat Aug 07 07:55:56 2004 +0000
+++ b/mail/postfix/distinfo     Sat Aug 07 07:58:32 2004 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.71 2004/08/04 20:49:43 jlam Exp $
+$NetBSD: distinfo,v 1.72 2004/08/07 07:58:32 jlam Exp $
 
 SHA1 (postfix/postfix-2.1.4.tar.gz) = 64dbd7b053df4ccf2191d4200b272be06e1592a8
 Size (postfix/postfix-2.1.4.tar.gz) = 1970068 bytes
@@ -7,10 +7,5 @@
 SHA1 (postfix/tls+ipv6-1.25-pf-2.1.4.patch.gz) = af90da3976643f3e0f7cfb2491be090d55f40a6a
 Size (postfix/tls+ipv6-1.25-pf-2.1.4.patch.gz) = 256600 bytes
 SHA1 (patch-aa) = 279b54f19289b56a423214716386c5aab79a57d5
-SHA1 (patch-ab) = ac4c75fb7a36491edf03b54915c7a47461748b4d
-SHA1 (patch-ac) = b0d26742fe8496b2fd4729a41fecadc275e71cf2
-SHA1 (patch-ae) = 3c0884fc2969d8353809895479f0f58897c5f133
-SHA1 (patch-af) = 48f0f516f415b1faa1e9d2775e9446aa540d749d
 SHA1 (patch-ag) = 292b3b5d87f4688930fd654edfc5cb83ca8a2652
-SHA1 (patch-ah) = 6beedd15ee3a7cfd46cf3ed0b9ee579b9906300b
 SHA1 (patch-ai) = e7284d9b3d7b83def7994269867e443fc0394d40
diff -r 57e80000e1e6 -r 7397b4c30305 mail/postfix/options.mk
--- a/mail/postfix/options.mk   Sat Aug 07 07:55:56 2004 +0000
+++ b/mail/postfix/options.mk   Sat Aug 07 07:58:32 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.1 2004/08/05 03:04:33 jlam Exp $
+# $NetBSD: options.mk,v 1.2 2004/08/07 07:58:32 jlam Exp $
 
 # Global and legacy options
 #
@@ -136,17 +136,19 @@
 .if !empty(PKG_OPTIONS:Msasl)
 .  if !defined(USE_SASL2) && !defined(USE_SASL)
 .    include "../../security/cyrus-sasl2/buildlink3.mk"
+BUILDLINK_INCDIRS.cyrus-sasl=  include/sasl
 SASLLIBDIR=    ${PREFIX}/lib/sasl2
 PWCHECK_METHOD=        auxprop
-CCARGS+=       -DUSE_SASL2_AUTH
+CCARGS+=       -DUSE_SASL_AUTH
 AUXLIBS+=      -L${BUILDLINK_PREFIX.cyrus-sasl}/lib                    \
                -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.cyrus-sasl}/lib     \
                -lsasl2
 .  elif defined(USE_SASL2) && !empty(USE_SASL2:M[yY][eE][sS])
 .    include "../../security/cyrus-sasl2/buildlink3.mk"
+BUILDLINK_INCDIRS.cyrus-sasl=  include/sasl
 SASLLIBDIR=    ${PREFIX}/lib/sasl2
 PWCHECK_METHOD=        auxprop
-CCARGS+=       -DUSE_SASL2_AUTH
+CCARGS+=       -DUSE_SASL_AUTH
 AUXLIBS+=      -L${BUILDLINK_PREFIX.cyrus-sasl}/lib                    \
                -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.cyrus-sasl}/lib     \
                -lsasl2
diff -r 57e80000e1e6 -r 7397b4c30305 mail/postfix/patches/patch-ab
--- a/mail/postfix/patches/patch-ab     Sat Aug 07 07:55:56 2004 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-$NetBSD: patch-ab,v 1.8 2004/01/20 19:37:45 martin Exp $
-
---- src/lmtp/lmtp.h.orig       2003-09-10 02:48:03.000000000 +0200
-+++ src/lmtp/lmtp.h    2004-01-20 20:30:12.000000000 +0100
-@@ -11,10 +11,18 @@
-  /*
-   * SASL library.
-   */
-+#ifdef USE_SASL2_AUTH
-+#ifndef USE_SASL_AUTH
-+#define USE_SASL_AUTH
-+#endif
-+#include <sasl/sasl.h>
-+#include <sasl/saslutil.h>
-+#else
- #ifdef USE_SASL_AUTH
- #include <sasl.h>
- #include <saslutil.h>
- #endif
-+#endif
- 
-  /*
-   * Utility library.
diff -r 57e80000e1e6 -r 7397b4c30305 mail/postfix/patches/patch-ac
--- a/mail/postfix/patches/patch-ac     Sat Aug 07 07:55:56 2004 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-$NetBSD: patch-ac,v 1.6 2004/01/20 19:37:45 martin Exp $
-
---- src/smtp/smtp.h.orig       2002-05-23 21:18:02.000000000 +0200
-+++ src/smtp/smtp.h    2004-01-20 20:29:21.000000000 +0100
-@@ -11,10 +11,18 @@
-  /*
-   * SASL library.
-   */
-+#ifdef USE_SASL2_AUTH
-+#ifndef USE_SASL_AUTH
-+#define USE_SASL_AUTH
-+#endif
-+#include <sasl/sasl.h>
-+#include <sasl/saslutil.h>
-+#else
- #ifdef USE_SASL_AUTH
- #include <sasl.h>
- #include <saslutil.h>
- #endif
-+#endif
- 
-  /*
-   * Utility library.
diff -r 57e80000e1e6 -r 7397b4c30305 mail/postfix/patches/patch-ae
--- a/mail/postfix/patches/patch-ae     Sat Aug 07 07:55:56 2004 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-$NetBSD: patch-ae,v 1.9 2004/07/18 19:16:31 jlam Exp $
-
---- src/global/mail_params.h.orig      2004-04-21 14:56:04.000000000 -0400
-+++ src/global/mail_params.h   2004-05-23 22:44:13.000000000 -0400
-@@ -64,7 +64,7 @@
- extern gid_t var_owner_gid;
- 
- #define VAR_SGID_GROUP                "setgid_group"
--#define DEF_SGID_GROUP                "postdrop"
-+#define DEF_SGID_GROUP                "maildrop"
- extern char *var_sgid_group;
- extern gid_t var_sgid_gid;
- 
-@@ -202,13 +202,13 @@
-   */
- #define VAR_DAEMON_DIR                "daemon_directory"
- #ifndef DEF_DAEMON_DIR
--#define DEF_DAEMON_DIR                "/usr/libexec/postfix"
-+#define DEF_DAEMON_DIR                "@PREFIX@/libexec/postfix"
- #endif
- extern char *var_daemon_dir;
- 
- #define VAR_COMMAND_DIR               "command_directory"
- #ifndef DEF_COMMAND_DIR
--#define DEF_COMMAND_DIR               "/usr/sbin"
-+#define DEF_COMMAND_DIR               "@PREFIX@/sbin"
- #endif
- extern char *var_command_dir;
- 
diff -r 57e80000e1e6 -r 7397b4c30305 mail/postfix/patches/patch-af
--- a/mail/postfix/patches/patch-af     Sat Aug 07 07:55:56 2004 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-$NetBSD: patch-af,v 1.20 2004/07/18 19:16:31 jlam Exp $
-
---- conf/main.cf.orig  2004-04-15 09:27:21.000000000 -0400
-+++ conf/main.cf       2004-05-23 22:51:16.000000000 -0400
-@@ -32,13 +32,18 @@
- # The command_directory parameter specifies the location of all
- # postXXX commands.
- #
--command_directory = /usr/sbin
-+command_directory = @PREFIX@/sbin
- 
- # The daemon_directory parameter specifies the location of all Postfix
- # daemon programs (i.e. programs listed in the master.cf file). This
- # directory must be owned by root.
- #
--daemon_directory = /usr/libexec/postfix
-+daemon_directory = @PREFIX@/libexec/postfix
-+
-+# Shared files and etc directory
-+etc_directory = @PKG_SYSCONFDIR@
-+share_directory = @PREFIX@/share/examples/postfix
-+man_directory = @PREFIX@/man
- 
- # QUEUE AND PROCESS OWNERSHIP
- #
-@@ -56,7 +61,7 @@
- # These rights are used in the absence of a recipient user context.
- # DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
- #
--#default_privs = nobody
-+default_privs = nobody
- 
- # INTERNET HOST AND DOMAIN NAMES
- # 
-@@ -611,7 +616,7 @@
- # commands.  This must be a group name with a numerical group ID that
- # is not shared with other accounts, not even with the Postfix account.
- #
--setgid_group =
-+setgid_group = maildrop
- 
- # html_directory: The location of the Postfix HTML documentation.
- #
-@@ -619,13 +624,13 @@
- 
- # manpage_directory: The location of the Postfix on-line manual pages.
- #
--manpage_directory =
-+manpage_directory = @PREFIX@/man
- 
- # sample_directory: The location of the Postfix sample configuration files.
- # This parameter is obsolete as of Postfix 2.1.
- #
--sample_directory =
-+sample_directory = @PREFIX@/share/examples/postfix
- 
- # readme_directory: The location of the Postfix README files.
- #
--readme_directory =
-+readme_directory = @PREFIX@/share/doc/postfix
diff -r 57e80000e1e6 -r 7397b4c30305 mail/postfix/patches/patch-ah
--- a/mail/postfix/patches/patch-ah     Sat Aug 07 07:55:56 2004 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-$NetBSD: patch-ah,v 1.5 2003/10/03 15:04:52 christos Exp $
-
---- src/smtpd/smtpd.h.orig     2003-10-02 06:48:30.000000000 -0400
-+++ src/smtpd/smtpd.h  2003-10-02 06:48:31.000000000 -0400
-@@ -16,10 +16,18 @@
-  /*
-   * SASL library.
-   */
-+#ifdef USE_SASL2_AUTH
-+#ifndef USE_SASL_AUTH
-+#define USE_SASL_AUTH
-+#endif
-+#include <sasl/sasl.h>
-+#include <sasl/saslutil.h>
-+#else
- #ifdef USE_SASL_AUTH
- #include <sasl.h>
- #include <saslutil.h>
- #endif
-+#endif
- 
-  /*
-   * Utility library.



Home | Main Index | Thread Index | Old Index