View | Details | Raw Unified | Return to bug 246925 | Differences between
and this patch

Collapse All | Expand All

(-)miniupnpd/Makefile (-13 / +30 lines)
Lines 2-8 Link Here
2
# $FreeBSD: head/net/miniupnpd/Makefile 520227 2019-12-16 08:13:39Z pi $
2
# $FreeBSD: head/net/miniupnpd/Makefile 520227 2019-12-16 08:13:39Z pi $
3
3
4
PORTNAME=	miniupnpd
4
PORTNAME=	miniupnpd
5
PORTVERSION=	2.1.20190210
5
PORTVERSION=	2.1.20200510
6
PORTEPOCH=	1
6
PORTEPOCH=	1
7
CATEGORIES=	net
7
CATEGORIES=	net
8
MASTER_SITES=	http://miniupnp.tuxfamily.org/files/ \
8
MASTER_SITES=	http://miniupnp.tuxfamily.org/files/ \
Lines 14-19 Link Here
14
LICENSE=	BSD3CLAUSE
14
LICENSE=	BSD3CLAUSE
15
15
16
USES=		cpe ssl
16
USES=		cpe ssl
17
HAS_CONFIGURE=  yes
17
CPE_VENDOR=	miniupnp_project
18
CPE_VENDOR=	miniupnp_project
18
PLIST_FILES=	etc/miniupnpd.conf.sample sbin/miniupnpd \
19
PLIST_FILES=	etc/miniupnpd.conf.sample sbin/miniupnpd \
19
		man/man8/miniupnpd.8.gz
20
		man/man8/miniupnpd.8.gz
Lines 23-50 Link Here
23
CFLAGS+=	-I${OPENSSLINC}
24
CFLAGS+=	-I${OPENSSLINC}
24
LDFLAGS+=	-L${OPENSSLLIB}
25
LDFLAGS+=	-L${OPENSSLLIB}
25
26
26
OPTIONS_DEFINE=	PF_FILTER_RULES CHECK_PORTINUSE IPV6 UPNP_IGDV2 UPNP_STRICT LEASEFILE
27
OPTIONS_DEFINE=	CHECK_PORTINUSE IPV6 UPNP_IGDV2 UPNP_STRICT LEASEFILE
27
PF_FILTER_RULES_DESC=	Enable pf generation of filter rules
28
OPTIONS_DEFAULT=	AUTODETECT_FW
29
OPTIONS_SINGLE=		FIREWALL
30
OPTIONS_SINGLE_FIREWALL=	AUTODETECT_FW PF IPFW
31
AUTODETECT_FW_DESC=	Try to autodetect firewall type
32
PF_DESC=	Use PF as firewall type
33
IPFW_DESC=	Use IPFW as firewall type
28
CHECK_PORTINUSE_DESC=	Check if ports are in use
34
CHECK_PORTINUSE_DESC=	Check if ports are in use
29
UPNP_IGDV2_DESC=	Build an IGDv2 instead of an IGDv1
35
UPNP_IGDV2_DESC=	Build an IGDv2 instead of an IGDv1
30
UPNP_STRICT_DESC=	More strict UPnP specification compliance
36
UPNP_STRICT_DESC=	More strict UPnP specification compliance
31
LEASEFILE_DESC=	Enable lease file
37
LEASEFILE_DESC=	Enable lease file
32
38
33
PF_FILTER_RULES_EXTRA_PATCHES=	${PATCHDIR}/pf_enable_filter_rules.patch
34
CHECK_PORTINUSE_EXTRA_PATCHES=	${PATCHDIR}/enable_check_portinuse.patch
35
IPV6_EXTRA_PATCHES=	${PATCHDIR}/enable_ipv6.patch
36
UPNP_IGDV2_EXTRA_PATCHES=	${PATCHDIR}/enable_igdv2.patch
37
UPNP_STRICT_EXTRA_PATCHES=	${PATCHDIR}/enable_upnp_strict.patch
38
LEASEFILE_EXTRA_PATCHES=	${PATCHDIR}/enable_leasefile.patch
39
40
.include <bsd.port.options.mk>
39
.include <bsd.port.options.mk>
41
40
42
.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200000
41
.if ${PORT_OPTIONS:MPF}
43
EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-portinuse.c
42
CONFIGURE_ARGS+=	--firewall=pf
44
.endif
43
.endif
44
#if ${PORT_OPTIONS:MIPFW}
45
#CONFIGURE_ARGS+=	--firewall=ipfw
46
#.endif
47
.if ${PORT_OPTIONS:MCHECK_PORTINUSE}
48
CONFIGURE_ARGS+=	--portinuse
49
.endif
50
.if ${PORT_OPTIONS:MIPV6}
51
CONFIGURE_ARGS+=	--ipv6
52
.endif
53
.if ${PORT_OPTIONS:MUPNP_IGDV2}
54
CONFIGURE_ARGS+=	--igd2
55
.endif
56
.if ${PORT_OPTIONS:MUPNP_STRICT}
57
CONFIGURE_ARGS+=	--strict
58
.endif
59
.if ${PORT_OPTIONS:MLEASEFILE}
60
CONFIGURE_ARGS+=	--leasefile
61
.endif
45
62
46
post-patch:
63
post-patch:
47
	${REINPLACE_CMD} -e 's|\(-lssl -lcrypto\)|$$(LDFLAGS) \1|g' \
64
	${REINPLACE_CMD} -e 's|\(-lssl -lcrypto\)|$$(LDFLAGS) \1|g' \
48
	${WRKSRC}/Makefile
65
	${WRKSRC}/Makefile.bsd
49
	
66
	
50
.include <bsd.port.mk>
67
.include <bsd.port.mk>
(-)miniupnpd/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1551791337
1
TIMESTAMP = 1591038112
2
SHA256 (miniupnpd-2.1.20190210.tar.gz) = 1aaecd25cf152d99557dfe80c7508af9cb06e97ecad4786ce5dafb4c958d196b
2
SHA256 (miniupnpd-2.1.20200510.tar.gz) = 821e708f369cc1fb851506441fbc3a1f4a1b5a8bf8e84a9e71758a32f5127e8b
3
SIZE (miniupnpd-2.1.20190210.tar.gz) = 235093
3
SIZE (miniupnpd-2.1.20200510.tar.gz) = 245426
(-)miniupnpd/files/enable_check_portinuse.patch (-11 lines)
Lines 1-11 Link Here
1
--- genconfig.sh.orig	2014-04-22 00:37:51.000000000 -0700
2
+++ genconfig.sh	2014-04-22 09:30:24.000000000 -0700
3
@@ -401,7 +401,7 @@
4
 if [ -n "$PORTINUSE" ]; then
5
 	echo "#define CHECK_PORTINUSE" >> ${CONFIGFILE}
6
 else
7
-	echo "/*#define CHECK_PORTINUSE*/" >> ${CONFIGFILE}
8
+	echo "#define CHECK_PORTINUSE" >> ${CONFIGFILE}
9
 fi
10
 echo "" >> ${CONFIGFILE}
11
 
(-)miniupnpd/files/enable_igdv2.patch (-11 lines)
Lines 1-11 Link Here
1
--- genconfig.sh.orig	2014-04-11 01:16:49.000000000 -0700
2
+++ genconfig.sh	2014-04-26 18:22:26.000000000 -0700
3
@@ -436,7 +436,7 @@
4
 if [ -n "$IGD2" ]; then
5
 	echo "#define IGD_V2" >> ${CONFIGFILE}
6
 else
7
-	echo "/*#define IGD_V2*/" >> ${CONFIGFILE}
8
+	echo "#define IGD_V2" >> ${CONFIGFILE}
9
 fi
10
 echo "" >> ${CONFIGFILE}
11
 
(-)miniupnpd/files/enable_ipv6.patch (-11 lines)
Lines 1-11 Link Here
1
--- genconfig.sh.orig	2014-04-11 01:16:49.000000000 -0700
2
+++ genconfig.sh	2014-04-26 18:23:04.000000000 -0700
3
@@ -417,7 +417,7 @@
4
 if [ -n "$IPV6" ]; then
5
 	echo "#define ENABLE_IPV6" >> ${CONFIGFILE}
6
 else
7
-	echo "/*#define ENABLE_IPV6*/" >> ${CONFIGFILE}
8
+	echo "#define ENABLE_IPV6" >> ${CONFIGFILE}
9
 fi
10
 echo "" >> ${CONFIGFILE}
11
 
(-)miniupnpd/files/enable_leasefile.patch (-11 lines)
Lines 1-11 Link Here
1
--- genconfig.sh.orig   2014-04-22 00:37:51.000000000 -0700
2
+++ genconfig.sh	2014-04-26 18:01:49.000000000 -0700
3
@@ -393,7 +393,7 @@
4
 if [ -n "$LEASEFILE" ] ; then
5
 	echo "#define ENABLE_LEASEFILE" >> ${CONFIGFILE}
6
 else
7
-	echo "/*#define ENABLE_LEASEFILE*/" >> ${CONFIGFILE}
8
+	echo "#define ENABLE_LEASEFILE" >> ${CONFIGFILE}
9
 fi
10
 echo "" >> ${CONFIGFILE}
11
 
(-)miniupnpd/files/enable_upnp_strict.patch (-11 lines)
Lines 1-11 Link Here
1
--- genconfig.sh.orig	2014-04-11 01:16:49.000000000 -0700
2
+++ genconfig.sh	2014-04-26 18:23:27.000000000 -0700
3
@@ -472,7 +472,7 @@
4
 if [ -n "$STRICT" ] ; then
5
 	echo "#define UPNP_STRICT" >> ${CONFIGFILE}
6
 else
7
-	echo "/*#define UPNP_STRICT*/" >> ${CONFIGFILE}
8
+	echo "#define UPNP_STRICT" >> ${CONFIGFILE}
9
 fi
10
 echo "" >> ${CONFIGFILE}
11
 
(-)miniupnpd/files/extra-patch-portinuse.c (-49 lines)
Lines 1-49 Link Here
1
--- portinuse.c.orig	2017-11-02 17:38:02 UTC
2
+++ portinuse.c
3
@@ -280,7 +280,7 @@ static struct nlist list[] = {
4
 	struct xinpgen *xig, *exig;
5
 	struct xinpcb *xip;
6
 	struct xtcpcb *xtp;
7
-	struct inpcb *inp;
8
+	struct in_conninfo *inc;
9
 	void *buf = NULL;
10
 	size_t len;
11
 
12
@@ -339,7 +339,8 @@ static struct nlist list[] = {
13
 				free(buf);
14
 				return -1;
15
 			}
16
-			inp = &xtp->xt_inp;
17
+			xip = &xtp->xt_inp;
18
+			inc = &xip->inp_inc;
19
 			break;
20
 		case IPPROTO_UDP:
21
 			xip = (struct xinpcb *)xig;
22
@@ -349,21 +350,21 @@ static struct nlist list[] = {
23
 				free(buf);
24
 				return -1;
25
 			}
26
-			inp = &xip->xi_inp;
27
+			inc = &xip->inp_inc;
28
 			break;
29
 		default:
30
 			abort();
31
 		}
32
 		/* no support for IPv6 */
33
-		if ((inp->inp_vflag & INP_IPV6) != 0)
34
+		if ((xip->inp_vflag & INP_IPV6) != 0)
35
 			continue;
36
 		syslog(LOG_DEBUG, "%08lx:%hu %08lx:%hu <=> %hu %08lx:%hu",
37
-		       (u_long)inp->inp_laddr.s_addr, ntohs(inp->inp_lport),
38
-		       (u_long)inp->inp_faddr.s_addr, ntohs(inp->inp_fport),
39
+		       (u_long)inc->inc_laddr.s_addr, ntohs(inc->inc_lport),
40
+		       (u_long)inc->inc_faddr.s_addr, ntohs(inc->inc_fport),
41
 		       eport, (u_long)ip_addr.s_addr, iport
42
 		);
43
-		if (eport == (unsigned)ntohs(inp->inp_lport)) {
44
-			if (inp->inp_laddr.s_addr == INADDR_ANY || inp->inp_laddr.s_addr == ip_addr.s_addr) {
45
+		if (eport == (unsigned)ntohs(inc->inc_lport)) {
46
+			if (inc->inc_laddr.s_addr == INADDR_ANY || inc->inc_laddr.s_addr == ip_addr.s_addr) {
47
 				found++;
48
 				break;  /* don't care how many, just that we found at least one */
49
 			}
(-)miniupnpd/files/patch-Makefile (-35 lines)
Lines 1-35 Link Here
1
--- Makefile.orig	2018-05-08 01:27:03.541852000 +0800
2
+++ Makefile	2018-05-08 01:28:27.611102000 +0800
3
@@ -162,8 +162,7 @@
4
 
5
 INSTALLBINDIR = $(PREFIX)/sbin
6
 INSTALLETCDIR = $(PREFIX)/etc
7
-# INSTALLMANDIR = $(PREFIX)/man
8
-INSTALLMANDIR = /usr/share/man
9
+INSTALLMANDIR = $(MANPREFIX)/man
10
 
11
 all:	$(EXECUTABLES)
12
 
13
@@ -181,10 +180,10 @@
14
 	$(INSTALL) -d $(DESTDIR)$(INSTALLBINDIR)
15
 	$(INSTALL) -m 755 miniupnpd $(DESTDIR)$(INSTALLBINDIR)
16
 	$(INSTALL) -d $(DESTDIR)$(INSTALLETCDIR)
17
-	$(INSTALL) -b miniupnpd.conf $(DESTDIR)$(INSTALLETCDIR)
18
+	$(INSTALL) -b miniupnpd.conf $(DESTDIR)$(INSTALLETCDIR)/miniupnpd.conf.sample
19
 	# TODO : install man page correctly
20
-#	$(INSTALL) -d $(INSTALLMANDIR)
21
-#	$(INSTALL) miniupnpd.8 $(INSTALLMANDIR)/cat8/miniupnpd.0
22
+	$(INSTALL) -d $(DESTDIR)$(INSTALLMANDIR)/man8
23
+	$(INSTALL) miniupnpd.8 $(DESTDIR)$(INSTALLMANDIR)/man8/miniupnpd.8
24
 
25
 # genuuid is using the uuid cli tool available under OpenBSD 4.0 in
26
 # the uuid-1.5.0 package
27
@@ -225,7 +224,7 @@
28
 	testssdppktgen.c
29
 
30
 miniupnpd: config.h $(ALLOBJS)
31
-	$(CC) $(LDFLAGS) -o $@ $(ALLOBJS) $(LIBS)
32
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ALLOBJS) $(LIBS)
33
 
34
 # BSDmake :
35
 #	$(CC) $(LDFLAGS) -o $@ $> $(LIBS)
(-)miniupnpd/files/patch-Makefile.bsd (+35 lines)
Line 0 Link Here
1
--- Makefile.bsd.orig	2018-05-08 01:27:03.541852000 +0800
2
+++ Makefile.bsd	2018-05-08 01:28:27.611102000 +0800
3
@@ -162,8 +162,7 @@
4
 
5
 INSTALLBINDIR = $(PREFIX)/sbin
6
 INSTALLETCDIR = $(PREFIX)/etc
7
-# INSTALLMANDIR = $(PREFIX)/man
8
-INSTALLMANDIR = /usr/share/man
9
+INSTALLMANDIR = $(MANPREFIX)/man
10
 
11
 all:	$(EXECUTABLES)
12
 
13
@@ -181,10 +180,10 @@
14
 	$(INSTALL) -d $(DESTDIR)$(INSTALLBINDIR)
15
 	$(INSTALL) -m 755 miniupnpd $(DESTDIR)$(INSTALLBINDIR)
16
 	$(INSTALL) -d $(DESTDIR)$(INSTALLETCDIR)
17
-	$(INSTALL) -b miniupnpd.conf $(DESTDIR)$(INSTALLETCDIR)
18
+	$(INSTALL) -b miniupnpd.conf $(DESTDIR)$(INSTALLETCDIR)/miniupnpd.conf.sample
19
 	# TODO : install man page correctly
20
-#	$(INSTALL) -d $(INSTALLMANDIR)
21
-#	$(INSTALL) miniupnpd.8 $(INSTALLMANDIR)/cat8/miniupnpd.0
22
+	$(INSTALL) -d $(DESTDIR)$(INSTALLMANDIR)/man8
23
+	$(INSTALL) miniupnpd.8 $(DESTDIR)$(INSTALLMANDIR)/man8/miniupnpd.8
24
 
25
 # genuuid is using the uuid cli tool available under OpenBSD 4.0 in
26
 # the uuid-1.5.0 package
27
@@ -225,7 +224,7 @@
28
 	testssdppktgen.c
29
 
30
 miniupnpd: config.h $(ALLOBJS)
31
-	$(CC) $(LDFLAGS) -o $@ $(ALLOBJS) $(LIBS)
32
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ALLOBJS) $(LIBS)
33
 
34
 # BSDmake :
35
 #	$(CC) $(LDFLAGS) -o $@ $> $(LIBS)
(-)miniupnpd/files/pf_enable_filter_rules.patch (-11 lines)
Lines 1-11 Link Here
1
--- genconfig.sh.orig	2012-06-18 18:14:32.899227837 +0200
2
+++ genconfig.sh	2012-06-18 18:14:45.089227683 +0200
3
@@ -302,7 +302,7 @@
4
 
5
 echo "/* Uncomment the following line to enable generation of" >> ${CONFIGFILE}
6
 echo " * filter rules with pf */" >> ${CONFIGFILE}
7
-echo "/*#define PF_ENABLE_FILTER_RULES*/">> ${CONFIGFILE}
8
+echo "#define PF_ENABLE_FILTER_RULES">> ${CONFIGFILE}
9
 echo "" >> ${CONFIGFILE}
10
 
11
 echo "/* Uncomment the following line to enable caching of results of" >> ${CONFIGFILE}

Return to bug 246925