* fixes build with libupnp>=1.6.7.

* Bump PKGREVISION from libupnp shlib bump.
This commit is contained in:
obache 2012-04-13 23:44:38 +00:00
parent 628e3dd138
commit 509248a733
9 changed files with 142 additions and 13 deletions

View file

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.3 2011/11/16 01:33:18 sbd Exp $
# $NetBSD: Makefile,v 1.4 2012/04/13 23:44:38 obache Exp $
#
DISTNAME= ushare-1.1a
PKGREVISION= 2
PKGREVISION= 3
CATEGORIES= net multimedia
MASTER_SITES= http://ushare.geexbox.org/releases/
EXTRACT_SUFX= .tar.bz2

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.1.1.1 2010/05/23 08:18:04 obache Exp $
$NetBSD: distinfo,v 1.2 2012/04/13 23:44:38 obache Exp $
SHA1 (ushare-1.1a.tar.bz2) = 1539e83cde5d80f433d262d971f5fe78486c9375
RMD160 (ushare-1.1a.tar.bz2) = 6194ffec031d20fd897f2c7cf71c3c810238713f
@ -8,4 +8,10 @@ SHA1 (patch-ab) = 2136d6b0e92b797072ea13d30e0fcc7131ab50a6
SHA1 (patch-ac) = 0c8cc122de8d1fbdaaace4867656819cad0b84e7
SHA1 (patch-ad) = 6c8e838add604b54132fbe924c4a8697ee2e2c09
SHA1 (patch-ae) = 180151696678bb2f3ccd2bbaaaf9ed55f1c441e9
SHA1 (patch-af) = 43de62f0bb720bb31f7e8f1c8a31a5b7c5e19881
SHA1 (patch-af) = dc3d963a613629dc0340326b9bb58174cddb4971
SHA1 (patch-src_cds.c) = 04b56cf45b628d9a94baec4dde73709a3378e0b1
SHA1 (patch-src_cms.c) = 8056f8d90b3b893cdcd242c5fce19e9a1825790a
SHA1 (patch-src_http.c) = ea20349013d56a41c027738f950800c1ba101fc2
SHA1 (patch-src_mime.c) = d21134337a4950faaf5e29e960b5815eafdfbe12
SHA1 (patch-src_presentation.c) = d682cb85c9f5bdd5f304ea14abfa5889f28efdd3
SHA1 (patch-src_services.c) = af0d0c5e3328d78d03663eb98194210145a63629

View file

@ -1,7 +1,8 @@
$NetBSD: patch-af,v 1.1.1.1 2010/05/23 08:18:04 obache Exp $
$NetBSD: patch-af,v 1.2 2012/04/13 23:44:39 obache Exp $
* Treat NetBSD same as FreeBSD.
* Move sys/param.h and config.h header files before using conditions.
* libupnp>=1.6.7 support.
--- src/ushare.c.orig 2007-12-09 13:03:36.000000000 +0000
+++ src/ushare.c
@ -18,7 +19,7 @@ $NetBSD: patch-af,v 1.1.1.1 2010/05/23 08:18:04 obache Exp $
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <net/if_dl.h>
@@ -49,18 +53,15 @@
@@ -49,18 +53,19 @@
#include <ifaddrs.h>
#endif
@ -29,6 +30,10 @@ $NetBSD: patch-af,v 1.1.1.1 2010/05/23 08:18:04 obache Exp $
#include <upnp/upnp.h>
#include <upnp/upnptools.h>
+#if UPNP_VERSION >= 10607
+#include <netdb.h>
+#endif
+
+#include "config.h"
+
#if (defined(HAVE_SETLOCALE) && defined(CONFIG_NLS))
@ -39,7 +44,36 @@ $NetBSD: patch-af,v 1.1.1.1 2010/05/23 08:18:04 obache Exp $
#include "ushare.h"
#include "services.h"
#include "http.h"
@@ -505,7 +506,7 @@ create_udn (char *interface)
@@ -177,7 +182,11 @@ handle_action_request (struct Upnp_Actio
struct service_t *service;
struct service_action_t *action;
char val[256];
+#if UPNP_VERSION < 10607
uint32_t ip;
+#else
+ int error;
+#endif
if (!request || !ut)
return;
@@ -188,10 +197,16 @@ handle_action_request (struct Upnp_Actio
if (strcmp (request->DevUDN + 5, ut->udn))
return;
+#if UPNP_VERSION < 10607
ip = request->CtrlPtIPAddr.s_addr;
ip = ntohl (ip);
sprintf (val, "%d.%d.%d.%d",
(ip >> 24) & 0xFF, (ip >> 16) & 0xFF, (ip >> 8) & 0xFF, ip & 0xFF);
+#else
+ error = getnameinfo((struct sockaddr *)&(request->CtrlPtIPAddr),
+ request->CtrlPtIPAddr.ss_len,
+ val, sizeof(val), NULL, 0, NI_NUMERICHOST);
+#endif
if (ut->verbose)
{
@@ -505,7 +520,7 @@ create_udn (char *interface)
char *buf;
unsigned char *ptr;
@ -48,7 +82,7 @@ $NetBSD: patch-af,v 1.1.1.1 2010/05/23 08:18:04 obache Exp $
int mib[6];
size_t len;
struct if_msghdr *ifm;
@@ -517,7 +518,7 @@ create_udn (char *interface)
@@ -517,7 +532,7 @@ create_udn (char *interface)
if (!interface)
return NULL;
@ -57,7 +91,7 @@ $NetBSD: patch-af,v 1.1.1.1 2010/05/23 08:18:04 obache Exp $
mib[0] = CTL_NET;
mib[1] = AF_ROUTE;
mib[2] = 0;
@@ -568,7 +569,7 @@ create_udn (char *interface)
@@ -568,7 +583,7 @@ create_udn (char *interface)
buf = (char *) malloc (64 * sizeof (char));
memset (buf, 0, 64);
ptr = (unsigned char *) ifr.ifr_hwaddr.sa_data;
@ -66,16 +100,19 @@ $NetBSD: patch-af,v 1.1.1.1 2010/05/23 08:18:04 obache Exp $
snprintf (buf, 64, "%s-%02x%02x%02x%02x%02x%02x", DEFAULT_UUID,
(ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377),
@@ -734,7 +735,7 @@ setup_i18n(void)
@@ -734,11 +749,8 @@ setup_i18n(void)
#ifdef HAVE_SETLOCALE
setlocale (LC_ALL, "");
#endif
-#if (!defined(BSD) && !defined(__FreeBSD__))
+#if (!defined(BSD) && !defined(__FreeBSD__) && !defined(__NetBSD__))
bindtextdomain (PACKAGE, LOCALEDIR);
#endif
textdomain (PACKAGE);
@@ -845,6 +846,9 @@ main (int argc, char **argv)
- textdomain (PACKAGE);
-#endif
}
#define SHUTDOWN_MSG _("Server is shutting down: other clients will be notified soon, Bye bye ...\n")
@@ -845,6 +857,9 @@ main (int argc, char **argv)
signal (SIGINT, UPnPBreak);
signal (SIGHUP, reload_config);

View file

@ -0,0 +1,15 @@
$NetBSD: patch-src_cds.c,v 1.1 2012/04/13 23:44:39 obache Exp $
* some header files are not included by libupnp>=1.6.7.
--- src/cds.c.orig 2007-12-09 13:03:36.000000000 +0000
+++ src/cds.c
@@ -20,6 +20,8 @@
*/
#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
#include <upnp/upnp.h>
#include <upnp/upnptools.h>

View file

@ -0,0 +1,14 @@
$NetBSD: patch-src_cms.c,v 1.1 2012/04/13 23:44:39 obache Exp $
* some header files are not included by libupnp>=1.6.7.
--- src/cms.c.orig 2007-12-09 13:03:36.000000000 +0000
+++ src/cms.c
@@ -20,6 +20,7 @@
*/
#include <stdlib.h>
+#include <string.h>
#include <upnp/upnp.h>
#include <upnp/upnptools.h>

View file

@ -0,0 +1,14 @@
$NetBSD: patch-src_http.c,v 1.1 2012/04/13 23:44:39 obache Exp $
* some header files are not included by libupnp>=1.6.7.
--- src/http.c.orig 2007-12-09 13:03:36.000000000 +0000
+++ src/http.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
+#include <string.h>
#include <upnp/upnp.h>
#include <upnp/upnptools.h>

View file

@ -0,0 +1,14 @@
$NetBSD: patch-src_mime.c,v 1.1 2012/04/13 23:44:39 obache Exp $
* some header files are not included by libupnp>=1.6.7.
--- src/mime.c.orig 2007-12-09 13:03:36.000000000 +0000
+++ src/mime.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
+#include <stdio.h>
#include "mime.h"
#include "ushare.h"

View file

@ -0,0 +1,15 @@
$NetBSD: patch-src_presentation.c,v 1.1 2012/04/13 23:44:39 obache Exp $
* some header files are not included by libupnp>=1.6.7.
--- src/presentation.c.orig 2007-12-09 13:03:36.000000000 +0000
+++ src/presentation.c
@@ -19,6 +19,8 @@
*/
#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
#if HAVE_LANGINFO_CODESET
# include <langinfo.h>

View file

@ -0,0 +1,14 @@
$NetBSD: patch-src_services.c,v 1.1 2012/04/13 23:44:39 obache Exp $
* some header files are not included by libupnp>=1.6.7.
--- src/services.c.orig 2007-12-09 13:03:36.000000000 +0000
+++ src/services.c
@@ -20,6 +20,7 @@
*/
#include <stdlib.h>
+#include <string.h>
#include <upnp/upnp.h>
#include <upnp/upnptools.h>