Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Feb 2006 13:17:10 -0200
From:      Jean Milanez Melo <jmelo@freebsdbrasil.com.br>
To:        Marcus Alves Grando <mnag@FreeBSD.org>
Cc:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/93040: Update port: mail/smtpd fix mastersite
Message-ID:  <43F0A2F6.10802@freebsdbrasil.com.br>
In-Reply-To: <200602081905.k18J5kY2009950@freefall.freebsd.org>
References:  <200602081905.k18J5kY2009950@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------020008070806050600060202
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Marcus Alves Grando wrote:
> Synopsis: Update port: mail/smtpd fix mastersite
> 
> State-Changed-From-To: open->feedback
> State-Changed-By: mnag
> State-Changed-When: Wed Feb 8 19:02:40 UTC 2006
> State-Changed-Why: 
> => Attempting to fetch from http://web.rge.com/pub/mail/smtpd/.  fetch:
> http://web.rge.com/pub/mail/smtpd/patch-smtpd-2.0-RBL.gz: Operation
> timed out
> 
> Otherwise, in first MASTER_SITES does not exist this patch. Patch site
> only need in PATCH_SITES and not in MASTER_SITES.
> 
> Another good thing is use ${INSTALL} otherwise MKDIR/CHMOD/CHOWN
> 
> Thanks
> 
> 
> http://www.freebsd.org/cgi/query-pr.cgi?pr=93040

Let's do this port better ;)

Following the patch.

-- 
Atenciosamente
Jean Milanez Melo
FreeBSD Brasil LTDA.
Fone: (31) 3281-9633
http://www.freebsdbrasil.com.br

--------------020008070806050600060202
Content-Type: text/x-patch;
 name="smtpd.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="smtpd.diff"

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/mail/smtpd/Makefile,v
retrieving revision 1.20
diff -u -r1.20 Makefile
--- Makefile	29 Aug 2005 01:26:22 -0000	1.20
+++ Makefile	13 Feb 2006 15:11:54 -0000
@@ -7,29 +7,29 @@
 
 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=	http://web.rge.com/pub/mail/smtpd/
 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.sh
+SUB_FILES=	pkg-message
+SPOOLBASE?=	/var/smtpd
+PLIST_SUB+=	SPOOLBASE=${SPOOLBASE}
+SUB_LIST+=	SPOOLBASE=${SPOOLBASE}
+
+.include <bsd.port.pre.mk>
 
 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}
@@ -44,30 +44,15 @@
 	@${CHOWN} root:uucp ${SPOOLBASE}/etc
 	@${CHMOD} 0710 ${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	\
-		${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}/antirelay_check_rules_example \
+			${SPOOLBASE}/etc/antirelay_check_rules.example
+	@${INSTALL_DATA} ${WRKSRC}/antispam_check_rules.example ${SPOOLBASE}/etc
+	@${INSTALL_DATA} ${WRKSRC}/smtpd_check_rules.example ${SPOOLBASE}/etc
 	@${CAT} ${PKGMESSAGE}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: pkg-message
===================================================================
RCS file: pkg-message
diff -N pkg-message
--- pkg-message	1 Mar 1998 01:58:51 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-
-You must follow the next steps, as root, in order to finish the installation:
-
-1) Make sure uucp is a trusted user to sendmail.
-   To do this, check if your sendmail.cf has a line with "Tuucp"
-
-2) Disable sendmail from answering smtp requests, but make sure it
-   handles queue delivering.  You have two choices:
-
-   a) Start sendmail without the "-bd" flag, but with the "-q30m" one.
-   b) Do not start sendmail as a daemon, and add an entry in /etc/crontab
-      to run sendmail -q when needed.  For example, add the following line
-      to your /etc/crontab:
-*/30	*	*	*	*	root	/usr/sbin/sendmail -q
-
-   In any case, you'll most likely have to edit /etc/rc.conf to change
-   sendmail configuration.
-
-3) Add smtpd to your inetd.conf:
-	smtp stream tcp nowait root /usr/local/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
-   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
-   examples in that directory.  If have any problem, take a look at
-   http://www.obtuse.com/juniper-docs/man/smtpd_address_check.html.
-
-6) Reboot !   (Or restart all those daemons manually, if you know how :^) )
-
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/mail/smtpd/pkg-plist,v
retrieving revision 1.3
diff -u -r1.3 pkg-plist
--- pkg-plist	26 Jul 2001 06:26:19 -0000	1.3
+++ pkg-plist	13 Feb 2006 15:11:54 -0000
@@ -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"
Index: files/patch-aa
===================================================================
RCS file: /home/ncvs/ports/mail/smtpd/files/patch-aa,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 patch-aa
--- files/patch-aa	1 Mar 1998 01:58:52 -0000	1.1.1.1
+++ files/patch-aa	13 Feb 2006 15:11:54 -0000
@@ -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
Index: files/pkg-message.in
===================================================================
RCS file: files/pkg-message.in
diff -N files/pkg-message.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/pkg-message.in	13 Feb 2006 15:11:54 -0000
@@ -0,0 +1,33 @@
+
+You must follow the next steps, as root, in order to finish the installation:
+
+1) Make sure uucp is a trusted user to sendmail.
+   To do this, check if your sendmail.cf has a line with "Tuucp"
+
+2) Disable sendmail from answering smtp requests, but make sure it
+   handles queue delivering.  You have two choices:
+
+   a) Start sendmail without the "-bd" flag, but with the "-q30m" one.
+   b) Do not start sendmail as a daemon, and add an entry in /etc/crontab
+      to run sendmail -q when needed.  For example, add the following line
+      to your /etc/crontab:
+*/30	*	*	*	*	root	/usr/sbin/sendmail -q
+
+   In any case, you'll most likely have to edit /etc/rc.conf to change
+   sendmail configuration.
+
+3) Add smtpd to your inetd.conf:
+	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 %%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 %%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.
+
+6) Reboot !   (Or restart all those daemons manually, if you know how :^) )
+
Index: files/smtpd.sh
===================================================================
RCS file: files/smtpd.sh
diff -N files/smtpd.sh
--- files/smtpd.sh	3 Jul 1998 23:30:30 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -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
Index: files/smtpd.sh.in
===================================================================
RCS file: files/smtpd.sh.in
diff -N files/smtpd.sh.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/smtpd.sh.in	13 Feb 2006 15:11:54 -0000
@@ -0,0 +1,11 @@
+#! /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

--------------020008070806050600060202--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43F0A2F6.10802>