Fri Jan 11 13:23:18 2013 UTC ()
Improvements contributed by Richard Palo in PR pkg/pkg/47420:
- Build fixes for Solaris 11 (using GCC 4.7)
- Install example for new config file format
- Replace hard-coded path to state directory in various files.


(tron)
diff -r1.58 -r1.59 pkgsrc/mail/milter-greylist/Makefile
diff -r1.7 -r1.8 pkgsrc/mail/milter-greylist/PLIST
diff -r1.35 -r1.36 pkgsrc/mail/milter-greylist/distinfo
diff -r1.6 -r1.7 pkgsrc/mail/milter-greylist/files/milter-greylist.sh
diff -r0 -r1.4 pkgsrc/mail/milter-greylist/patches/patch-p0f.c
diff -r0 -r1.4 pkgsrc/mail/milter-greylist/patches/patch-spamd.c

cvs diff -r1.58 -r1.59 pkgsrc/mail/milter-greylist/Makefile (expand / switch to unified diff)

--- pkgsrc/mail/milter-greylist/Makefile 2013/01/08 15:54:54 1.58
+++ pkgsrc/mail/milter-greylist/Makefile 2013/01/11 13:23:17 1.59
@@ -1,45 +1,60 @@ @@ -1,45 +1,60 @@
1# $NetBSD: Makefile,v 1.58 2013/01/08 15:54:54 tron Exp $ 1# $NetBSD: Makefile,v 1.59 2013/01/11 13:23:17 tron Exp $
2 2
3DISTNAME= milter-greylist-4.4.2 3DISTNAME= milter-greylist-4.4.2
 4PKGREVISION= 1
4CATEGORIES= mail 5CATEGORIES= mail
5MASTER_SITES= ftp://ftp.espci.fr/pub/milter-greylist/ 6MASTER_SITES= ftp://ftp.espci.fr/pub/milter-greylist/
6EXTRACT_SUFX= .tgz 7EXTRACT_SUFX= .tgz
7 8
8OWNER= tron@NetBSD.org 9OWNER= tron@NetBSD.org
9HOMEPAGE= http://hcpnet.free.fr/milter-greylist/ 10HOMEPAGE= http://hcpnet.free.fr/milter-greylist/
10COMMENT= Easy-to-use greylist milter for Sendmail and Postfix 11COMMENT= Easy-to-use greylist milter for Sendmail and Postfix
11LICENSE= original-bsd 12LICENSE= original-bsd
12 13
13# yacc rule moving to y.tab.c and renaming 14# yacc rule moving to y.tab.c and renaming
14MAKE_JOBS_SAFE= no 15MAKE_JOBS_SAFE= no
15 16
16GNU_CONFIGURE= YES 17GNU_CONFIGURE= YES
17BUILD_TARGET= milter-greylist 18BUILD_TARGET= milter-greylist
18 19
19USE_TOOLS= bison lex 20USE_TOOLS= bison lex
20 21
21RCD_SCRIPTS= milter-greylist 22RCD_SCRIPTS= milter-greylist
22 23
23.include "options.mk" 24.include "options.mk"
24 25
25CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q} 26CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}
 27CONFIGURE_ARGS+= --with-conffile=${PKG_SYSCONFDIR:Q}/greylist.conf
26CONFIGURE_ARGS+= --localstatedir=${VARBASE:Q} 28CONFIGURE_ARGS+= --localstatedir=${VARBASE:Q}
27CONFIGURE_ARGS+= --with-user=${MILTER_USER} 29CONFIGURE_ARGS+= --with-user=${MILTER_USER}
28BUILD_DEFS+= MILTER_USER MILTER_GROUP VARBASE 30BUILD_DEFS+= MILTER_USER MILTER_GROUP VARBASE
29FILES_SUBST+= MILTER_USER=${MILTER_USER:Q} 31FILES_SUBST+= MILTER_USER=${MILTER_USER:Q}
30FILES_SUBST+= MILTER_GROUP=${MILTER_GROUP:Q} 32FILES_SUBST+= MILTER_GROUP=${MILTER_GROUP:Q}
31 33
32INSTALLATION_DIRS+= share/doc/milter-greylist 34INSTALLATION_DIRS+= share/doc/milter-greylist
33INSTALLATION_DIRS+= share/examples/milter-greylist 35INSTALLATION_DIRS+= share/examples/milter-greylist
34 36
35OWN_DIRS_PERMS+= ${VARBASE}/milter-greylist ${MILTER_USER} ${MILTER_GROUP} 0755 37OWN_DIRS_PERMS+= ${VARBASE}/milter-greylist ${MILTER_USER} ${MILTER_GROUP} 0755
36 38
 39SUBST_CLASSES+= paths
 40SUBST_STAGE.paths= pre-configure
 41SUBST_FILES.paths= greylist.conf greylist2.conf
 42SUBST_SED.paths+= -e "s|/var/run|${VARBASE}/run|g"
 43SUBST_SED.paths+= -e "s|/var/milter-greylist|${VARBASE}/milter-greylist|g"
 44SUBST_MESSAGE.paths= Fixing paths in conf examples.
 45
 46EGDIR= ${PREFIX}/share/examples/milter-greylist
 47CONF_FILES= ${EGDIR}/greylist.conf ${PKG_SYSCONFDIR}/greylist.conf
 48
 49
37post-install: 50post-install:
38 ${INSTALL_DATA} ${WRKSRC}/README \ 51 ${INSTALL_DATA} ${WRKSRC}/README \
39 ${DESTDIR}${PREFIX}/share/doc/milter-greylist 52 ${DESTDIR}${PREFIX}/share/doc/milter-greylist
40 ${INSTALL_DATA} ${WRKSRC}/greylist.conf \ 53 ${INSTALL_DATA} ${WRKSRC}/greylist.conf \
41 ${DESTDIR}${PREFIX}/share/examples/milter-greylist 54 ${DESTDIR}${PREFIX}/share/examples/milter-greylist
 55 ${INSTALL_DATA} ${WRKSRC}/greylist2.conf \
 56 ${DESTDIR}${PREFIX}/share/examples/milter-greylist
42 57
43.include "../../mail/libmilter/buildlink3.mk" 58.include "../../mail/libmilter/buildlink3.mk"
44.include "../../mk/pthread.buildlink3.mk" 59.include "../../mk/pthread.buildlink3.mk"
45.include "../../mk/bsd.pkg.mk" 60.include "../../mk/bsd.pkg.mk"

cvs diff -r1.7 -r1.8 pkgsrc/mail/milter-greylist/PLIST (expand / switch to unified diff)

--- pkgsrc/mail/milter-greylist/PLIST 2009/06/14 18:04:38 1.7
+++ pkgsrc/mail/milter-greylist/PLIST 2013/01/11 13:23:17 1.8
@@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
1@comment $NetBSD: PLIST,v 1.7 2009/06/14 18:04:38 joerg Exp $ 1@comment $NetBSD: PLIST,v 1.8 2013/01/11 13:23:17 tron Exp $
2bin/milter-greylist 2bin/milter-greylist
3man/man8/milter-greylist.8 3man/man8/milter-greylist.8
4man/man5/greylist.conf.5 4man/man5/greylist.conf.5
5share/doc/milter-greylist/README 5share/doc/milter-greylist/README
6share/examples/milter-greylist/greylist.conf 6share/examples/milter-greylist/greylist.conf
 7share/examples/milter-greylist/greylist2.conf
7share/examples/rc.d/milter-greylist 8share/examples/rc.d/milter-greylist

cvs diff -r1.35 -r1.36 pkgsrc/mail/milter-greylist/distinfo (expand / switch to unified diff)

--- pkgsrc/mail/milter-greylist/distinfo 2013/01/08 15:54:54 1.35
+++ pkgsrc/mail/milter-greylist/distinfo 2013/01/11 13:23:17 1.36
@@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
1$NetBSD: distinfo,v 1.35 2013/01/08 15:54:54 tron Exp $ 1$NetBSD: distinfo,v 1.36 2013/01/11 13:23:17 tron Exp $
2 2
3SHA1 (milter-greylist-4.4.2.tgz) = a87468a3ab7a9cbb051f88e043cd1f244b6a1351 3SHA1 (milter-greylist-4.4.2.tgz) = a87468a3ab7a9cbb051f88e043cd1f244b6a1351
4RMD160 (milter-greylist-4.4.2.tgz) = 077ab452c8bb007c9f52e80be8db3475a83af410 4RMD160 (milter-greylist-4.4.2.tgz) = 077ab452c8bb007c9f52e80be8db3475a83af410
5Size (milter-greylist-4.4.2.tgz) = 230544 bytes 5Size (milter-greylist-4.4.2.tgz) = 230544 bytes
6SHA1 (patch-aa) = c42757814933001ddbcdfb77dd03e17a9c4c8283 6SHA1 (patch-aa) = c42757814933001ddbcdfb77dd03e17a9c4c8283
 7SHA1 (patch-p0f.c) = 512055976836662e2c39362fc17766db0ae1a7b0
 8SHA1 (patch-spamd.c) = 5249c4061460cc7b1f9e2d25df0a50f6f628c728

cvs diff -r1.6 -r1.7 pkgsrc/mail/milter-greylist/files/milter-greylist.sh (expand / switch to unified diff)

--- pkgsrc/mail/milter-greylist/files/milter-greylist.sh 2009/09/22 15:57:50 1.6
+++ pkgsrc/mail/milter-greylist/files/milter-greylist.sh 2013/01/11 13:23:17 1.7
@@ -1,36 +1,36 @@ @@ -1,36 +1,36 @@
1#!@RCD_SCRIPTS_SHELL@ 1#!@RCD_SCRIPTS_SHELL@
2# 2#
3# $NetBSD: milter-greylist.sh,v 1.6 2009/09/22 15:57:50 tron Exp $ 3# $NetBSD: milter-greylist.sh,v 1.7 2013/01/11 13:23:17 tron Exp $
4# 4#
5 5
6# PROVIDE: milter-greylist 6# PROVIDE: milter-greylist
7# REQUIRE: DAEMON 7# REQUIRE: DAEMON
8# BEFORE: mail 8# BEFORE: mail
9 9
10name="miltergreylist" 10name="miltergreylist"
11rcvar="miltergreylist" 11rcvar="miltergreylist"
12command="@PREFIX@/bin/milter-greylist" 12command="@PREFIX@/bin/milter-greylist"
13command_args="-p /var/milter-greylist/milter-greylist.sock -u @MILTER_USER@" 13command_args="-p @VARBASE@/milter-greylist/milter-greylist.sock -u @MILTER_USER@"
14 14
15if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then 15if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
16 . /etc/rc.subr 16 . /etc/rc.subr
17 . /etc/rc.conf 17 . /etc/rc.conf
18 18
19 load_rc_config $name 19 load_rc_config $name
20 run_rc_command "$1" 20 run_rc_command "$1"
21 21
22else # old NetBSD, Solaris, Linux, etc... 22else # old NetBSD, Solaris, Linux, etc...
23 pidfile=/var/run/${name}.pid 23 pidfile=@VARBASE@/run/${name}.pid
24 24
25 case $1 in 25 case $1 in
26 start) 26 start)
27 nohup ${command} -D ${command_args} </dev/null >/dev/null 1>&2 & 27 nohup ${command} -D ${command_args} </dev/null >/dev/null 1>&2 &
28 echo $! >${pidfile} 28 echo $! >${pidfile}
29  29
30 ;; 30 ;;
31 stop) 31 stop)
32 if [ -f ${pidfile} ] 32 if [ -f ${pidfile} ]
33 then 33 then
34 kill `cat ${pidfile}` 34 kill `cat ${pidfile}`
35 rm -f ${pidfile} 35 rm -f ${pidfile}
36 fi 36 fi

File Added: pkgsrc/mail/milter-greylist/patches/patch-p0f.c
$NetBSD: patch-p0f.c,v 1.4 2013/01/11 13:23:17 tron Exp $

Build fix for Solaris 11.

--- p0f.c.orig	2013-01-08 14:30:01.000000000 +0000
+++ p0f.c
@@ -116,25 +116,25 @@ strcasestr ( haystack, needle )
 #define RESP_NOMATCH		2
 
 struct p0f_query {
-	u_int32_t	magic;
-	u_int8_t	type;
-	u_int32_t	id;
-	u_int32_t	src_ad,dst_ad;
-	u_int16_t	src_port,dst_port;
+	uint32_t	magic;
+	uint8_t	type;
+	uint32_t	id;
+	uint32_t	src_ad,dst_ad;
+	uint16_t	src_port,dst_port;
 };
 struct p0f_response {
-	u_int32_t	magic;
-	u_int32_t	id;
-	u_int8_t 	type;
-	u_int8_t	genre[20];
-	u_int8_t	detail[40];
+	uint32_t	magic;
+	uint32_t	id;
+	uint8_t 	type;
+	uint8_t	genre[20];
+	uint8_t	detail[40];
 	int8_t		dist;
-	u_int8_t	link[30];
-	u_int8_t	tos[30];
-	u_int8_t	fw,nat;
-	u_int8_t	real;
+	uint8_t	link[30];
+	uint8_t	tos[30];
+	uint8_t	fw,nat;
+	uint8_t	real;
 	int16_t		score;
-	u_int16_t	mflags;
+	uint16_t	mflags;
 	int32_t		uptime;
 };
 /* End of stuff borrowed from p0f/p0f-query.h */

File Added: pkgsrc/mail/milter-greylist/patches/patch-spamd.c
$NetBSD: patch-spamd.c,v 1.4 2013/01/11 13:23:17 tron Exp $

Fix build under Solaris 11.

--- spamd.c.orig	2013-01-08 14:30:01.000000000 +0000
+++ spamd.c	2013-01-11 13:07:04.000000000 +0000
@@ -55,7 +55,11 @@
 #include "spf.h"
 #include "acl.h"
 #include "conf.h"
+#ifdef HAVE_OLD_QUEUE_H
 #include "queue.h"
+#else 
+#include <sys/queue.h>
+#endif
 #include "milter-greylist.h"
 
 #include "spamd.h"
@@ -439,7 +443,7 @@
 	struct sockaddr_un s_un;
 	int sock;
 	
-	bzero(&s_un, sizeof(s_un));
+	(void)memset(&s_un, 0, sizeof(s_un));
 	s_un.sun_family = AF_UNIX;
 	strncpy(s_un.sun_path, path, sizeof(s_un.sun_path) - 1);
 
@@ -468,7 +472,7 @@
 	int e;
 	int sock = -1;
 
-	bzero(&hints, sizeof(hints));
+	(void)memset(&hints, 0, sizeof(hints));
 	hints.ai_socktype = SOCK_STREAM;
 #ifdef AI_ADDRCONFIG
 	hints.ai_flags = AI_ADDRCONFIG;