From 41b7677280b1e27c6289292b6d5ee52c7a0e2078 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Wed, 19 Nov 2008 22:44:31 +0000 Subject: - Update to 1.4 - Add USB support (adopted from ports/128776) PR: 128979 Submitted by: Alex Samorukov Approved by: Guido Falsi (maintainer) --- comms/openobex/Makefile | 33 ++++--- comms/openobex/distinfo | 6 +- comms/openobex/files/patch-aclocal.m4 | 40 --------- comms/openobex/files/patch-bt | 12 +++ comms/openobex/files/patch-configure.in | 10 --- comms/openobex/files/patch-lib-btobex.c | 110 ------------------------ comms/openobex/files/patch-lib-databuffer.h | 11 --- comms/openobex/files/patch-lib-obex.c | 26 ------ comms/openobex/files/patch-lib-obex_main.c | 26 ------ comms/openobex/files/patch-lib-obex_transport.h | 27 ------ comms/openobex/files/patch-ltmain.sh | 42 --------- comms/openobex/files/patch-usb | 65 ++++++++++++++ comms/openobex/pkg-descr | 2 +- comms/openobex/pkg-plist | 3 +- 14 files changed, 101 insertions(+), 312 deletions(-) delete mode 100644 comms/openobex/files/patch-aclocal.m4 create mode 100644 comms/openobex/files/patch-bt delete mode 100644 comms/openobex/files/patch-configure.in delete mode 100644 comms/openobex/files/patch-lib-btobex.c delete mode 100644 comms/openobex/files/patch-lib-databuffer.h delete mode 100644 comms/openobex/files/patch-lib-obex.c delete mode 100644 comms/openobex/files/patch-lib-obex_main.c delete mode 100644 comms/openobex/files/patch-lib-obex_transport.h delete mode 100644 comms/openobex/files/patch-ltmain.sh create mode 100644 comms/openobex/files/patch-usb (limited to 'comms') diff --git a/comms/openobex/Makefile b/comms/openobex/Makefile index 740d06858df9..790d2a2ef3e6 100644 --- a/comms/openobex/Makefile +++ b/comms/openobex/Makefile @@ -6,24 +6,29 @@ # PORTNAME= openobex -PORTVERSION= 1.3 -PORTREVISION= 1 +PORTVERSION= 1.4 CATEGORIES= comms net -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} -MASTER_SITE_SUBDIR= ${PORTNAME} +MASTER_SITES= http://www.kernel.org/pub/linux/bluetooth/ \ + http://www.de.kernel.org/pub/linux/bluetooth/ MAINTAINER= mad@madpilot.net COMMENT= Open source implementation of the OBEX protocol -USE_AUTOTOOLS= automake:14:env autoheader:262 autoconf:262 libtool:15 -USE_GMAKE= yes -USE_LDCONFIG= yes -GNU_CONFIGURE= yes -CONFIGURE_ARGS+= --program-transform-name="" \ - --disable-usb +USE_GMAKE= yes +USE_LDCONFIG= yes +GNU_CONFIGURE= yes +USE_GNOME= gnomehack -post-patch: - @ ${REINPLACE_CMD} -e "s|pkgconfigdir =.*|pkgconfigdir = ${PREFIX}/libdata/pkgconfig|g" \ - ${WRKSRC}/Makefile.in +OPTIONS= LIBUSB "Enable OBEX over USB" no -.include +.include + +.if defined(WITH_LIBUSB) +LIB_DEPENDS+= usb-0.1.8:${PORTSDIR}/devel/libusb +CONFIGURE_ARGS+=--enable-usb +CFLAGS+= -I${PREFIX}/include +.else +CONFIGURE_ARGS+=--disable-usb +.endif + +.include diff --git a/comms/openobex/distinfo b/comms/openobex/distinfo index cbe7ef0f79ed..a7c6022bf06b 100644 --- a/comms/openobex/distinfo +++ b/comms/openobex/distinfo @@ -1,3 +1,3 @@ -MD5 (openobex-1.3.tar.gz) = feaa5dfe5151c0e70e8f868fa4648a43 -SHA256 (openobex-1.3.tar.gz) = 3a80ba2524c66a46db3ac17a788a759015a1f79de6a495fcdf3a316e19fe7c23 -SIZE (openobex-1.3.tar.gz) = 337614 +MD5 (openobex-1.4.tar.gz) = 572a52ac423434a3290c5f867eed362d +SHA256 (openobex-1.4.tar.gz) = 79265309e2320beb03910fccf27fd04aefb18ba47a900947d2de8e88fae05cd8 +SIZE (openobex-1.4.tar.gz) = 393756 diff --git a/comms/openobex/files/patch-aclocal.m4 b/comms/openobex/files/patch-aclocal.m4 deleted file mode 100644 index 161e4bbfb0a2..000000000000 --- a/comms/openobex/files/patch-aclocal.m4 +++ /dev/null @@ -1,40 +0,0 @@ ---- aclocal.m4.orig Wed Jun 14 15:58:25 2006 -+++ aclocal.m4 Sat Nov 25 21:55:24 2006 -@@ -6914,6 +6914,37 @@ - # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. - AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) - -+ -+dnl adding a check for FreeBSD blutooth netgraph support. -+ -+AC_DEFUN([FREEBSD_BLUETOOTH_HOOK],[ -+ AC_MSG_CHECKING([for the FreeBSD/netgraph bluetooth support]) -+ echo -+ AC_CHECK_LIB(bluetooth, bt_aton, -+ [AC_CACHE_CHECK(for the struct sockaddr_rfcomm in , ac_cv_have_sockaddr_rfcomm, -+ [AC_TRY_COMPILE([#include -+ #include -+ #include -+ #include -+ #include -+ #include ], -+ [struct sockaddr_rfcomm rc;], -+ ac_cv_have_sockaddr_rfcomm=yes, -+ ac_cv_have_sockaddr_rfcomm=no)]) -+ -+ if test $ac_cv_have_sockaddr_rfcomm = yes; then -+ AC_DEFINE(HAVE_BLUETOOTH) -+ AC_DEFINE(HAVE_BLUETOOTH_NETGRAPH,1,[Compile on FreeBSD]) -+ USE_BLUETOOTH="yes" -+ LIBS="$LIBS -lbluetooth" -+ AC_DEFINE(HAVE_BT_ATON,1,[Define to 1 if you have the \`bt_aton' function.]) -+ fi -+])]) -+ -+AC_DEFUN([FREEBSD_BLUETOOTH_CHECK], [ -+ FREEBSD_BLUETOOTH_HOOK([],failure) -+]) -+ - # Do all the work for Automake. -*- Autoconf -*- - - # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 diff --git a/comms/openobex/files/patch-bt b/comms/openobex/files/patch-bt new file mode 100644 index 000000000000..d8e2749b3a5f --- /dev/null +++ b/comms/openobex/files/patch-bt @@ -0,0 +1,12 @@ +diff -ur lib/bluez_compat.h work.2/openobex-1.4/lib/bluez_compat.h +--- lib/bluez_compat.h 2008-11-07 14:36:09.000000000 +0200 ++++ lib/bluez_compat.h 2008-11-19 02:34:53.000000000 +0200 +@@ -53,6 +53,8 @@ + #define rc_family rfcomm_family + #define rc_bdaddr rfcomm_bdaddr + #define rc_channel rfcomm_channel ++#define BDADDR_ANY NG_HCI_BDADDR_ANY ++#define BTPROTO_RFCOMM BLUETOOTH_PROTO_RFCOMM + + #elif defined(HAVE_BLUETOOTH_NETBSD) + #include diff --git a/comms/openobex/files/patch-configure.in b/comms/openobex/files/patch-configure.in deleted file mode 100644 index 8d72db97db70..000000000000 --- a/comms/openobex/files/patch-configure.in +++ /dev/null @@ -1,10 +0,0 @@ ---- configure.in.orig Wed Jun 14 11:24:13 2006 -+++ configure.in Sat Nov 25 21:56:52 2006 -@@ -22,6 +22,7 @@ - AC_PATH_IRDA - AC_PATH_BLUEZ - AC_PATH_USB -+FREEBSD_BLUETOOTH_CHECK - - AC_ARG_OPENOBEX - diff --git a/comms/openobex/files/patch-lib-btobex.c b/comms/openobex/files/patch-lib-btobex.c deleted file mode 100644 index 48c54bd6e52e..000000000000 --- a/comms/openobex/files/patch-lib-btobex.c +++ /dev/null @@ -1,110 +0,0 @@ ---- lib/btobex.c.orig Tue Jan 3 20:36:15 2006 -+++ lib/btobex.c Sat Nov 25 22:00:13 2006 -@@ -46,8 +46,12 @@ - #include - #include - -+#ifdef HAVE_BLUETOOTH_NETGRAPH -+#include -+#else /*HAVE_BLUETOOTH_NETGRAPH*/ - #include - #include -+#endif /*HAVE_BLUETOOTH_NETGRAPH*/ - - #endif /* _WIN32 */ - -@@ -63,6 +67,15 @@ - void btobex_prepare_connect(obex_t *self, bdaddr_t *src, bdaddr_t *dst, uint8_t channel) - { - #ifndef _WIN32 -+#ifdef HAVE_BLUETOOTH_NETGRAPH -+ self->trans.self.rfcomm.rfcomm_family = AF_BLUETOOTH; -+ bacpy(&self->trans.self.rfcomm.rfcomm_bdaddr, src); -+ self->trans.self.rfcomm.rfcomm_channel = 0; -+ -+ self->trans.peer.rfcomm.rfcomm_family = AF_BLUETOOTH; -+ bacpy(&self->trans.peer.rfcomm.rfcomm_bdaddr, dst); -+ self->trans.peer.rfcomm.rfcomm_channel = channel; -+#else /*HAVE_BLUETOOTH_NETGRAPH*/ - self->trans.self.rfcomm.rc_family = AF_BLUETOOTH; - bacpy(&self->trans.self.rfcomm.rc_bdaddr, src); - self->trans.self.rfcomm.rc_channel = 0; -@@ -70,6 +83,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 /*HAVE_BLUETOOTH_NETGRAPH*/ - #endif /* _WIN32 */ - } - -@@ -83,9 +97,15 @@ - { - #ifndef _WIN32 - /* Bind local service */ -+#ifdef HAVE_BLUETOOTH_NETGRAPH -+ self->trans.self.rfcomm.rfcomm_family = AF_BLUETOOTH; -+ bacpy(&self->trans.self.rfcomm.rfcomm_bdaddr, src); -+ self->trans.self.rfcomm.rfcomm_channel = channel; -+#else /*HAVE_BLUETOOTH_NETGRAPH*/ - self->trans.self.rfcomm.rc_family = AF_BLUETOOTH; - bacpy(&self->trans.self.rfcomm.rc_bdaddr, src); - self->trans.self.rfcomm.rc_channel = channel; -+#endif /*HAVE_BLUETOOTH_NETGRAPH*/ - #endif /* _WIN32 */ - } - -@@ -106,9 +126,15 @@ - return -1; - } - -+#ifdef HAVE_BLUETOOTH_NETGRAPH -+ if (bind(self->serverfd, (struct sockaddr*) &self->trans.self.rfcomm, -+ sizeof(struct sockaddr_rfcomm))) -+ { -+#else /*HAVE_BLUETOOTH_NETGRAPH*/ - if (bind(self->serverfd, (struct sockaddr*) &self->trans.self.rfcomm, - sizeof(struct sockaddr_rc))) - { -+#endif /*HAVE_BLUETOOTH_NETGRAPH*/ - DEBUG(0, "Error doing bind\n"); - goto out_freesock; - } -@@ -140,7 +166,11 @@ - int btobex_accept(obex_t *self) - { - #ifndef _WIN32 -+#ifdef HAVE_BLUETOOTH_NETGRAPH -+ socklen_t addrlen = sizeof(struct sockaddr_rfcomm); -+#else /*HAVE_BLUETOOTH_NETGRAPH*/ - socklen_t addrlen = sizeof(struct sockaddr_rc); -+#endif /*HAVE_BLUETOOTH_NETGRAPH*/ - //int mtu; - //int len = sizeof(int); - -@@ -178,16 +208,26 @@ - return -1; - } - -+#ifdef HAVE_BLUETOOTH_NETGRAPH -+ ret = bind(self->fd, (struct sockaddr*) &self->trans.self.rfcomm, -+ sizeof(struct sockaddr_rfcomm)); -+#else /*HAVE_BLUETOOTH_NETGRAPH*/ - ret = bind(self->fd, (struct sockaddr*) &self->trans.self.rfcomm, - sizeof(struct sockaddr_rc)); -+#endif /*HAVE_BLUETOOTH_NETGRAPH*/ - - if (ret < 0) { - DEBUG(4, "ret=%d\n", ret); - goto out_freesock; - } - -+#ifdef HAVE_BLUETOOTH_NETGRAPH -+ ret = connect(self->fd, (struct sockaddr*) &self->trans.peer.rfcomm, -+ sizeof(struct sockaddr_rfcomm)); -+#else /*HAVE_BLUETOOTH_NETGRAPH*/ - ret = connect(self->fd, (struct sockaddr*) &self->trans.peer.rfcomm, - sizeof(struct sockaddr_rc)); -+#endif /*HAVE_BLUETOOTH_NETGRAPH*/ - if (ret < 0) { - DEBUG(4, "ret=%d\n", ret); - goto out_freesock; diff --git a/comms/openobex/files/patch-lib-databuffer.h b/comms/openobex/files/patch-lib-databuffer.h deleted file mode 100644 index 748a56b268f9..000000000000 --- a/comms/openobex/files/patch-lib-databuffer.h +++ /dev/null @@ -1,11 +0,0 @@ ---- lib/databuffer.h.orig Thu May 4 13:24:21 2006 -+++ lib/databuffer.h Sat Nov 25 22:02:38 2006 -@@ -31,7 +31,7 @@ - #define DATABUFFER_H - - #define __need_size_t --#include -+#include - #include - - /* diff --git a/comms/openobex/files/patch-lib-obex.c b/comms/openobex/files/patch-lib-obex.c deleted file mode 100644 index c52760c8eb56..000000000000 --- a/comms/openobex/files/patch-lib-obex.c +++ /dev/null @@ -1,26 +0,0 @@ ---- lib/obex.c.orig Thu May 25 20:09:41 2006 -+++ lib/obex.c Sat Nov 25 22:04:07 2006 -@@ -1031,7 +1031,11 @@ - - #ifdef HAVE_BLUETOOTH - if(src == NULL) -+#ifdef HAVE_BLUETOOTH_NETGRAPH -+ src = NG_HCI_BDADDR_ANY; -+#else /*HAVE_BLUETOOTH_NETGRAPH*/ - src = BDADDR_ANY; -+#endif /*HAVE_BLUETOOTH_NETGRAPH*/ - btobex_prepare_listen(self, src, channel); - return obex_transport_listen(self); - #else -@@ -1061,7 +1065,11 @@ - - #ifdef HAVE_BLUETOOTH - if(src == NULL) -+#ifdef HAVE_BLUETOOTH_NETGRAPH -+ src = NG_HCI_BDADDR_ANY; -+#else /*HAVE_BLUETOOTH_NETGRAPH*/ - src = BDADDR_ANY; -+#endif /*HAVE_BLUETOOTH_NETGRAPH*/ - btobex_prepare_connect(self, src, dst, channel); - return obex_transport_connect_request(self); - #else diff --git a/comms/openobex/files/patch-lib-obex_main.c b/comms/openobex/files/patch-lib-obex_main.c deleted file mode 100644 index 763ea35f5cd6..000000000000 --- a/comms/openobex/files/patch-lib-obex_main.c +++ /dev/null @@ -1,26 +0,0 @@ ---- lib/obex_main.c.orig Thu May 4 13:24:21 2006 -+++ lib/obex_main.c Sat Nov 25 22:32:59 2006 -@@ -46,7 +46,11 @@ - #include - - #ifdef HAVE_BLUETOOTH -+#ifdef HAVE_BLUETOOTH_NETGRAPH -+#include -+#else /*HAVE_BLUETOOTH_NETGRAPH*/ - #include -+#endif /*HAVE_BLUETOOTH_NETGRAPH*/ - #endif /*HAVE_BLUETOOTH*/ - - #endif /* _WIN32 */ -@@ -80,7 +84,11 @@ - - #ifdef HAVE_BLUETOOTH - if (domain == AF_BLUETOOTH) -+#ifdef HAVE_BLUETOOTH_NETGRAPH -+ proto = BLUETOOTH_PROTO_RFCOMM; -+#else /*HAVE_BLUETOOTH_NETGRAPH*/ - proto = BTPROTO_RFCOMM; -+#endif /*HAVE_BLUETOOTH_NETGRAPH*/ - #endif /*HAVE_BLUETOOTH*/ - - fd = socket(domain, SOCK_STREAM, proto); diff --git a/comms/openobex/files/patch-lib-obex_transport.h b/comms/openobex/files/patch-lib-obex_transport.h deleted file mode 100644 index a7edc88b1366..000000000000 --- a/comms/openobex/files/patch-lib-obex_transport.h +++ /dev/null @@ -1,27 +0,0 @@ ---- lib/obex_transport.h.orig Thu May 4 13:24:21 2006 -+++ lib/obex_transport.h Sat Nov 25 22:34:03 2006 -@@ -40,8 +40,12 @@ - #include "irda_wrap.h" - #endif /*HAVE_IRDA*/ - #ifdef HAVE_BLUETOOTH -+#ifdef HAVE_BLUETOOTH_NETGRAPH -+#include -+#else /*HAVE_BLUETOOTH_NETGRAPH*/ - #include - #include -+#endif /*HAVE_BLUETOOTH_NETGRAPH*/ - #endif /*HAVE_BLUETOOTH*/ - #ifdef HAVE_USB - #include "usbobex.h" -@@ -55,7 +59,11 @@ - #endif /*HAVE_IRDA*/ - struct sockaddr_in inet; - #ifdef HAVE_BLUETOOTH -+#ifdef HAVE_BLUETOOTH_NETGRAPH -+ struct sockaddr_rfcomm rfcomm; -+#else /*HAVE_BLUETOOTH_NETGRAPH*/ - struct sockaddr_rc rfcomm; -+#endif /*HAVE_BLUETOOTH_NETGRAPH*/ - #endif /*HAVE_BLUETOOTH*/ - #ifdef HAVE_USB - struct obex_usb_intf_transport_t usb; diff --git a/comms/openobex/files/patch-ltmain.sh b/comms/openobex/files/patch-ltmain.sh deleted file mode 100644 index 8f7f0ee0ed86..000000000000 --- a/comms/openobex/files/patch-ltmain.sh +++ /dev/null @@ -1,42 +0,0 @@ ---- ltmain.sh.orig Wed Oct 1 13:17:13 2003 -+++ ltmain.sh Mon Mar 22 10:54:43 2004 -@@ -1037,8 +1037,16 @@ - continue - ;; - -+ -pthread) -+ compile_command="$compile_command -pthread" -+ finalize_command="$finalize_command -pthread" -+ compiler_flags="$compiler_flags -pthread" -+ continue -+ ;; -+ - -module) - module=yes -+ build_old_libs=no - continue - ;; - -@@ -2408,6 +2416,9 @@ - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; -+ *-*-freebsd*) -+ # FreeBSD doesn't need this... -+ ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then -@@ -4175,10 +4186,12 @@ - fi - - # Install the pseudo-library for information purposes. -+ if /usr/bin/false; then - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? -+ fi - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" diff --git a/comms/openobex/files/patch-usb b/comms/openobex/files/patch-usb new file mode 100644 index 000000000000..3b592f3e8427 --- /dev/null +++ b/comms/openobex/files/patch-usb @@ -0,0 +1,65 @@ +--- lib/usbobex.c 2008-11-07 14:36:09.000000000 +0200 ++++ lib/usbobex.c 2008-11-19 02:47:39.000000000 +0200 +@@ -392,25 +392,8 @@ + + DEBUG(4, "\n"); + +- self->trans.self.usb.dev_control = usb_open(self->trans.self.usb.device); + self->trans.self.usb.dev_data = usb_open(self->trans.self.usb.device); + +- ret = usb_set_configuration(self->trans.self.usb.dev_control, self->trans.self.usb.configuration); +- if (ret < 0) +- DEBUG(4, "Can't set configuration %d", ret); +- +- ret = usb_claim_interface(self->trans.self.usb.dev_control, self->trans.self.usb.control_interface); +- if (ret < 0) { +- DEBUG(4, "Can't claim control interface %d", ret); +- goto err1; +- } +- +- ret = usb_set_altinterface(self->trans.self.usb.dev_control, self->trans.self.usb.control_setting); +- if (ret < 0) { +- DEBUG(4, "Can't set control setting %d", ret); +- goto err2; +- } +- + ret = usb_claim_interface(self->trans.self.usb.dev_data, self->trans.self.usb.data_interface); + if (ret < 0) { + DEBUG(4, "Can't claim data interface %d", ret); +@@ -430,10 +413,8 @@ + err3: + usb_release_interface(self->trans.self.usb.dev_data, self->trans.self.usb.data_interface); + err2: +- usb_release_interface(self->trans.self.usb.dev_control, self->trans.self.usb.control_interface); + err1: + usb_close(self->trans.self.usb.dev_data); +- usb_close(self->trans.self.usb.dev_control); + return ret; + } + +@@ -450,21 +431,19 @@ + return 0; + + DEBUG(4, "\n"); ++ ++ usb_clear_halt(self->trans.self.usb.dev_data, self->trans.self.usb.data_endpoint_read); ++ usb_clear_halt(self->trans.self.usb.dev_data, self->trans.self.usb.data_endpoint_write); ++ + ret = usb_set_altinterface(self->trans.self.usb.dev_data, self->trans.self.usb.data_idle_setting); + if (ret < 0) + DEBUG(4, "Can't set data idle setting %d", ret); + ret = usb_release_interface(self->trans.self.usb.dev_data, self->trans.self.usb.data_interface); + if (ret < 0) + DEBUG(4, "Can't release data interface %d", ret); +- ret = usb_release_interface(self->trans.self.usb.dev_control, self->trans.self.usb.control_interface); +- if (ret < 0) +- DEBUG(4, "Can't release control interface %d", ret); + ret = usb_close(self->trans.self.usb.dev_data); + if (ret < 0) + DEBUG(4, "Can't close data interface %d", ret); +- ret = usb_close(self->trans.self.usb.dev_control); +- if (ret < 0) +- DEBUG(4, "Can't close control interface %d", ret); + + return ret; + } diff --git a/comms/openobex/pkg-descr b/comms/openobex/pkg-descr index 59e1960fde87..ffdbc8f2663d 100644 --- a/comms/openobex/pkg-descr +++ b/comms/openobex/pkg-descr @@ -3,6 +3,6 @@ implementation of the Object Exchange (OBEX) protocol. OBEX is a session protocol and can best be described as a binary HTTP protocol. It's used mainly for Infrared and Bluetooth communication. -WWW: http://openobex.sourceforge.net/ +WWW: http://www.bluez.org/openobex/ - Guido Falsi diff --git a/comms/openobex/pkg-plist b/comms/openobex/pkg-plist index 168250fecd3c..7d0a601c4332 100644 --- a/comms/openobex/pkg-plist +++ b/comms/openobex/pkg-plist @@ -1,9 +1,8 @@ include/openobex/obex.h include/openobex/obex_const.h -lib/libopenobex.so.4 +lib/libopenobex.so.5 lib/libopenobex.a lib/libopenobex.la lib/libopenobex.so libdata/pkgconfig/openobex.pc -share/aclocal/openobex.m4 @dirrm include/openobex -- cgit v1.2.3