View | Details | Raw Unified | Return to bug 128979
Collapse All | Expand All

(-)/root/tmp/openobex/Makefile (-8 / +17 lines)
Lines 6-29 Link Here
6
#
6
#
7
7
8
PORTNAME=	openobex
8
PORTNAME=	openobex
9
PORTVERSION=	1.3
9
PORTVERSION=	1.4
10
PORTREVISION=	1
11
CATEGORIES=	comms net
10
CATEGORIES=	comms net
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
11
MASTER_SITES=	http://www.kernel.org/pub/linux/bluetooth/ \
13
MASTER_SITE_SUBDIR=	${PORTNAME}
12
		http://www.de.kernel.org/pub/linux/bluetooth/
14
13
15
MAINTAINER=	mad@madpilot.net
14
MAINTAINER=	mad@madpilot.net
16
COMMENT=	Open source implementation of the OBEX protocol
15
COMMENT=	Open source implementation of the OBEX protocol
17
16
18
USE_AUTOTOOLS=	automake:14:env autoheader:262 autoconf:262 libtool:15
19
USE_GMAKE=		yes
17
USE_GMAKE=		yes
20
USE_LDCONFIG=		yes
18
USE_LDCONFIG=		yes
21
GNU_CONFIGURE=		yes
19
GNU_CONFIGURE=		yes
22
CONFIGURE_ARGS+=	--program-transform-name="" \
20
CONFIGURE_ARGS+=	--program-transform-name=""
23
			--disable-usb
21
22
OPTIONS=	LIBUSB "Enable OBEX over USB" no
24
23
25
post-patch:
24
post-patch:
26
	@ ${REINPLACE_CMD} -e "s|pkgconfigdir =.*|pkgconfigdir = ${PREFIX}/libdata/pkgconfig|g" \
25
	@ ${REINPLACE_CMD} -e "s|pkgconfigdir =.*|pkgconfigdir = ${PREFIX}/libdata/pkgconfig|g" \
27
		${WRKSRC}/Makefile.in
26
		${WRKSRC}/Makefile.in
28
27
29
.include <bsd.port.mk>
28
.include <bsd.port.pre.mk>
29
30
.if defined(WITH_LIBUSB)
31
LIB_DEPENDS+=	usb-0.1.8:${PORTSDIR}/devel/libusb
32
CONFIGURE_ARGS+=--enable-usb
33
CFLAGS+=-I${PREFIX}/include
34
.else
35
CONFIGURE_ARGS+=--disable-usb
36
.endif
37
38
.include <bsd.port.post.mk>
(-)/root/tmp/openobex/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (openobex-1.3.tar.gz) = feaa5dfe5151c0e70e8f868fa4648a43
1
MD5 (openobex-1.4.tar.gz) = 572a52ac423434a3290c5f867eed362d
2
SHA256 (openobex-1.3.tar.gz) = 3a80ba2524c66a46db3ac17a788a759015a1f79de6a495fcdf3a316e19fe7c23
2
SHA256 (openobex-1.4.tar.gz) = 79265309e2320beb03910fccf27fd04aefb18ba47a900947d2de8e88fae05cd8
3
SIZE (openobex-1.3.tar.gz) = 337614
3
SIZE (openobex-1.4.tar.gz) = 393756
(-)/root/tmp/openobex/files/patch-aclocal.m4 (-40 lines)
Lines 1-40 Link Here
1
--- aclocal.m4.orig	Wed Jun 14 15:58:25 2006
2
+++ aclocal.m4	Sat Nov 25 21:55:24 2006
3
@@ -6914,6 +6914,37 @@
4
 # AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
5
 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
6
 
7
+
8
+dnl adding a check for FreeBSD blutooth netgraph support.
9
+
10
+AC_DEFUN([FREEBSD_BLUETOOTH_HOOK],[
11
+	AC_MSG_CHECKING([for the FreeBSD/netgraph bluetooth support])
12
+	echo
13
+	AC_CHECK_LIB(bluetooth, bt_aton,
14
+	[AC_CACHE_CHECK(for the struct sockaddr_rfcomm in <netgraph/.../ng_btsocket.h>, ac_cv_have_sockaddr_rfcomm,
15
+	[AC_TRY_COMPILE([#include <sys/types.h>
16
+			#include <sys/socket.h>
17
+			#include <bitstring.h>
18
+			#include <netgraph/bluetooth/include/ng_hci.h>
19
+			#include <netgraph/bluetooth/include/ng_l2cap.h>
20
+			#include <netgraph/bluetooth/include/ng_btsocket.h>],
21
+		[struct sockaddr_rfcomm rc;],
22
+		ac_cv_have_sockaddr_rfcomm=yes,
23
+		ac_cv_have_sockaddr_rfcomm=no)])
24
+
25
+	if test $ac_cv_have_sockaddr_rfcomm = yes; then
26
+		AC_DEFINE(HAVE_BLUETOOTH)
27
+		AC_DEFINE(HAVE_BLUETOOTH_NETGRAPH,1,[Compile on FreeBSD])
28
+		USE_BLUETOOTH="yes"
29
+		LIBS="$LIBS -lbluetooth"
30
+		AC_DEFINE(HAVE_BT_ATON,1,[Define to 1 if you have the \`bt_aton' function.])
31
+	fi
32
+])])
33
+
34
+AC_DEFUN([FREEBSD_BLUETOOTH_CHECK], [
35
+	FREEBSD_BLUETOOTH_HOOK([],failure)
36
+])
37
+
38
 # Do all the work for Automake.                             -*- Autoconf -*-
39
 
40
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
(-)/root/tmp/openobex/files/patch-bt (+12 lines)
Line 0 Link Here
1
diff -ur lib/bluez_compat.h work.2/openobex-1.4/lib/bluez_compat.h
2
--- lib/bluez_compat.h	2008-11-07 14:36:09.000000000 +0200
3
+++ lib/bluez_compat.h	2008-11-19 02:34:53.000000000 +0200
4
@@ -53,6 +53,8 @@
5
 #define rc_family   rfcomm_family
6
 #define rc_bdaddr   rfcomm_bdaddr
7
 #define rc_channel  rfcomm_channel
8
+#define BDADDR_ANY  NG_HCI_BDADDR_ANY
9
+#define BTPROTO_RFCOMM BLUETOOTH_PROTO_RFCOMM
10
 
11
 #elif defined(HAVE_BLUETOOTH_NETBSD)
12
 #include <bluetooth.h>
(-)/root/tmp/openobex/files/patch-configure.in (-10 lines)
Lines 1-10 Link Here
1
--- configure.in.orig	Wed Jun 14 11:24:13 2006
2
+++ configure.in	Sat Nov 25 21:56:52 2006
3
@@ -22,6 +22,7 @@
4
 AC_PATH_IRDA
5
 AC_PATH_BLUEZ
6
 AC_PATH_USB
7
+FREEBSD_BLUETOOTH_CHECK
8
 
9
 AC_ARG_OPENOBEX
10
 
(-)/root/tmp/openobex/files/patch-lib-btobex.c (-110 lines)
Lines 1-110 Link Here
1
--- lib/btobex.c.orig	Tue Jan  3 20:36:15 2006
2
+++ lib/btobex.c	Sat Nov 25 22:00:13 2006
3
@@ -46,8 +46,12 @@
4
 #include <netinet/in.h>
5
 #include <sys/socket.h>
6
 
7
+#ifdef HAVE_BLUETOOTH_NETGRAPH
8
+#include <bluetooth.h>
9
+#else /*HAVE_BLUETOOTH_NETGRAPH*/
10
 #include <bluetooth/bluetooth.h>
11
 #include <bluetooth/rfcomm.h>
12
+#endif /*HAVE_BLUETOOTH_NETGRAPH*/
13
 
14
 #endif /* _WIN32 */
15
 
16
@@ -63,6 +67,15 @@
17
 void btobex_prepare_connect(obex_t *self, bdaddr_t *src, bdaddr_t *dst, uint8_t channel)
18
 {
19
 #ifndef _WIN32
20
+#ifdef HAVE_BLUETOOTH_NETGRAPH
21
+	self->trans.self.rfcomm.rfcomm_family = AF_BLUETOOTH;
22
+	bacpy(&self->trans.self.rfcomm.rfcomm_bdaddr, src);
23
+	self->trans.self.rfcomm.rfcomm_channel = 0;
24
+
25
+	self->trans.peer.rfcomm.rfcomm_family = AF_BLUETOOTH;
26
+	bacpy(&self->trans.peer.rfcomm.rfcomm_bdaddr, dst);
27
+	self->trans.peer.rfcomm.rfcomm_channel = channel;
28
+#else /*HAVE_BLUETOOTH_NETGRAPH*/
29
 	self->trans.self.rfcomm.rc_family = AF_BLUETOOTH;
30
 	bacpy(&self->trans.self.rfcomm.rc_bdaddr, src);
31
 	self->trans.self.rfcomm.rc_channel = 0;
32
@@ -70,6 +83,7 @@
33
 	self->trans.peer.rfcomm.rc_family = AF_BLUETOOTH;
34
 	bacpy(&self->trans.peer.rfcomm.rc_bdaddr, dst);
35
 	self->trans.peer.rfcomm.rc_channel = channel;
36
+#endif /*HAVE_BLUETOOTH_NETGRAPH*/
37
 #endif /* _WIN32 */
38
 }
39
 
40
@@ -83,9 +97,15 @@
41
 {
42
 #ifndef _WIN32
43
 	/* Bind local service */
44
+#ifdef HAVE_BLUETOOTH_NETGRAPH
45
+	self->trans.self.rfcomm.rfcomm_family = AF_BLUETOOTH;
46
+	bacpy(&self->trans.self.rfcomm.rfcomm_bdaddr, src);
47
+	self->trans.self.rfcomm.rfcomm_channel = channel;
48
+#else /*HAVE_BLUETOOTH_NETGRAPH*/
49
 	self->trans.self.rfcomm.rc_family = AF_BLUETOOTH;
50
 	bacpy(&self->trans.self.rfcomm.rc_bdaddr, src);
51
 	self->trans.self.rfcomm.rc_channel = channel;
52
+#endif /*HAVE_BLUETOOTH_NETGRAPH*/
53
 #endif /* _WIN32 */
54
 }
55
 
56
@@ -106,9 +126,15 @@
57
 		return -1;
58
 	}
59
 	
60
+#ifdef HAVE_BLUETOOTH_NETGRAPH
61
+	if (bind(self->serverfd, (struct sockaddr*) &self->trans.self.rfcomm, 
62
+		 sizeof(struct sockaddr_rfcomm)))
63
+	{
64
+#else /*HAVE_BLUETOOTH_NETGRAPH*/
65
 	if (bind(self->serverfd, (struct sockaddr*) &self->trans.self.rfcomm, 
66
 		 sizeof(struct sockaddr_rc)))
67
 	{
68
+#endif /*HAVE_BLUETOOTH_NETGRAPH*/
69
 		DEBUG(0, "Error doing bind\n");
70
 		goto out_freesock;
71
 	}
72
@@ -140,7 +166,11 @@
73
 int btobex_accept(obex_t *self)
74
 {
75
 #ifndef _WIN32
76
+#ifdef HAVE_BLUETOOTH_NETGRAPH
77
+	socklen_t addrlen = sizeof(struct sockaddr_rfcomm);
78
+#else /*HAVE_BLUETOOTH_NETGRAPH*/
79
 	socklen_t addrlen = sizeof(struct sockaddr_rc);
80
+#endif /*HAVE_BLUETOOTH_NETGRAPH*/
81
 	//int mtu;
82
 	//int len = sizeof(int);
83
 
84
@@ -178,16 +208,26 @@
85
 			return -1;
86
 	}
87
 
88
+#ifdef HAVE_BLUETOOTH_NETGRAPH
89
+	ret = bind(self->fd, (struct sockaddr*) &self->trans.self.rfcomm,
90
+		   sizeof(struct sockaddr_rfcomm));
91
+#else /*HAVE_BLUETOOTH_NETGRAPH*/
92
 	ret = bind(self->fd, (struct sockaddr*) &self->trans.self.rfcomm,
93
 		   sizeof(struct sockaddr_rc));
94
+#endif /*HAVE_BLUETOOTH_NETGRAPH*/
95
 
96
 	if (ret < 0) {
97
 		DEBUG(4, "ret=%d\n", ret);
98
 		goto out_freesock;
99
 	}
100
 
101
+#ifdef HAVE_BLUETOOTH_NETGRAPH
102
+	ret = connect(self->fd, (struct sockaddr*) &self->trans.peer.rfcomm,
103
+		      sizeof(struct sockaddr_rfcomm));
104
+#else /*HAVE_BLUETOOTH_NETGRAPH*/
105
 	ret = connect(self->fd, (struct sockaddr*) &self->trans.peer.rfcomm,
106
 		      sizeof(struct sockaddr_rc));
107
+#endif /*HAVE_BLUETOOTH_NETGRAPH*/
108
 	if (ret < 0) {
109
 		DEBUG(4, "ret=%d\n", ret);
110
 		goto out_freesock;
(-)/root/tmp/openobex/files/patch-lib-databuffer.h (-11 lines)
Lines 1-11 Link Here
1
--- lib/databuffer.h.orig	Thu May  4 13:24:21 2006
2
+++ lib/databuffer.h	Sat Nov 25 22:02:38 2006
3
@@ -31,7 +31,7 @@
4
 #define DATABUFFER_H
5
 
6
 #define __need_size_t
7
-#include <stddef.h>
8
+#include <sys/types.h>
9
 #include <stdint.h>
10
 
11
 /*
(-)/root/tmp/openobex/files/patch-lib-obex.c (-26 lines)
Lines 1-26 Link Here
1
--- lib/obex.c.orig	Thu May 25 20:09:41 2006
2
+++ lib/obex.c	Sat Nov 25 22:04:07 2006
3
@@ -1031,7 +1031,11 @@
4
 
5
 #ifdef HAVE_BLUETOOTH
6
 	if(src == NULL)
7
+#ifdef HAVE_BLUETOOTH_NETGRAPH
8
+		src = NG_HCI_BDADDR_ANY;
9
+#else /*HAVE_BLUETOOTH_NETGRAPH*/
10
 		src = BDADDR_ANY;
11
+#endif /*HAVE_BLUETOOTH_NETGRAPH*/
12
 	btobex_prepare_listen(self, src, channel);
13
 	return obex_transport_listen(self);
14
 #else
15
@@ -1061,7 +1065,11 @@
16
 
17
 #ifdef HAVE_BLUETOOTH
18
 	if(src == NULL)
19
+#ifdef HAVE_BLUETOOTH_NETGRAPH
20
+		src = NG_HCI_BDADDR_ANY;
21
+#else /*HAVE_BLUETOOTH_NETGRAPH*/
22
 		src = BDADDR_ANY;
23
+#endif /*HAVE_BLUETOOTH_NETGRAPH*/
24
 	btobex_prepare_connect(self, src, dst, channel);
25
 	return obex_transport_connect_request(self);
26
 #else
(-)/root/tmp/openobex/files/patch-lib-obex_main.c (-26 lines)
Lines 1-26 Link Here
1
--- lib/obex_main.c.orig	Thu May  4 13:24:21 2006
2
+++ lib/obex_main.c	Sat Nov 25 22:32:59 2006
3
@@ -46,7 +46,11 @@
4
 #include <stdio.h>
5
 
6
 #ifdef HAVE_BLUETOOTH
7
+#ifdef HAVE_BLUETOOTH_NETGRAPH
8
+#include <bluetooth.h>
9
+#else /*HAVE_BLUETOOTH_NETGRAPH*/
10
 #include <bluetooth/bluetooth.h>
11
+#endif /*HAVE_BLUETOOTH_NETGRAPH*/
12
 #endif /*HAVE_BLUETOOTH*/
13
 
14
 #endif /* _WIN32 */
15
@@ -80,7 +84,11 @@
16
 
17
 #ifdef HAVE_BLUETOOTH
18
 	if (domain == AF_BLUETOOTH)
19
+#ifdef HAVE_BLUETOOTH_NETGRAPH
20
+		proto = BLUETOOTH_PROTO_RFCOMM;
21
+#else /*HAVE_BLUETOOTH_NETGRAPH*/
22
 		proto = BTPROTO_RFCOMM;
23
+#endif /*HAVE_BLUETOOTH_NETGRAPH*/
24
 #endif /*HAVE_BLUETOOTH*/
25
 
26
 	fd = socket(domain, SOCK_STREAM, proto);
(-)/root/tmp/openobex/files/patch-lib-obex_transport.h (-27 lines)
Lines 1-27 Link Here
1
--- lib/obex_transport.h.orig	Thu May  4 13:24:21 2006
2
+++ lib/obex_transport.h	Sat Nov 25 22:34:03 2006
3
@@ -40,8 +40,12 @@
4
 #include "irda_wrap.h"
5
 #endif /*HAVE_IRDA*/
6
 #ifdef HAVE_BLUETOOTH
7
+#ifdef HAVE_BLUETOOTH_NETGRAPH
8
+#include <bluetooth.h>
9
+#else /*HAVE_BLUETOOTH_NETGRAPH*/
10
 #include <bluetooth/bluetooth.h>
11
 #include <bluetooth/rfcomm.h>
12
+#endif /*HAVE_BLUETOOTH_NETGRAPH*/
13
 #endif /*HAVE_BLUETOOTH*/
14
 #ifdef HAVE_USB
15
 #include "usbobex.h"
16
@@ -55,7 +59,11 @@
17
 #endif /*HAVE_IRDA*/
18
 	struct sockaddr_in   inet;
19
 #ifdef HAVE_BLUETOOTH
20
+#ifdef HAVE_BLUETOOTH_NETGRAPH
21
+	struct sockaddr_rfcomm   rfcomm;
22
+#else /*HAVE_BLUETOOTH_NETGRAPH*/
23
 	struct sockaddr_rc   rfcomm;
24
+#endif /*HAVE_BLUETOOTH_NETGRAPH*/
25
 #endif /*HAVE_BLUETOOTH*/
26
 #ifdef HAVE_USB
27
 	struct obex_usb_intf_transport_t usb;
(-)/root/tmp/openobex/files/patch-ltmain.sh (-42 lines)
Lines 1-42 Link Here
1
--- ltmain.sh.orig	Wed Oct  1 13:17:13 2003
2
+++ ltmain.sh	Mon Mar 22 10:54:43 2004
3
@@ -1037,8 +1037,16 @@
4
 	continue
5
 	;;
6
 
7
+      -pthread)
8
+      compile_command="$compile_command -pthread"
9
+      finalize_command="$finalize_command -pthread"
10
+      compiler_flags="$compiler_flags -pthread"
11
+      continue
12
+      ;;
13
+
14
       -module)
15
 	module=yes
16
+	build_old_libs=no
17
 	continue
18
 	;;
19
 
20
@@ -2408,6 +2416,9 @@
21
 	  *-*-netbsd*)
22
 	    # Don't link with libc until the a.out ld.so is fixed.
23
 	    ;;
24
+	  *-*-freebsd*)
25
+	    # FreeBSD doesn't need this...
26
+	    ;;
27
 	  *)
28
 	    # Add libc to deplibs on all other systems if necessary.
29
 	    if test "$build_libtool_need_lc" = "yes"; then
30
@@ -4175,10 +4186,12 @@
31
 	fi
32
 
33
 	# Install the pseudo-library for information purposes.
34
+	if /usr/bin/false; then
35
 	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
36
 	instname="$dir/$name"i
37
 	$show "$install_prog $instname $destdir/$name"
38
 	$run eval "$install_prog $instname $destdir/$name" || exit $?
39
+	fi
40
 
41
 	# Maybe install the static library, too.
42
 	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
(-)/root/tmp/openobex/files/patch-usb (+65 lines)
Line 0 Link Here
1
--- lib/usbobex.c	2008-11-07 14:36:09.000000000 +0200
2
+++ lib/usbobex.c	2008-11-19 02:47:39.000000000 +0200
3
@@ -392,25 +392,8 @@
4
 
5
 	DEBUG(4, "\n");
6
 
7
-	self->trans.self.usb.dev_control = usb_open(self->trans.self.usb.device);
8
 	self->trans.self.usb.dev_data = usb_open(self->trans.self.usb.device);
9
 
10
-	ret = usb_set_configuration(self->trans.self.usb.dev_control, self->trans.self.usb.configuration);
11
-	if (ret < 0)
12
-		DEBUG(4, "Can't set configuration %d", ret);
13
-
14
-	ret = usb_claim_interface(self->trans.self.usb.dev_control, self->trans.self.usb.control_interface);
15
-	if (ret < 0) {
16
-		DEBUG(4, "Can't claim control interface %d", ret);
17
-		goto err1;
18
-	}
19
-
20
-	ret = usb_set_altinterface(self->trans.self.usb.dev_control, self->trans.self.usb.control_setting);
21
-	if (ret < 0) {
22
-		DEBUG(4, "Can't set control setting %d", ret);
23
-		goto err2;
24
-	}
25
-
26
 	ret = usb_claim_interface(self->trans.self.usb.dev_data, self->trans.self.usb.data_interface);
27
 	if (ret < 0) {
28
 		DEBUG(4, "Can't claim data interface %d", ret);
29
@@ -430,10 +413,8 @@
30
 err3:
31
 	usb_release_interface(self->trans.self.usb.dev_data, self->trans.self.usb.data_interface);
32
 err2:
33
-	usb_release_interface(self->trans.self.usb.dev_control, self->trans.self.usb.control_interface);
34
 err1:
35
 	usb_close(self->trans.self.usb.dev_data);
36
-	usb_close(self->trans.self.usb.dev_control);
37
 	return ret;
38
 }
39
 
40
@@ -450,21 +431,19 @@
41
 		return 0;
42
 
43
 	DEBUG(4, "\n");
44
+
45
+	usb_clear_halt(self->trans.self.usb.dev_data, self->trans.self.usb.data_endpoint_read);
46
+	usb_clear_halt(self->trans.self.usb.dev_data, self->trans.self.usb.data_endpoint_write);
47
+
48
 	ret = usb_set_altinterface(self->trans.self.usb.dev_data, self->trans.self.usb.data_idle_setting);
49
 	if (ret < 0)
50
 		DEBUG(4, "Can't set data idle setting %d", ret);
51
 	ret = usb_release_interface(self->trans.self.usb.dev_data, self->trans.self.usb.data_interface);
52
 	if (ret < 0)
53
 		DEBUG(4, "Can't release data interface %d", ret);
54
-	ret = usb_release_interface(self->trans.self.usb.dev_control, self->trans.self.usb.control_interface);
55
-	if (ret < 0)
56
-		DEBUG(4, "Can't release control interface %d", ret);
57
 	ret = usb_close(self->trans.self.usb.dev_data);
58
 	if (ret < 0)
59
 		DEBUG(4, "Can't close data interface %d", ret);
60
-	ret = usb_close(self->trans.self.usb.dev_control);
61
-	if (ret < 0)
62
-		DEBUG(4, "Can't close control interface %d", ret);
63
 
64
 	return ret;
65
 }
(-)/root/tmp/openobex/pkg-descr (-1 / +1 lines)
Lines 3-8 Link Here
3
session protocol and can best be described as a binary HTTP protocol.
3
session protocol and can best be described as a binary HTTP protocol.
4
It's used mainly for Infrared and Bluetooth communication.
4
It's used mainly for Infrared and Bluetooth communication.
5
5
6
WWW:	http://openobex.sourceforge.net/
6
WWW:	http://www.bluez.org/openobex/
7
7
8
- Guido Falsi <mad@madpilot.net>
8
- Guido Falsi <mad@madpilot.net>
(-)/root/tmp/openobex/pkg-plist (-2 / +1 lines)
Lines 1-9 Link Here
1
include/openobex/obex.h
1
include/openobex/obex.h
2
include/openobex/obex_const.h
2
include/openobex/obex_const.h
3
lib/libopenobex.so.4
3
lib/libopenobex.so.5
4
lib/libopenobex.a
4
lib/libopenobex.a
5
lib/libopenobex.la
5
lib/libopenobex.la
6
lib/libopenobex.so
6
lib/libopenobex.so
7
libdata/pkgconfig/openobex.pc
7
libdata/pkgconfig/openobex.pc
8
share/aclocal/openobex.m4
9
@dirrm include/openobex
8
@dirrm include/openobex

Return to bug 128979