diff options
author | amdmi3 <amdmi3@FreeBSD.org> | 2015-06-02 21:47:20 +0800 |
---|---|---|
committer | amdmi3 <amdmi3@FreeBSD.org> | 2015-06-02 21:47:20 +0800 |
commit | 21c12d95065955c1fb3a424412ed847865fe90fa (patch) | |
tree | 2b35c041d27b07ffb5cf854ffe5aa6b0a8a48db4 /mail | |
parent | fcd40231eb2e008a913dd602bbd62f6266c680ff (diff) | |
download | freebsd-ports-gnome-21c12d95065955c1fb3a424412ed847865fe90fa.tar.gz freebsd-ports-gnome-21c12d95065955c1fb3a424412ed847865fe90fa.tar.zst freebsd-ports-gnome-21c12d95065955c1fb3a424412ed847865fe90fa.zip |
- Don't override upstream paths
- Replace hardcoded /usr/local by ${PREFIX}
- Add required_files and command_args to rc script
- Fix REINPLACE_CMD args in Makefile
PR: 199081
Submitted by: sasaki@fcc.ad.jp (maintainer)
Diffstat (limited to 'mail')
-rw-r--r-- | mail/smfsav/Makefile | 12 | ||||
-rw-r--r-- | mail/smfsav/files/patch-readme | 23 | ||||
-rw-r--r-- | mail/smfsav/files/patch-smf-sav.c | 19 | ||||
-rw-r--r-- | mail/smfsav/files/patch-smf-sav.conf | 26 | ||||
-rw-r--r-- | mail/smfsav/files/pkg-message.in | 2 | ||||
-rw-r--r-- | mail/smfsav/files/smfsav.in | 6 | ||||
-rw-r--r-- | mail/smfsav/pkg-plist | 6 |
7 files changed, 28 insertions, 66 deletions
diff --git a/mail/smfsav/Makefile b/mail/smfsav/Makefile index be42fa67475a..4412e3f08ebf 100644 --- a/mail/smfsav/Makefile +++ b/mail/smfsav/Makefile @@ -3,7 +3,7 @@ PORTNAME= smfsav PORTVERSION= 1.4.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= mail MASTER_SITES= SF/smfs DISTNAME= smf-sav-${PORTVERSION} @@ -25,18 +25,20 @@ USE_RC_SUBR= smfsav CPPFLAGS+= -D_REENTRANT LDFLAGS+= -lmilter -lpthread -SMFSAV_RUN_DIR?=/var/run/smfsav +SMFSAV_RUN_DIR?=/var/run/smfs SUB_FILES+= pkg-message post-patch: - @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/readme + @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/readme + @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/smf-sav.c + @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/smf-sav.conf do-build: cd ${WRKSRC} && ${CC} ${CFLAGS} ${CPPFLAGS} -o smf-sav smf-sav.c ${LDFLAGS} do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/smf-sav ${STAGEDIR}${PREFIX}/sbin/smfsav - ${INSTALL_DATA} ${WRKSRC}/smf-sav.conf ${STAGEDIR}${PREFIX}/etc/smfsav.conf.sample + ${INSTALL_PROGRAM} ${WRKSRC}/smf-sav ${STAGEDIR}${PREFIX}/sbin + ${INSTALL_DATA} ${WRKSRC}/smf-sav.conf ${STAGEDIR}${PREFIX}/etc/smf-sav.conf.sample @${MKDIR} ${STAGEDIR}${SMFSAV_RUN_DIR} @${MKDIR} ${STAGEDIR}${DOCSDIR} cd ${WRKSRC} && ${INSTALL_DATA} ChangeLog readme ${STAGEDIR}${DOCSDIR} diff --git a/mail/smfsav/files/patch-readme b/mail/smfsav/files/patch-readme index 9b25eef732d5..a315f10bea43 100644 --- a/mail/smfsav/files/patch-readme +++ b/mail/smfsav/files/patch-readme @@ -1,28 +1,17 @@ ---- readme.orig 2006-10-25 20:15:10 UTC -+++ readme -@@ -38,21 +38,18 @@ Under FreeBSD the BIND v8 is required (p +--- readme.orig 2006-10-26 05:15:10.000000000 +0900 ++++ readme 2015-06-02 13:24:39.167974000 +0900 +@@ -38,11 +38,11 @@ make make install - Inspect and edit the /etc/mail/smfs/smf-sav.conf file. -+ Inspect and edit the %%PREFIX%%/etc/smfsav.conf file. ++ Inspect and edit the %%PREFIX%%/etc/smf-sav.conf file. -/usr/local/sbin/smf-sav -+%%PREFIX%%/sbin/smfsav ++%%PREFIX%%/sbin/smf-sav or -/usr/local/sbin/smf-sav -c /etc/mail/smfs/smf-sav.conf -+%%PREFIX%%/sbin/smfsav -c %%PREFIX%%/etc/smfsav.conf ++%%PREFIX%%/sbin/smf-sav -c %%PREFIX%%/etc/smf-sav.conf Add this milter to start-up scripts before starting a Sendmail daemon. Look at the contributed samples of start-up scripts. - - Add these lines to your Sendmail configuration file (usually sendmail.mc): - define(`confMILTER_MACROS_HELO', confMILTER_MACROS_HELO`, {verify}')dnl --INPUT_MAIL_FILTER(`smf-sav', `S=unix:/var/run/smfs/smf-sav.sock, T=S:30s;R:4m')dnl -- --IMPORTANT: make sure that /var/run is not a group writable directory! If so, --or chmod 755 /var/run, or if it's impossible switch to another directory. -+INPUT_MAIL_FILTER(`smfsav', `S=unix:/var/run/smfsav/smfsav.sock, T=S:30s;R:4m')dnl - - IMPORTANT: make sure that libmilter is compiled with BROKEN_PTHREAD_SLEEP defined. - If this symbol is not defined, libmilter will use sleep() in signal-handler thread, diff --git a/mail/smfsav/files/patch-smf-sav.c b/mail/smfsav/files/patch-smf-sav.c index 0aca2ba525e0..d46bc2ec1026 100644 --- a/mail/smfsav/files/patch-smf-sav.c +++ b/mail/smfsav/files/patch-smf-sav.c @@ -1,5 +1,5 @@ ---- smf-sav.c.orig 2006-10-25 20:15:10 UTC -+++ smf-sav.c +--- smf-sav.c.orig 2006-10-26 05:15:10.000000000 +0900 ++++ smf-sav.c 2015-06-02 13:30:44.250725000 +0900 @@ -20,11 +20,7 @@ #endif @@ -38,20 +38,7 @@ #define hash_mask(x) (hash_size(x) - 1) -#define CONFIG_FILE "/etc/mail/smfs/smf-sav.conf" -+#define CONFIG_FILE "/usr/local/etc/smfsav.conf" ++#define CONFIG_FILE "%%PREFIX%%/etc/smf-sav.conf" #define PUBLIC_NAME "yourhost.yourdomain.tld" #define SAFE_CALLBACK "postmaster@yourdomain.tld" #define SYSLOG_FACILITY LOG_MAIL -@@ -81,9 +69,9 @@ - #define TO_PASS_TTL 3600 - #define TO_TEMPFAIL_TTL 300 - #define TO_FAIL_TTL 3600 --#define WORK_SPACE "/var/run/smfs" --#define OCONN "unix:" WORK_SPACE "/smf-sav.sock" --#define USER "smfs" -+#define WORK_SPACE "/var/run/smfsav" -+#define OCONN "unix:" WORK_SPACE "/smfsav.sock" -+#define USER "smfsav" - - #define DNS_RETRANS 7 - #define DNS_RETRY 4 diff --git a/mail/smfsav/files/patch-smf-sav.conf b/mail/smfsav/files/patch-smf-sav.conf index 7795ab461591..0cc95f38b6b2 100644 --- a/mail/smfsav/files/patch-smf-sav.conf +++ b/mail/smfsav/files/patch-smf-sav.conf @@ -1,28 +1,8 @@ ---- smf-sav.conf.orig 2006-10-25 20:15:10 UTC -+++ smf-sav.conf +--- smf-sav.conf.orig 2006-10-26 05:15:10.000000000 +0900 ++++ smf-sav.conf 2015-06-02 13:32:07.814150000 +0900 @@ -1,4 +1,4 @@ -# /etc/mail/smfs/smf-sav.conf -+# /usr/local/etc/smfsav.conf ++# %%PREFIX%%/etc/smf-sav.conf # # smf-sav configuration file v1.4.0 (it's read at start) # -@@ -97,15 +97,15 @@ SafeCallBack postmaster@yourdomain.tld # - - # Run as a selected user (smf-sav must be started by root) - # --# Default: smfs -+# Default: smfsav - # --#User smfs -+#User smfsav - - # Socket used to communicate with a Sendmail daemon - # --# Default: unix:/var/run/smfs/smf-sav.sock -+# Default: unix:/var/run/smfsav/smfsav.sock - # --#Socket unix:/var/run/smfs/smf-sav.sock -+#Socket unix:/var/run/smfsav/smfsav.sock - - # Facility for logging via a Syslog daemon - # diff --git a/mail/smfsav/files/pkg-message.in b/mail/smfsav/files/pkg-message.in index fb09e6b3bee6..7d32a9645343 100644 --- a/mail/smfsav/files/pkg-message.in +++ b/mail/smfsav/files/pkg-message.in @@ -3,7 +3,7 @@ 1. Inspect and edit the %%PREFIX%%/etc/smfsav.conf file 2. Add these lines to your Sendmail configuration file (usually sendmail.mc): define(`confMILTER_MACROS_HELO', confMILTER_MACROS_HELO`, {verify}')dnl - INPUT_MAIL_FILTER(`smfsav', `S=unix:/var/run/smfsav/smfsav.sock, T=S:30s;R:4m')dnl + INPUT_MAIL_FILTER(`smf-sav', `S=unix:/var/run/smfs/smf-sav.sock, T=S:30s;R:4m')dnl 3. Put line smfsav_enable="YES" to /etc/rc.conf file 4. Run `service smfsav start` ===================================================================================== diff --git a/mail/smfsav/files/smfsav.in b/mail/smfsav/files/smfsav.in index 3611ba7b9096..1d2da180a471 100644 --- a/mail/smfsav/files/smfsav.in +++ b/mail/smfsav/files/smfsav.in @@ -17,7 +17,11 @@ name="smfsav" rcvar=smfsav_enable -command="%%PREFIX%%/sbin/smfsav" load_rc_config ${name} + +required_files=${smfsav_config:="%%PREFIX%%/etc/smf-sav.conf"} +command="%%PREFIX%%/sbin/smf-sav" +command_args="-c ${required_files}" + run_rc_command "$1" diff --git a/mail/smfsav/pkg-plist b/mail/smfsav/pkg-plist index 570e129f7bae..8bbb2c456fd2 100644 --- a/mail/smfsav/pkg-plist +++ b/mail/smfsav/pkg-plist @@ -1,5 +1,5 @@ -sbin/smfsav -etc/smfsav.conf.sample +sbin/smf-sav +etc/smf-sav.conf.sample %%PORTDOCS%%%%DOCSDIR%%/ChangeLog %%PORTDOCS%%%%DOCSDIR%%/readme -@dir(smfs,smfs,700) /var/run/smfsav +@dir(smfs,smfs,700) /var/run/smfs |