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.diff -r1.58 -r1.59 pkgsrc/mail/milter-greylist/Makefile
(tron)
@@ -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 | |||
3 | DISTNAME= milter-greylist-4.4.2 | 3 | DISTNAME= milter-greylist-4.4.2 | |
4 | PKGREVISION= 1 | |||
4 | CATEGORIES= mail | 5 | CATEGORIES= mail | |
5 | MASTER_SITES= ftp://ftp.espci.fr/pub/milter-greylist/ | 6 | MASTER_SITES= ftp://ftp.espci.fr/pub/milter-greylist/ | |
6 | EXTRACT_SUFX= .tgz | 7 | EXTRACT_SUFX= .tgz | |
7 | 8 | |||
8 | OWNER= tron@NetBSD.org | 9 | OWNER= tron@NetBSD.org | |
9 | HOMEPAGE= http://hcpnet.free.fr/milter-greylist/ | 10 | HOMEPAGE= http://hcpnet.free.fr/milter-greylist/ | |
10 | COMMENT= Easy-to-use greylist milter for Sendmail and Postfix | 11 | COMMENT= Easy-to-use greylist milter for Sendmail and Postfix | |
11 | LICENSE= original-bsd | 12 | LICENSE= original-bsd | |
12 | 13 | |||
13 | # yacc rule moving to y.tab.c and renaming | 14 | # yacc rule moving to y.tab.c and renaming | |
14 | MAKE_JOBS_SAFE= no | 15 | MAKE_JOBS_SAFE= no | |
15 | 16 | |||
16 | GNU_CONFIGURE= YES | 17 | GNU_CONFIGURE= YES | |
17 | BUILD_TARGET= milter-greylist | 18 | BUILD_TARGET= milter-greylist | |
18 | 19 | |||
19 | USE_TOOLS= bison lex | 20 | USE_TOOLS= bison lex | |
20 | 21 | |||
21 | RCD_SCRIPTS= milter-greylist | 22 | RCD_SCRIPTS= milter-greylist | |
22 | 23 | |||
23 | .include "options.mk" | 24 | .include "options.mk" | |
24 | 25 | |||
25 | CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q} | 26 | CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q} | |
27 | CONFIGURE_ARGS+= --with-conffile=${PKG_SYSCONFDIR:Q}/greylist.conf | |||
26 | CONFIGURE_ARGS+= --localstatedir=${VARBASE:Q} | 28 | CONFIGURE_ARGS+= --localstatedir=${VARBASE:Q} | |
27 | CONFIGURE_ARGS+= --with-user=${MILTER_USER} | 29 | CONFIGURE_ARGS+= --with-user=${MILTER_USER} | |
28 | BUILD_DEFS+= MILTER_USER MILTER_GROUP VARBASE | 30 | BUILD_DEFS+= MILTER_USER MILTER_GROUP VARBASE | |
29 | FILES_SUBST+= MILTER_USER=${MILTER_USER:Q} | 31 | FILES_SUBST+= MILTER_USER=${MILTER_USER:Q} | |
30 | FILES_SUBST+= MILTER_GROUP=${MILTER_GROUP:Q} | 32 | FILES_SUBST+= MILTER_GROUP=${MILTER_GROUP:Q} | |
31 | 33 | |||
32 | INSTALLATION_DIRS+= share/doc/milter-greylist | 34 | INSTALLATION_DIRS+= share/doc/milter-greylist | |
33 | INSTALLATION_DIRS+= share/examples/milter-greylist | 35 | INSTALLATION_DIRS+= share/examples/milter-greylist | |
34 | 36 | |||
35 | OWN_DIRS_PERMS+= ${VARBASE}/milter-greylist ${MILTER_USER} ${MILTER_GROUP} 0755 | 37 | OWN_DIRS_PERMS+= ${VARBASE}/milter-greylist ${MILTER_USER} ${MILTER_GROUP} 0755 | |
36 | 38 | |||
39 | SUBST_CLASSES+= paths | |||
40 | SUBST_STAGE.paths= pre-configure | |||
41 | SUBST_FILES.paths= greylist.conf greylist2.conf | |||
42 | SUBST_SED.paths+= -e "s|/var/run|${VARBASE}/run|g" | |||
43 | SUBST_SED.paths+= -e "s|/var/milter-greylist|${VARBASE}/milter-greylist|g" | |||
44 | SUBST_MESSAGE.paths= Fixing paths in conf examples. | |||
45 | ||||
46 | EGDIR= ${PREFIX}/share/examples/milter-greylist | |||
47 | CONF_FILES= ${EGDIR}/greylist.conf ${PKG_SYSCONFDIR}/greylist.conf | |||
48 | ||||
49 | ||||
37 | post-install: | 50 | post-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" |
@@ -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 $ | |
2 | bin/milter-greylist | 2 | bin/milter-greylist | |
3 | man/man8/milter-greylist.8 | 3 | man/man8/milter-greylist.8 | |
4 | man/man5/greylist.conf.5 | 4 | man/man5/greylist.conf.5 | |
5 | share/doc/milter-greylist/README | 5 | share/doc/milter-greylist/README | |
6 | share/examples/milter-greylist/greylist.conf | 6 | share/examples/milter-greylist/greylist.conf | |
7 | share/examples/milter-greylist/greylist2.conf | |||
7 | share/examples/rc.d/milter-greylist | 8 | share/examples/rc.d/milter-greylist |
@@ -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 | |||
3 | SHA1 (milter-greylist-4.4.2.tgz) = a87468a3ab7a9cbb051f88e043cd1f244b6a1351 | 3 | SHA1 (milter-greylist-4.4.2.tgz) = a87468a3ab7a9cbb051f88e043cd1f244b6a1351 | |
4 | RMD160 (milter-greylist-4.4.2.tgz) = 077ab452c8bb007c9f52e80be8db3475a83af410 | 4 | RMD160 (milter-greylist-4.4.2.tgz) = 077ab452c8bb007c9f52e80be8db3475a83af410 | |
5 | Size (milter-greylist-4.4.2.tgz) = 230544 bytes | 5 | Size (milter-greylist-4.4.2.tgz) = 230544 bytes | |
6 | SHA1 (patch-aa) = c42757814933001ddbcdfb77dd03e17a9c4c8283 | 6 | SHA1 (patch-aa) = c42757814933001ddbcdfb77dd03e17a9c4c8283 | |
7 | SHA1 (patch-p0f.c) = 512055976836662e2c39362fc17766db0ae1a7b0 | |||
8 | SHA1 (patch-spamd.c) = 5249c4061460cc7b1f9e2d25df0a50f6f628c728 |
@@ -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 | |||
10 | name="miltergreylist" | 10 | name="miltergreylist" | |
11 | rcvar="miltergreylist" | 11 | rcvar="miltergreylist" | |
12 | command="@PREFIX@/bin/milter-greylist" | 12 | command="@PREFIX@/bin/milter-greylist" | |
13 | command_args="-p /var/milter-greylist/milter-greylist.sock -u @MILTER_USER@" | 13 | command_args="-p @VARBASE@/milter-greylist/milter-greylist.sock -u @MILTER_USER@" | |
14 | 14 | |||
15 | if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then | 15 | if [ -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 | |||
22 | else # old NetBSD, Solaris, Linux, etc... | 22 | else # 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 |
$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 */
$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;