aboutsummaryrefslogtreecommitdiffstats
path: root/mail/smtpd
diff options
context:
space:
mode:
authormnag <mnag@FreeBSD.org>2006-02-20 07:07:01 +0800
committermnag <mnag@FreeBSD.org>2006-02-20 07:07:01 +0800
commit202b658a3100da26a113c5712a9a72a29d484cb7 (patch)
tree2c1baf95e79577562f3e4c9edf86016ec0a0c3ea /mail/smtpd
parent29766297abb6fe1bd8a5d7d4a0cebd8726492a50 (diff)
downloadfreebsd-ports-graphics-202b658a3100da26a113c5712a9a72a29d484cb7.tar.gz
freebsd-ports-graphics-202b658a3100da26a113c5712a9a72a29d484cb7.tar.zst
freebsd-ports-graphics-202b658a3100da26a113c5712a9a72a29d484cb7.zip
- Turn patch fetchable again
- Reorganize Makefile - portlint(1) - Use new style of rc.d script - Bump PORTREVISION PR: 93040 Submitted by: Jean Milanez Melo <jmelo@freebsdbrasil.com.br>
Diffstat (limited to 'mail/smtpd')
-rw-r--r--mail/smtpd/Makefile67
-rw-r--r--mail/smtpd/files/patch-aa2
-rw-r--r--mail/smtpd/files/pkg-message.in (renamed from mail/smtpd/pkg-message)8
-rw-r--r--mail/smtpd/files/smtpd.in25
-rw-r--r--mail/smtpd/files/smtpd.sh11
-rw-r--r--mail/smtpd/pkg-plist21
6 files changed, 57 insertions, 77 deletions
diff --git a/mail/smtpd/Makefile b/mail/smtpd/Makefile
index 82030cff24a..1e6b32a00d3 100644
--- a/mail/smtpd/Makefile
+++ b/mail/smtpd/Makefile
@@ -7,67 +7,42 @@
PORTNAME= smtpd
PORTVERSION= 2.0
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= mail security
-MASTER_SITES= http://www.netsw.org/net/ip/firewall/proxy/smtpd/ \
- ftp://ftp.obtuse.com/pub/smtpd/
+MASTER_SITES= http://www.netsw.org/net/ip/firewall/proxy/smtpd/
-PATCH_SITES= ${MASTER_SITES}
+PATCH_SITES= ftp://ftp.42.org/pub/OLD/p/ \
+ ftp://ftp.cdpa.nsysu.edu.tw/BSD/NetBSD/packages/distfiles/
PATCHFILES= patch-smtpd-2.0-RBL.gz
MAINTAINER= ports@FreeBSD.org
COMMENT= Obtuse smtpd/smtpfwdd, part of the Juniper firewall toolkit
-# Directory where smtpd will chroot to, and put the received mail
-# If you change it here, change also patches/patch-aa
-SPOOLBASE= /var/smtpd
-
-post-patch:
- @${MV} ${WRKSRC}/Makefile ${WRKSRC}/Makefile.tmp
- @${SED} s+!!SPOOLBASE!!+${SPOOLBASE}+g < ${WRKSRC}/Makefile.tmp \
- > ${WRKSRC}/Makefile
+USE_RC_SUBR= smtpd
+SUB_FILES= pkg-message
+SPOOLBASE?= /var/smtpd
+PLIST_SUB+= SPOOLBASE=${SPOOLBASE}
+SUB_LIST+= SPOOLBASE=${SPOOLBASE}
post-install:
- @${MKDIR} ${PREFIX}/share/doc/smtpd
- @${INSTALL_MAN} ${WRKSRC}/README ${PREFIX}/share/doc/smtpd
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+ @${INSTALL_MAN} ${WRKSRC}/README ${DOCSDIR}
+.endif
@${ECHO_CMD} "Creating spool directories..."
- @${MKDIR} ${SPOOLBASE}
- @${CHOWN} root:uucp ${SPOOLBASE}
- @${CHMOD} 0710 ${SPOOLBASE}
-
- @${MKDIR} ${SPOOLBASE}/mqueue
- @${CHOWN} uucp:uucp ${SPOOLBASE}/mqueue
- @${CHMOD} 0700 ${SPOOLBASE}/mqueue
-
- @${MKDIR} ${SPOOLBASE}/etc
- @${CHOWN} root:uucp ${SPOOLBASE}/etc
- @${CHMOD} 0710 ${SPOOLBASE}/etc
+ @${INSTALL} -d -o root -g uucp -m 710 ${SPOOLBASE}
+ @${INSTALL} -d -o uucp -g uucp -m 700 ${SPOOLBASE}/mqueue
+ @${INSTALL} -d -o root -g uucp -m 710 ${SPOOLBASE}/etc
.if !defined(BATCH)
- @${CP} -p /etc/resolv.conf ${SPOOLBASE}/etc
- @${CP} -p /etc/localtime ${SPOOLBASE}/etc
+ @${INSTALL_DATA} /etc/resolv.conf ${SPOOLBASE}/etc
+ @${INSTALL_DATA} /etc/localtime ${SPOOLBASE}/etc
.endif
-
@${ECHO_CMD} "Copying examples..."
- @${INSTALL} ${COPY} -g uucp -o root -m 0640 \
- ${WRKSRC}/antirelay_check_rules_example \
+ @${INSTALL_DATA} ${WRKSRC}/antirelay_check_rules_example \
${SPOOLBASE}/etc/antirelay_check_rules.example
- @${INSTALL} ${COPY} -g uucp -o root -m 0640 \
- ${WRKSRC}/antispam_check_rules.example \
- ${SPOOLBASE}/etc
- @${INSTALL} ${COPY} -g uucp -o root -m 0640 \
- ${WRKSRC}/smtpd_check_rules.example \
- ${SPOOLBASE}/etc
-
- @${ECHO_CMD} "Creating startup file..."
- @${SED} s+!!PREFIX!!+${PREFIX}+ \
- < ${FILESDIR}/smtpd.sh \
- > ${PREFIX}/etc/rc.d/smtpd.sh
- @${CHMOD} 0700 ${PREFIX}/etc/rc.d/smtpd.sh
- @${CHOWN} 0:0 ${PREFIX}/etc/rc.d/smtpd.sh
-
- @${ECHO_CMD} "Done!"
-
+ @${INSTALL_DATA} ${WRKSRC}/antispam_check_rules.example ${SPOOLBASE}/etc
+ @${INSTALL_DATA} ${WRKSRC}/smtpd_check_rules.example ${SPOOLBASE}/etc
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/mail/smtpd/files/patch-aa b/mail/smtpd/files/patch-aa
index f12359a1b45..4c94abe0551 100644
--- a/mail/smtpd/files/patch-aa
+++ b/mail/smtpd/files/patch-aa
@@ -14,7 +14,7 @@
#
# The chroot directory
-SPOOLDIR = /usr/spool/smtpd
-+SPOOLDIR = !!SPOOLBASE!!
++SPOOLDIR = ${SPOOLBASE}
# Where to store messages, relative to SPOOLDIR above.
-SPOOLSUBDIR = .
+SPOOLSUBDIR = mqueue
diff --git a/mail/smtpd/pkg-message b/mail/smtpd/files/pkg-message.in
index c993abfb778..ae3b6147bbd 100644
--- a/mail/smtpd/pkg-message
+++ b/mail/smtpd/files/pkg-message.in
@@ -1,3 +1,5 @@
+To enable smtpfwdd via rc.d script please add smtpd_enable="YES"
+in your rc.conf.
You must follow the next steps, as root, in order to finish the installation:
@@ -17,15 +19,15 @@ You must follow the next steps, as root, in order to finish the installation:
sendmail configuration.
3) Add smtpd to your inetd.conf:
- smtp stream tcp nowait root /usr/local/sbin/smtpd smtpd
+ smtp stream tcp nowait root %%PREFIX%%/sbin/smtpd smtpd
4) smtpd runs in a chrooted environment, so you must feed this environment
with any configuration file it needs. Make a copy of /etc/resolv.conf
- and /etc/localtime to /var/smtpd/etc. If you ever change any of these
+ and /etc/localtime to %%SPOOLBASE%%/etc. If you ever change any of these
files, remember to change the copies also. Do not make a symbolic
link, as it will not work in the chrooted environment.
-5) Create your own /var/smtpd/etc/smtpd_check_rules. There are some
+5) Create your own %%SPOOLBASE%%/etc/smtpd_check_rules. There are some
examples in that directory. If have any problem, take a look at
http://www.obtuse.com/juniper-docs/man/smtpd_address_check.html.
diff --git a/mail/smtpd/files/smtpd.in b/mail/smtpd/files/smtpd.in
new file mode 100644
index 00000000000..93b2a5595d9
--- /dev/null
+++ b/mail/smtpd/files/smtpd.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: smtpd
+# REQUIRE: DAEMON
+#
+# Add the following lines to /etc/rc.conf to run smtpd:
+#
+# smtpd_enable (bool): Set it to "YES" to enable smtpd.
+# Default is "NO".
+#
+
+. %%RC_SUBR%%
+
+name="smtpd"
+rcvar=${name}_enable
+
+command=%%PREFIX%%/sbin/smtpfwdd
+
+load_rc_config ${name}
+
+: ${smtpd_enable="NO"}
+
+run_rc_command "$1"
diff --git a/mail/smtpd/files/smtpd.sh b/mail/smtpd/files/smtpd.sh
deleted file mode 100644
index 3aaf433a31d..00000000000
--- a/mail/smtpd/files/smtpd.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#! /bin/sh
-
-if [ $# -eq 0 -o "$1" = "start" ]; then
- if [ -x !!PREFIX!!/sbin/smtpfwdd ] ; then
- !!PREFIX!!/sbin/smtpfwdd
- echo -n " smtpfwdd"
- fi
-fi
-if [ "$1" = "stop" ]; then
- killall smtpfwdd
-fi
diff --git a/mail/smtpd/pkg-plist b/mail/smtpd/pkg-plist
index c35052e5495..6fedc083493 100644
--- a/mail/smtpd/pkg-plist
+++ b/mail/smtpd/pkg-plist
@@ -1,21 +1,10 @@
sbin/smtpd
sbin/smtpfwdd
-etc/rc.d/smtpd.sh
-share/doc/smtpd/README
-@dirrm share/doc/smtpd
-@exec mkdir /var/smtpd
-@exec chown root:uucp /var/smtpd
-@exec chmod 0710 /var/smtpd
-@cwd /var/smtpd
-@exec mkdir mqueue
-@exec chown uucp:uucp mqueue
-@exec chmod 0700 mqueue
-@exec mkdir etc
-@exec chown root:uucp etc
-@exec chmod 0710 etc
-@exec cp -p /etc/resolv.conf etc
-@exec cp -p /etc/localtime etc
+%%DOCSDIR%%/README
+@dirrm %%DOCSDIR%%
+@cwd %%SPOOLBASE%%
etc/antirelay_check_rules.example
etc/antispam_check_rules.example
etc/smtpd_check_rules.example
-@unexec echo "You may want to remove /var/smtpd manually"
+@dirrmtry mqueue
+@unexec echo "You may want to remove %%SPOOLBASE%% manually"