pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/comms/openobex Add support for NetBSD's bluetooth, req...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5db87e375e66
branches:  trunk
changeset: 515479:5db87e375e66
user:      xtraeme <xtraeme%pkgsrc.org@localhost>
date:      Sun Jul 02 18:16:53 2006 +0000

description:
Add support for NetBSD's bluetooth, required by the upcoming package
obexapp.

Bump PKGREVISION.

diffstat:

 comms/openobex/Makefile         |   19 ++++++-
 comms/openobex/distinfo         |    8 ++-
 comms/openobex/patches/patch-aa |   38 +++++++++++++
 comms/openobex/patches/patch-ab |   12 ++++
 comms/openobex/patches/patch-ac |   16 +++++
 comms/openobex/patches/patch-ad |   12 ++++
 comms/openobex/patches/patch-ae |  110 ++++++++++++++++++++++++++++++++++++++++
 comms/openobex/patches/patch-af |   13 ++++
 8 files changed, 225 insertions(+), 3 deletions(-)

diffs (275 lines):

diff -r c5419aa17cf4 -r 5db87e375e66 comms/openobex/Makefile
--- a/comms/openobex/Makefile   Sun Jul 02 17:22:14 2006 +0000
+++ b/comms/openobex/Makefile   Sun Jul 02 18:16:53 2006 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.7 2006/03/04 21:29:05 jlam Exp $
+# $NetBSD: Makefile,v 1.8 2006/07/02 18:16:53 xtraeme Exp $
 #
 
 DISTNAME=      openobex-1.0.1
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    comms
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=openobex/}
 
@@ -14,4 +14,19 @@
 USE_TOOLS+=    gmake
 USE_LIBTOOL=   YES
 
+.include "../../mk/bsd.prefs.mk"
+
+.if (${OPSYS} == "NetBSD" && exists(/usr/include/bluetooth.h))
+SUBST_CLASSES+=                bt
+SUBST_STAGE.bt=                post-patch
+SUBST_FILES.bt=                configure
+SUBST_SED.bt=          -e "s|bluetooth/bluetooth.h|bluetooth.h|g"
+SUBST_SED.bt+=         -e "s|bluetooth/rfcomm.h|netbt/rfcomm.h|g"
+SUBST_SED.bt+=         -e "s|sockaddr_rc|sockaddr_bt|g"
+SUBST_MESSAGE.bt=      Fixing bluetooth detection.
+
+# bacpy() and friends
+CPPFLAGS+=             -DCOMPAT_BLUEZ
+.endif
+
 .include "../../mk/bsd.pkg.mk"
diff -r c5419aa17cf4 -r 5db87e375e66 comms/openobex/distinfo
--- a/comms/openobex/distinfo   Sun Jul 02 17:22:14 2006 +0000
+++ b/comms/openobex/distinfo   Sun Jul 02 18:16:53 2006 +0000
@@ -1,5 +1,11 @@
-$NetBSD: distinfo,v 1.2 2005/02/23 16:05:30 agc Exp $
+$NetBSD: distinfo,v 1.3 2006/07/02 18:16:53 xtraeme Exp $
 
 SHA1 (openobex-1.0.1.tar.gz) = aa73b3f9e345088e8f1c070e0e727f586820d20e
 RMD160 (openobex-1.0.1.tar.gz) = 70dc7d2e38b819af0c35ccb26f806b7aa7682b0e
 Size (openobex-1.0.1.tar.gz) = 211696 bytes
+SHA1 (patch-aa) = a73def8cc93d50a023ce76ec30e05163293aea45
+SHA1 (patch-ab) = 172cf62a95b8e278c2539d4339b6bb17354e8cd7
+SHA1 (patch-ac) = 8b9ca12b6c84ab743590dc16689ba672ffb5b46b
+SHA1 (patch-ad) = 4a9c02f6e899d1740504ec03bda3301915018ae3
+SHA1 (patch-ae) = c25191fcded6e87d2bcca17a2ae77720c79646a4
+SHA1 (patch-af) = 165602889a3fbc9c3bf98390bbf3d5c85e55bebc
diff -r c5419aa17cf4 -r 5db87e375e66 comms/openobex/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/openobex/patches/patch-aa   Sun Jul 02 18:16:53 2006 +0000
@@ -0,0 +1,38 @@
+$NetBSD: patch-aa,v 1.1 2006/07/02 18:16:53 xtraeme Exp $
+
+--- src/obex_transport.h.orig  2003-10-01 13:17:13.000000000 +0200
++++ src/obex_transport.h       2006-07-02 18:51:48.000000000 +0200
+@@ -39,7 +39,11 @@
+ #ifdef HAVE_IRDA
+ #include "irda_wrap.h"
+ #endif /*HAVE_IRDA*/
+-#ifdef HAVE_BLUETOOTH
++
++#if defined(HAVE_BLUETOOTH) && defined(__NetBSD__)
++#include <bluetooth.h>
++#include <netbt/rfcomm.h>
++#elif defined(HAVE_BLUETOOTH)
+ #include <bluetooth/bluetooth.h>
+ #include <bluetooth/rfcomm.h>
+ #endif /*HAVE_BLUETOOTH*/
+@@ -52,7 +56,11 @@
+ #endif /*HAVE_IRDA*/
+       struct sockaddr_in   inet;
+ #ifdef HAVE_BLUETOOTH
++#ifdef __NetBSD__
++      struct sockaddr_bt rfcomm;
++#else
+       struct sockaddr_rc   rfcomm;
++#endif
+ #endif /*HAVE_BLUETOOTH*/
+ } saddr_t;
+ 
+@@ -76,7 +84,4 @@
+ int obex_transport_read(obex_t *self, int count, uint8_t *buf, int buflen);
+ 
+ 
+-#endif OBEX_TRANSPORT_H
+-
+-
+-
++#endif  /* OBEX_TRANSPORT_H */
diff -r c5419aa17cf4 -r 5db87e375e66 comms/openobex/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/openobex/patches/patch-ab   Sun Jul 02 18:16:53 2006 +0000
@@ -0,0 +1,12 @@
+$NetBSD: patch-ab,v 1.1 2006/07/02 18:16:53 xtraeme Exp $
+
+--- src/obex.c.orig    2006-07-02 18:53:03.000000000 +0200
++++ src/obex.c 2006-07-02 18:53:13.000000000 +0200
+@@ -33,6 +33,7 @@
+ #endif
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
+ 
diff -r c5419aa17cf4 -r 5db87e375e66 comms/openobex/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/openobex/patches/patch-ac   Sun Jul 02 18:16:53 2006 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-ac,v 1.1 2006/07/02 18:16:53 xtraeme Exp $
+
+--- src/obex_main.c.orig       2003-10-01 13:17:13.000000000 +0200
++++ src/obex_main.c    2006-07-02 18:56:16.000000000 +0200
+@@ -46,7 +46,11 @@
+ #include <stdio.h>
+ 
+ #ifdef HAVE_BLUETOOTH
++#ifdef __NetBSD__
++#include <bluetooth.h>
++#else
+ #include <bluetooth/bluetooth.h>
++#endif /* __NetBSD__ */
+ #endif /*HAVE_BLUETOOTH*/
+ 
+ #endif /* _WIN32 */
diff -r c5419aa17cf4 -r 5db87e375e66 comms/openobex/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/openobex/patches/patch-ad   Sun Jul 02 18:16:53 2006 +0000
@@ -0,0 +1,12 @@
+$NetBSD: patch-ad,v 1.1 2006/07/02 18:16:53 xtraeme Exp $
+
+--- src/obex_object.c.orig     2006-07-02 18:56:59.000000000 +0200
++++ src/obex_object.c  2006-07-02 18:57:10.000000000 +0200
+@@ -33,6 +33,7 @@
+ #endif
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ 
+ #include "obex_main.h"
diff -r c5419aa17cf4 -r 5db87e375e66 comms/openobex/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/openobex/patches/patch-ae   Sun Jul 02 18:16:53 2006 +0000
@@ -0,0 +1,110 @@
+$NetBSD: patch-ae,v 1.1 2006/07/02 18:16:53 xtraeme Exp $
+
+--- src/btobex.c.orig  2003-10-01 13:17:13.000000000 +0200
++++ src/btobex.c       2006-07-02 19:24:16.000000000 +0200
+@@ -46,12 +46,16 @@
+ #include <netinet/in.h>
+ #include <sys/socket.h>
+ 
++#ifdef __NetBSD__
++#include <bluetooth.h>
++#include <netbt/rfcomm.h>
++#else
+ #include <bluetooth/bluetooth.h>
+ #include <bluetooth/rfcomm.h>
++#endif
+ 
+ #endif /* _WIN32 */
+ 
+-
+ #include <obex_main.h>
+ #include <btobex.h>
+ 
+@@ -65,6 +69,15 @@
+ void btobex_prepare_connect(obex_t *self, bdaddr_t *src, bdaddr_t *dst, uint8_t channel)
+ {
+ #ifndef _WIN32
++#ifdef __NetBSD__
++      self->trans.self.rfcomm.bt_family = AF_BLUETOOTH;
++      bacpy(&self->trans.self.rfcomm.bt_bdaddr, src);
++      self->trans.self.rfcomm.bt_channel = 0;
++
++      self->trans.peer.rfcomm.bt_family = AF_BLUETOOTH;
++      bacpy(&self->trans.peer.rfcomm.bt_bdaddr, dst);
++      self->trans.peer.rfcomm.bt_channel = channel;
++#else
+       self->trans.self.rfcomm.rc_family = AF_BLUETOOTH;
+       bacpy(&self->trans.self.rfcomm.rc_bdaddr, src);
+       self->trans.self.rfcomm.rc_channel = 0;
+@@ -72,6 +85,7 @@
+       self->trans.peer.rfcomm.rc_family = AF_BLUETOOTH;
+       bacpy(&self->trans.peer.rfcomm.rc_bdaddr, dst);
+       self->trans.peer.rfcomm.rc_channel = channel;
++#endif
+ #endif /* _WIN32 */
+ }
+ 
+@@ -85,9 +99,15 @@
+ {
+ #ifndef _WIN32
+       /* Bind local service */
++#ifdef __NetBSD__
++      self->trans.self.rfcomm.bt_family = AF_BLUETOOTH;
++      bacpy(&self->trans.self.rfcomm.bt_bdaddr, src);
++      self->trans.self.rfcomm.bt_channel = channel;
++#else
+       self->trans.self.rfcomm.rc_family = AF_BLUETOOTH;
+       bacpy(&self->trans.self.rfcomm.rc_bdaddr, src);
+       self->trans.self.rfcomm.rc_channel = channel;
++#endif
+ #endif /* _WIN32 */
+ }
+ 
+@@ -109,7 +129,11 @@
+       }
+       
+       if (bind(self->serverfd, (struct sockaddr*) &self->trans.self.rfcomm, 
++#ifdef __NetBSD__
++              sizeof(struct sockaddr_bt)))
++#else
+                sizeof(struct sockaddr_rc)))
++#endif
+       {
+               DEBUG(0, "Error doing bind\n");
+               goto out_freesock;
+@@ -142,7 +166,11 @@
+ int btobex_accept(obex_t *self)
+ {
+ #ifndef _WIN32
++#ifdef __NetBSD__
++      int addrlen = sizeof(struct sockaddr_bt);
++#else
+       int addrlen = sizeof(struct sockaddr_rc);
++#endif
+       //int mtu;
+       //int len = sizeof(int);
+ 
+@@ -181,7 +209,11 @@
+       }
+ 
+       ret = bind(self->fd, (struct sockaddr*) &self->trans.self.rfcomm,
++#ifdef __NetBSD__
++                 sizeof(struct sockaddr_bt));
++#else
+                  sizeof(struct sockaddr_rc));
++#endif           
+ 
+       if (ret < 0) {
+               DEBUG(4, "ret=%d\n", ret);
+@@ -189,7 +221,11 @@
+       }
+ 
+       ret = connect(self->fd, (struct sockaddr*) &self->trans.peer.rfcomm,
++#ifdef __NetBSD__
++                    sizeof(struct sockaddr_bt));
++#else
+                     sizeof(struct sockaddr_rc));
++#endif
+       if (ret < 0) {
+               DEBUG(4, "ret=%d\n", ret);
+               goto out_freesock;
diff -r c5419aa17cf4 -r 5db87e375e66 comms/openobex/patches/patch-af
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/openobex/patches/patch-af   Sun Jul 02 18:16:53 2006 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-af,v 1.1 2006/07/02 18:16:53 xtraeme Exp $
+
+--- src/obex.h.orig    2006-07-02 19:31:28.000000000 +0200
++++ src/obex.h 2006-07-02 19:31:36.000000000 +0200
+@@ -51,7 +51,7 @@
+ typedef void* obex_object_t;
+ typedef void (*obex_event_t)(obex_t *handle, obex_object_t *obj, int mode, int event, int obex_cmd, int obex_rsp);
+ // This is to workaround compilation without Bluetooth support. - Jean II
+-#ifndef SOL_RFCOMM
++#ifdef SOL_RFCOMM
+ typedef char* bdaddr_t;
+ #endif
+ 



Home | Main Index | Thread Index | Old Index