diff options
author | pav <pav@FreeBSD.org> | 2010-08-26 20:04:31 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2010-08-26 20:04:31 +0800 |
commit | 4a29b9771ea524f815aea47bc7d7ddc843beba2c (patch) | |
tree | 9708070047d4e0e64ebcfb28f1dbb22fdbb57e11 | |
parent | 31f0570d1a3911f91eff03154e3db50606eb81ce (diff) | |
download | freebsd-ports-gnome-4a29b9771ea524f815aea47bc7d7ddc843beba2c.tar.gz freebsd-ports-gnome-4a29b9771ea524f815aea47bc7d7ddc843beba2c.tar.zst freebsd-ports-gnome-4a29b9771ea524f815aea47bc7d7ddc843beba2c.zip |
- Automate adding command line options from various optional patches
PR: ports/147230
Submitted by: Marshal Newrock <marshal@zordio.com>
-rw-r--r-- | mail/spamass-milter/Makefile | 20 | ||||
-rw-r--r-- | mail/spamass-milter/files/extra-patch-addauth | 9 | ||||
-rw-r--r-- | mail/spamass-milter/files/extra-patch-options (renamed from mail/spamass-milter/files/extra-patch-rejecttext2) | 2 | ||||
-rw-r--r-- | mail/spamass-milter/files/extra-patch-rejecttext2a | 11 |
4 files changed, 16 insertions, 26 deletions
diff --git a/mail/spamass-milter/Makefile b/mail/spamass-milter/Makefile index e01468dcf344..a6f039841d0e 100644 --- a/mail/spamass-milter/Makefile +++ b/mail/spamass-milter/Makefile @@ -27,17 +27,22 @@ OPTIONS= ADDAUTH_PATCH "Bypass checks for SMTP AUTH connections" off \ .include <bsd.port.pre.mk> +ORIG_ARGS= fd:mMp:P:r:u:D:i:b:B:e:x +NEW_ARGS:= ${ORIG_ARGS} + .if defined(WITH_ADDAUTH_PATCH) -EXTRA_PATCHES= ${FILESDIR}/extra-patch-addauth +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-addauth +NEW_ARGS:= ${NEW_ARGS}a .endif .if defined(WITH_REJECTTEXT_PATCH) EXTRA_PATCHES+= ${FILESDIR}/extra-patch-rejecttext1 -.if defined(WITH_ADDAUTH_PATCH) -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-rejecttext2a -.else -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-rejecttext2 +NEW_ARGS:= ${NEW_ARGS}R: .endif + +# extra-patch-options is modified in pre-patch +.if ${ORIG_ARGS} != ${NEW_ARGS} +EXTRA_PATCHES+= ${WRKDIR}/extra-patch-options .endif .if exists(${LOCALBASE}/lib/libldap.so) @@ -86,6 +91,11 @@ SUB_FILES= pkg-message MAN1= spamass-milter.1 +pre-patch: +.if ${ORIG_ARGS} != ${NEW_ARGS} + @${SED} -e 's|%NEW_ARGS%|${NEW_ARGS}|' ${FILESDIR}/extra-patch-options > ${WRKDIR}/extra-patch-options +.endif + post-patch: @${SED} -e's,%%PREFIX%%,${PREFIX},g' \ ${FILESDIR}/activation.txt > ${WRKDIR}/activation.txt diff --git a/mail/spamass-milter/files/extra-patch-addauth b/mail/spamass-milter/files/extra-patch-addauth index 59957119362d..3112e97ef2f2 100644 --- a/mail/spamass-milter/files/extra-patch-addauth +++ b/mail/spamass-milter/files/extra-patch-addauth @@ -22,15 +22,6 @@ diff -u orig/spamass-milter.cpp spamass-milter.cpp #if defined(__FreeBSD__) /* popen bug - see PR bin/50770 */ static pthread_mutex_t popen_mutex = PTHREAD_MUTEX_INITIALIZER; -@@ -181,7 +182,7 @@ - main(int argc, char* argv[]) - { - int c, err = 0; -- const char *args = "fd:mMp:P:r:u:D:i:b:B:e:x"; -+ const char *args = "fd:mMp:P:r:u:D:i:b:B:e:xa"; - char *sock = NULL; - bool dofork = false; - char *pidfilename = NULL; @@ -196,6 +197,9 @@ /* Process command line options */ while ((c = getopt(argc, argv, args)) != -1) { diff --git a/mail/spamass-milter/files/extra-patch-rejecttext2 b/mail/spamass-milter/files/extra-patch-options index 569156e3e71a..748292e22a0f 100644 --- a/mail/spamass-milter/files/extra-patch-rejecttext2 +++ b/mail/spamass-milter/files/extra-patch-options @@ -5,7 +5,7 @@ { int c, err = 0; - const char *args = "fd:mMp:P:r:u:D:i:b:B:e:x"; -+ const char *args = "fd:mMp:P:r:R:u:D:i:b:B:e:x"; ++ const char *args = "%NEW_ARGS%"; char *sock = NULL; bool dofork = false; char *pidfilename = NULL; diff --git a/mail/spamass-milter/files/extra-patch-rejecttext2a b/mail/spamass-milter/files/extra-patch-rejecttext2a deleted file mode 100644 index eb0bd7a25311..000000000000 --- a/mail/spamass-milter/files/extra-patch-rejecttext2a +++ /dev/null @@ -1,11 +0,0 @@ ---- spamass-milter.cpp.ORIG 2006-06-17 11:06:30.000000000 +0200 -+++ spamass-milter.cpp 2006-06-17 11:10:11.000000000 +0200 -@@ -181,7 +182,7 @@ - main(int argc, char* argv[]) - { - int c, err = 0; -- const char *args = "fd:mMp:P:r:u:D:i:b:B:e:xa"; -+ const char *args = "fd:mMp:P:r:R:u:D:i:b:B:e:xa"; - char *sock = NULL; - bool dofork = false; - char *pidfilename = NULL; |