[packages/dante] - added miniupnp patch (fixes build with miniupnpc 1.6+) and upnp bcond

qboosh qboosh at pld-linux.org
Tue Feb 5 17:54:56 CET 2013


commit f529e0ab2cca90065e99c597fd1d9ba0d1e23f8d
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Tue Feb 5 17:56:02 2013 +0100

    - added miniupnp patch (fixes build with miniupnpc 1.6+) and upnp bcond

 dante-miniupnp.patch | 40 ++++++++++++++++++++++++++++++++++++++++
 dante.spec           | 13 +++++++++++--
 2 files changed, 51 insertions(+), 2 deletions(-)
---
diff --git a/dante.spec b/dante.spec
index e568c88..c4d002d 100644
--- a/dante.spec
+++ b/dante.spec
@@ -1,6 +1,9 @@
 # TODO:
-# - miniupnp ?
 # - examine ldap and sasl support (deps are pulled into *.la, no direct linking anywhere?)
+#
+# Conditional build:
+%bcond_without	upnp	# UPnP support (via miniupnp)
+#
 Summary:	A free Socks v4/v5 client implementation
 Summary(pl.UTF-8):	Darmowa implementacja klienta Socks v4/5
 Name:		dante
@@ -13,6 +16,7 @@ Source0:	ftp://ftp.inet.no/pub/socks/%{name}-%{version}.tar.gz
 Source1:	sockd.init
 Patch0:		%{name}-am.patch
 Patch1:		%{name}-link.patch
+Patch2:		%{name}-miniupnp.patch
 URL:		http://www.inet.no/dante/
 BuildRequires:	autoconf >= 2.61
 BuildRequires:	automake
@@ -20,8 +24,10 @@ BuildRequires:	cyrus-sasl-devel
 BuildRequires:	heimdal-devel
 BuildRequires:	libtool
 BuildRequires:	libwrap-devel
+%{?with_upnp:BuildRequires:	miniupnpc-devel >= 1.6}
 BuildRequires:	openldap-devel
 BuildRequires:	pam-devel
+%{?with_upnp:Requires:	miniupnpc >= 1.6}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -67,6 +73,7 @@ Group:		Networking/Daemons
 Requires:	%{name} = %{version}-%{release}
 Requires:	cyrus-sasl-devel
 Requires:	heimdal-devel
+%{?with_upnp:Requires:	miniupnpc-devel >= 1.6}
 Requires:	openldap-devel
 Requires:	pam-devel
 
@@ -93,6 +100,7 @@ Statyczna biblioteka socks.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %{__libtoolize}
@@ -102,7 +110,8 @@ Statyczna biblioteka socks.
 %{__automake}
 %configure \
 	--disable-silent-rules \
-	--without-glibc-secure
+	--without-glibc-secure \
+	%{!?with_upnp:--without-upnp}
 
 %{__make}
 
diff --git a/dante-miniupnp.patch b/dante-miniupnp.patch
new file mode 100644
index 0000000..fee15a1
--- /dev/null
+++ b/dante-miniupnp.patch
@@ -0,0 +1,40 @@
+--- dante-1.3.2/miniupnpc.m4.orig	2011-07-15 14:03:48.000000000 +0200
++++ dante-1.3.2/miniupnpc.m4	2013-02-05 16:34:47.963810307 +0100
+@@ -20,7 +20,7 @@
+ 	LIBS=$oLIBS
+     fi
+     if test x"${have_libminiupnp}" = xt; then
+-        AC_MSG_CHECKING([for miniupnpc version >= 1.4])
++        AC_MSG_CHECKING([for miniupnpc version >= 1.6])
+ 	AC_TRY_COMPILE([
+             #include <stdio.h>
+             #include <miniupnpc/miniupnpc.h>
+@@ -37,7 +37,7 @@
+             (void)UPNP_GetIGDFromUrl(str, UPNPUrls, IGDdatas, str, 0);
+             (void)UPNP_GetValidIGD(UPNPDev, UPNPUrls, IGDdatas, str, 0);
+             (void)UPNP_GetExternalIPAddress(str, str, str);
+-            (void)UPNP_AddPortMapping(str, str, str, str, str, str, str, str);
++            (void)UPNP_AddPortMapping(str, str, str, str, str, str, str, str, str);
+             (void)UPNP_DeletePortMapping(str, str, str, str, str);],
+          [AC_MSG_RESULT(yes)
+           AC_DEFINE(HAVE_LIBMINIUPNP, 1, [UPNP support library])
+--- dante-1.3.2/lib/upnp.c.orig	2011-07-21 16:09:19.000000000 +0200
++++ dante-1.3.2/lib/upnp.c	2013-02-05 16:48:04.403793706 +0100
+@@ -111,7 +111,7 @@
+       slog(LOG_DEBUG, "%s: doing upnp discovery on interface of addr %s (%s)",
+       function, addrstring, gwaddr2string(gw, gwstring, sizeof(gwstring)));
+ 
+-      if ((dev = upnpDiscover(UPNP_DISCOVERYTIME_MS, addrstring, NULL, 0))
++      if ((dev = upnpDiscover(UPNP_DISCOVERYTIME_MS, addrstring, NULL, 0, 0, NULL))
+       == NULL) {
+          slog(LOG_DEBUG, "no upnp devices found");
+ 
+@@ -477,7 +477,7 @@
+          str2upper(protocol); /* seems to fail if not. */
+          if ((rc = UPNP_AddPortMapping(state->upnp.controlurl,
+          state->upnp.servicetype, strport, strport, straddr, buf, protocol,
+-         NULL)) != UPNPCOMMAND_SUCCESS) {
++         NULL, NULL)) != UPNPCOMMAND_SUCCESS) {
+                swarnx("%s: UPNP_AddPortMapping() failed: %s",
+                function, strupnperror(rc));
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dante.git/commitdiff/f529e0ab2cca90065e99c597fd1d9ba0d1e23f8d



More information about the pld-cvs-commit mailing list