Now it's work with my Nokia N72 I can sending, receiving and deleting file and list files in a folder.
I have only tested USB connection. Please test it. Thanks, BSDManiak
diff -urN /usr/ports/devel/libusb/Makefile devel/libusb/Makefile --- /usr/ports/devel/libusb/Makefile Sun Sep 16 04:53:01 2007 +++ devel/libusb/Makefile Sun Jul 13 01:20:59 2008 @@ -2,6 +2,7 @@ COMMENT= USB access library +PKGNAME= ${DISTNAME}p0 DISTNAME= libusb-0.1.12 SHARED_LIBS= usb 9.0 \ usbpp 10.0 @@ -26,6 +27,7 @@ SEPARATE_BUILD= concurrent CONFIGURE_STYLE= gnu CONFIGURE_ARGS+= ${CONFIGURE_SHARED} \ - --disable-build-docs + --disable-build-docs \ + --enable-debug=yes .include <bsd.port.mk> diff -urN /usr/ports/devel/libusb/patches/bsd_c devel/libusb/patches/bsd_c --- /usr/ports/devel/libusb/patches/bsd_c Thu Jan 1 01:00:00 1970 +++ devel/libusb/patches/bsd_c Sat Jul 5 03:01:08 2008 @@ -0,0 +1,87 @@ +$OpenBSD: patch-bsd_c,v 1.7 2006/11/15 18:34:13 pvalchev Exp $ +--- bsd.c.orig Sat Mar 4 03:52:46 2006 ++++ bsd.c Sat Jul 5 03:01:03 2008 +@@ -361,7 +361,7 @@ int usb_bulk_read(usb_dev_handle *dev, int ep, char *b + int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) + { +- int fd, ret, sent = 0; ++ int fd, ret; + + /* Ensure the endpoint address is correct */ + ep &= ~USB_ENDPOINT_IN; +@@ -383,8 +383,7 @@ int usb_interrupt_write(usb_dev_handle *dev, int ep, c + USB_ERROR_STR(-errno, "error setting timeout: %s", + strerror(errno)); + +- do { +- ret = write(fd, bytes+sent, size-sent); ++ ret = write(fd, bytes, size); + if (ret < 0) + #ifdef __FreeBSD_kernel__ + USB_ERROR_STR(-errno, "error writing to interrupt endpoint %s.%d: %s", +@@ -394,16 +393,13 @@ int usb_interrupt_write(usb_dev_handle *dev, int ep, c + dev->device->filename, UE_GET_ADDR(ep), strerror(errno)); + #endif + +- sent += ret; +- } while (ret > 0 && sent < size); +- +- return sent; ++ return ret; + } + + int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) + { +- int fd, ret, retrieved = 0, one = 1; ++ int fd, ret, one = 1; + + /* Ensure the endpoint address is correct */ + ep |= USB_ENDPOINT_IN; +@@ -428,8 +424,7 @@ int usb_interrupt_read(usb_dev_handle *dev, int ep, ch + if (ret < 0) + USB_ERROR_STR(-errno, "error setting short xfer: %s", strerror(errno)); + +- do { +- ret = read(fd, bytes+retrieved, size-retrieved); ++ ret = read(fd, bytes, size); + if (ret < 0) + #ifdef __FreeBSD_kernel__ + USB_ERROR_STR(-errno, "error reading from interrupt endpoint %s.%d: %s", +@@ -438,10 +433,7 @@ int usb_interrupt_read(usb_dev_handle *dev, int ep, ch + USB_ERROR_STR(-errno, "error reading from interrupt endpoint %s.%02d: %s", + dev->device->filename, UE_GET_ADDR(ep), strerror(errno)); + #endif +- retrieved += ret; +- } while (ret > 0 && retrieved < size); +- +- return retrieved; ++ return ret; + } + + int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, +@@ -527,12 +519,12 @@ int usb_os_find_devices(struct usb_bus *bus, struct us + int cfd, dfd; + int device; + +- cfd = open(bus->dirname, O_RDONLY); ++ cfd = open(bus->dirname, O_RDWR); + if (cfd < 0) + USB_ERROR_STR(-errno, "couldn't open(%s): %s", bus->dirname, + strerror(errno)); + +- for (device = 1; device < USB_MAX_DEVICES; device++) { ++ for (device = 0; device < USB_MAX_DEVICES; device++) { + struct usb_device_info di; + struct usb_device *dev; + unsigned char device_desc[DEVICE_DESC_LENGTH]; +@@ -555,7 +547,7 @@ int usb_os_find_devices(struct usb_bus *bus, struct us + #endif + + /* Open its control endpoint */ +- dfd = open(buf, O_RDONLY); ++ dfd = open(buf, O_RDWR); + if (dfd < 0) { + if (usb_debug >= 2) + fprintf(stderr, "usb_os_find_devices: couldn't open device %s: %s\n", diff -urN /usr/ports/devel/libusb/patches/patch-bsd_c devel/libusb/patches/patch-bsd_c --- /usr/ports/devel/libusb/patches/patch-bsd_c Wed Nov 15 19:34:13 2006 +++ devel/libusb/patches/patch-bsd_c Fri Jul 11 23:37:59 2008 @@ -1,7 +1,16 @@ $OpenBSD: patch-bsd_c,v 1.7 2006/11/15 18:34:13 pvalchev Exp $ ---- bsd.c.orig Fri Mar 3 19:52:46 2006 -+++ bsd.c Tue Nov 14 21:00:00 2006 -@@ -361,7 +361,7 @@ int usb_bulk_read(usb_dev_handle *dev, i +--- bsd.c.orig Sat Mar 4 03:52:46 2006 ++++ bsd.c Fri Jul 11 23:37:56 2008 +@@ -325,7 +325,7 @@ int usb_bulk_read(usb_dev_handle *dev, int ep, char *b + /* Ensure the endpoint address is correct */ + ep |= USB_ENDPOINT_IN; + +- fd = ensure_ep_open(dev, ep, O_RDONLY); ++ fd = ensure_ep_open(dev, ep, O_RDONLY | O_NONBLOCK); + if (fd < 0) { + if (usb_debug >= 2) { + #ifdef __FreeBSD_kernel__ +@@ -361,7 +361,7 @@ int usb_bulk_read(usb_dev_handle *dev, int ep, char *b int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, int timeout) { @@ -10,7 +19,7 @@ /* Ensure the endpoint address is correct */ ep &= ~USB_ENDPOINT_IN; -@@ -383,8 +383,7 @@ int usb_interrupt_write(usb_dev_handle * +@@ -383,8 +383,7 @@ int usb_interrupt_write(usb_dev_handle *dev, int ep, c USB_ERROR_STR(-errno, "error setting timeout: %s", strerror(errno)); @@ -20,7 +29,7 @@ if (ret < 0) #ifdef __FreeBSD_kernel__ USB_ERROR_STR(-errno, "error writing to interrupt endpoint %s.%d: %s", -@@ -394,16 +393,13 @@ int usb_interrupt_write(usb_dev_handle * +@@ -394,16 +393,13 @@ int usb_interrupt_write(usb_dev_handle *dev, int ep, c dev->device->filename, UE_GET_ADDR(ep), strerror(errno)); #endif @@ -39,7 +48,7 @@ /* Ensure the endpoint address is correct */ ep |= USB_ENDPOINT_IN; -@@ -428,8 +424,7 @@ int usb_interrupt_read(usb_dev_handle *d +@@ -428,8 +424,7 @@ int usb_interrupt_read(usb_dev_handle *dev, int ep, ch if (ret < 0) USB_ERROR_STR(-errno, "error setting short xfer: %s", strerror(errno)); @@ -49,7 +58,7 @@ if (ret < 0) #ifdef __FreeBSD_kernel__ USB_ERROR_STR(-errno, "error reading from interrupt endpoint %s.%d: %s", -@@ -438,10 +433,7 @@ int usb_interrupt_read(usb_dev_handle *d +@@ -438,10 +433,7 @@ int usb_interrupt_read(usb_dev_handle *dev, int ep, ch USB_ERROR_STR(-errno, "error reading from interrupt endpoint %s.%02d: %s", dev->device->filename, UE_GET_ADDR(ep), strerror(errno)); #endif diff -urN /usr/ports/devel/libusb/patches/patch-usb_c devel/libusb/patches/patch-usb_c --- /usr/ports/devel/libusb/patches/patch-usb_c Thu Jan 1 01:00:00 1970 +++ devel/libusb/patches/patch-usb_c Fri Jul 11 20:14:36 2008 @@ -0,0 +1,46 @@ +$OpenBSD$ +--- usb.c.orig Fri Jul 11 20:11:38 2008 ++++ usb.c Fri Jul 11 20:13:40 2008 +@@ -219,12 +219,36 @@ usb_dev_handle *usb_open(struct usb_device *dev) + int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, + size_t buflen) + { +- /* +- * We can't use usb_get_descriptor() because it's lacking the index +- * parameter. This will be fixed in libusb 1.0 +- */ +- return usb_control_msg(dev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, +- (USB_DT_STRING << 8) + index, langid, buf, buflen, 1000); ++ struct usb_string_descriptor *desc = (struct usb_string_descriptor *)buf; ++ int res; ++ ++ res = usb_control_msg(dev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, ++ (USB_DT_STRING << 8) + index, langid, buf, 4, 1000); ++ if (res < 4) { ++ if (usb_debug >= 1) { ++ if (res < 0) ++ fprintf(stderr, "Unable to get descriptor (%d)\n", res); ++ else ++ fprintf(stderr, "String descriptor too short (expected %d, got %d)\n", 8, res); ++ } ++ ++ return res; ++ } ++ ++ res = usb_control_msg(dev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, ++ (USB_DT_STRING << 8) + index, langid, buf, desc->bLength, 1000); ++ if (res < desc->bLength) { ++ if (usb_debug >= 1) { ++ if (res < 0) ++ fprintf(stderr, "Unable to get descriptor (%d)\n", res); ++ else ++ fprintf(stderr, "String descriptor too short (expected %d, got %d)\n", desc->bLength, res); ++ } ++ ++ return res; ++ } ++ ++ return res; + } + + int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, size_t buflen)
diff -urN /usr/ports/comms/obexftp/Makefile comms/obexftp/Makefile --- /usr/ports/comms/obexftp/Makefile Sun Sep 16 03:37:09 2007 +++ comms/obexftp/Makefile Sun Jul 20 21:30:33 2008 @@ -1,11 +1,10 @@ # $OpenBSD: Makefile,v 1.9 2007/09/16 01:37:09 merdely Exp $ COMMENT= file copying over the OBEX protocol -DISTNAME= obexftp-0.10.4 -PKGNAME= ${DISTNAME}p1 -SHARED_LIBS += bfb 0.4 # .0.4 -SHARED_LIBS += cobexbfb 0.8 # .0.8 +DISTNAME= obexftp-0.22 +SHARED_LIBS += bfb 0.8 # .0.8 SHARED_LIBS += obexftp 0.11 # .0.11 +SHARED_LIBS += multicobex 1.1 CATEGORIES= comms HOMEPAGE= http://triq.net/obex/ @@ -15,13 +14,20 @@ PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes -WANTLIB= c +WANTLIB= c m usb MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=openobex/} -LIB_DEPENDS= openobex.>=1::comms/openobex +LIB_DEPENDS= openobex.>=1::comms/openobex \ + ruby.>=1::lang/ruby \ + iconv.>=5::converters/libiconv CONFIGURE_STYLE= gnu USE_LIBTOOL= Yes +USE_GMAKE= Yes + +MODULES= lang/ruby + +EXTRACT_SUFX= .tar.bz2 .include <bsd.port.mk> diff -urN /usr/ports/comms/obexftp/distinfo comms/obexftp/distinfo --- /usr/ports/comms/obexftp/distinfo Thu Apr 5 17:37:47 2007 +++ comms/obexftp/distinfo Fri Jul 4 20:54:22 2008 @@ -1,5 +1,5 @@ -MD5 (obexftp-0.10.4.tar.gz) = oBuYPmQISBImBdkCK1E9tw== -RMD160 (obexftp-0.10.4.tar.gz) = 6vXGjvo++0a9TC4AphKMsXXEutU= -SHA1 (obexftp-0.10.4.tar.gz) = YYVBpjkCXxL99tkuCNPSYnIyKxQ= -SHA256 (obexftp-0.10.4.tar.gz) = gUAkvGYHGFZF0sA43yVJLTQLIokC9GhFTTtoFd5fdNM= -SIZE (obexftp-0.10.4.tar.gz) = 374317 +MD5 (obexftp-0.22.tar.bz2) = 0WfP3qJE46X5c6exaGRBnA== +RMD160 (obexftp-0.22.tar.bz2) = o5YP0VzXXPtwZsVl7p+pDcenwR8= +SHA1 (obexftp-0.22.tar.bz2) = h1OuEFNlOwHrDe7jt9McAqykl00= +SHA256 (obexftp-0.22.tar.bz2) = CWhwEtXgFid/pjjyK4x4SupoAwVscNFGFOO3UViq6Hc= +SIZE (obexftp-0.22.tar.bz2) = 402570 diff -urN /usr/ports/comms/obexftp/patches/patch-configure comms/obexftp/patches/patch-configure --- /usr/ports/comms/obexftp/patches/patch-configure Thu Jan 1 01:00:00 1970 +++ comms/obexftp/patches/patch-configure Fri Jul 4 21:59:29 2008 @@ -0,0 +1,11 @@ +$OpenBSD$ +--- configure.orig Fri Jul 4 21:56:31 2008 ++++ configure Fri Jul 4 21:59:19 2008 +@@ -22915,6 +22915,7 @@ cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + ++ #include <sys/types.h> + #include <openobex/obex.h> + #include <openobex/obex_const.h> + diff -urN /usr/ports/comms/obexftp/patches/patch-obexftp_client_c comms/obexftp/patches/patch-obexftp_client_c --- /usr/ports/comms/obexftp/patches/patch-obexftp_client_c Fri Nov 12 09:06:54 2004 +++ comms/obexftp/patches/patch-obexftp_client_c Thu Jan 1 01:00:00 1970 @@ -1,45 +0,0 @@ -$OpenBSD: patch-obexftp_client_c,v 1.1.1.1 2004/11/12 08:06:54 grange Exp $ ---- obexftp/client.c.orig Thu Apr 29 23:44:07 2004 -+++ obexftp/client.c Mon Nov 8 23:13:21 2004 -@@ -78,6 +78,7 @@ - #endif - #endif - -+#include <limits.h> - - typedef struct { /* fixed to 6 bytes for now */ - uint8_t code; -@@ -427,10 +428,10 @@ int obexftp_cli_connect(obexftp_client_t - - } - #endif -- if (ret == -1 /* -ESOCKTNOSUPPORT */) -+ if (ret < 0 /* -ESOCKTNOSUPPORT */) - ret = IrOBEX_TransportConnect(cli->obexhandle, "OBEX"); - DEBUG(3, "%s() IR %d\n", __func__, ret); -- if (ret == -1 /* -ESOCKTNOSUPPORT */) -+ if (ret < 0 /* -ESOCKTNOSUPPORT */) - ret = OBEX_TransportConnect(cli->obexhandle, NULL, 0); - DEBUG(3, "%s() TC %d\n", __func__, ret); - #endif -@@ -899,6 +900,9 @@ static time_t atotime (const char *date) - - DIR *obexftp_opendir(obexftp_client_t *cli, const char *name) - { -+ struct dirstream *stream; -+ int res; -+ - /* purge stat buffer */ - while (statbuf != NULL) { - STATENTRY *p = statbuf->next; -@@ -908,8 +912,8 @@ DIR *obexftp_opendir(obexftp_client_t *c - statbuf = NULL; - - /* read dir */ -- struct dirstream *stream = malloc(sizeof(struct dirstream)); -- int res = 0; -+ stream = malloc(sizeof(struct dirstream)); -+ res = 0; - - /* List folder */ - res = obexftp_list(cli, NULL, name); diff -urN /usr/ports/comms/obexftp/patches/patch-obexftp_dirtraverse_c comms/obexftp/patches/patch-obexftp_dirtraverse_c --- /usr/ports/comms/obexftp/patches/patch-obexftp_dirtraverse_c Fri Nov 12 09:06:54 2004 +++ comms/obexftp/patches/patch-obexftp_dirtraverse_c Thu Jan 1 01:00:00 1970 @@ -1,11 +0,0 @@ -$OpenBSD: patch-obexftp_dirtraverse_c,v 1.1.1.1 2004/11/12 08:06:54 grange Exp $ ---- obexftp/dirtraverse.c.orig Wed Oct 20 22:11:21 2004 -+++ obexftp/dirtraverse.c Wed Oct 20 22:11:36 2004 -@@ -29,6 +29,7 @@ - #define _POSIX_PATH_MAX MAX_PATH - #endif /* _WIN32 */ - #include <dirent.h> -+#include <limits.h> - - #include "dirtraverse.h" - #include <common.h> diff -urN /usr/ports/comms/obexftp/patches/patch-obexftp_obexftp_io_c comms/obexftp/patches/patch-obexftp_obexftp_io_c --- /usr/ports/comms/obexftp/patches/patch-obexftp_obexftp_io_c Fri Nov 12 09:06:54 2004 +++ comms/obexftp/patches/patch-obexftp_obexftp_io_c Thu Jan 1 01:00:00 1970 @@ -1,11 +0,0 @@ -$OpenBSD: patch-obexftp_obexftp_io_c,v 1.1.1.1 2004/11/12 08:06:54 grange Exp $ ---- obexftp/obexftp_io.c.orig Wed Oct 20 22:10:20 2004 -+++ obexftp/obexftp_io.c Wed Oct 20 22:10:53 2004 -@@ -26,6 +26,7 @@ - #include <sys/stat.h> - - #include <fcntl.h> -+#include <limits.h> - #include <string.h> - #include <time.h> - diff -urN /usr/ports/comms/obexftp/pkg/PFRAG.shared comms/obexftp/pkg/PFRAG.shared --- /usr/ports/comms/obexftp/pkg/PFRAG.shared Fri Dec 23 15:16:01 2005 +++ comms/obexftp/pkg/PFRAG.shared Sat Jul 19 16:05:23 2008 @@ -1,4 +1,6 @@ [EMAIL PROTECTED] $OpenBSD: PFRAG.shared,v 1.2 2005/12/23 14:16:01 bernd Exp $ [EMAIL PROTECTED] $OpenBSD$ @lib lib/libbfb.so.${LIBbfb_VERSION} [EMAIL PROTECTED] lib/libcobexbfb.so.${LIBcobexbfb_VERSION} [EMAIL PROTECTED] lib/libmulticobex.so.${LIBmulticobex_VERSION} @lib lib/libobexftp.so.${LIBobexftp_VERSION} +lib/ruby/site_ruby/${MODRUBY_REV}/${MODRUBY_ARCH}/obexftp.so +libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/auto/OBEXFTP/OBEXFTP.so diff -urN /usr/ports/comms/obexftp/pkg/PLIST comms/obexftp/pkg/PLIST --- /usr/ports/comms/obexftp/pkg/PLIST Fri Nov 12 09:06:54 2004 +++ comms/obexftp/pkg/PLIST Sat Jul 19 15:59:17 2008 @@ -1,20 +1,32 @@ [EMAIL PROTECTED] $OpenBSD: PLIST,v 1.1.1.1 2004/11/12 08:06:54 grange Exp $ [EMAIL PROTECTED] $OpenBSD$ %%SHARED%% -bin/obexftp -bin/obexftpd [EMAIL PROTECTED] bin/obexftp [EMAIL PROTECTED] bin/obexftpd include/bfb/ include/bfb/bfb.h include/bfb/bfb_io.h -include/cobexbfb/ -include/cobexbfb/cobex_bfb.h +include/multicobex/ +include/multicobex/multi_cobex.h include/obexftp/ include/obexftp/client.h include/obexftp/obexftp.h include/obexftp/object.h +include/obexftp/uuid.h lib/libbfb.a lib/libbfb.la -lib/libcobexbfb.a -lib/libcobexbfb.la +lib/libmulticobex.a +lib/libmulticobex.la lib/libobexftp.a lib/libobexftp.la +lib/pkgconfig/ +lib/pkgconfig/obexftp.pc +libdata/perl5/${MACHINE_ARCH}-openbsd/ +libdata/perl5/${MACHINE_ARCH}-openbsd/5.8.8/ +libdata/perl5/${MACHINE_ARCH}-openbsd/5.8.8/perllocal.pod +libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/ +libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/OBEXFTP.pm +libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/auto/ +libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/auto/OBEXFTP/ +libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/auto/OBEXFTP/OBEXFTP.bs @man man/man1/obexftp.1 [EMAIL PROTECTED] man/man1/obexftpd.1
diff -urN /usr/ports/comms/openobex/Makefile comms/openobex/Makefile --- /usr/ports/comms/openobex/Makefile Sun Sep 16 03:37:10 2007 +++ comms/openobex/Makefile Sun Jul 20 21:29:53 2008 @@ -1,9 +1,8 @@ # $OpenBSD: Makefile,v 1.10 2007/09/16 01:37:10 merdely Exp $ COMMENT= OBEX protocol implementation -DISTNAME= openobex-1.0.1 -PKGNAME= ${DISTNAME}p3 -SHARED_LIBS += openobex 1.0 # .1.0 +DISTNAME= openobex-1.3 +SHARED_LIBS+= openobex 1.0 # .1.0 CATEGORIES= comms HOMEPAGE= http://openobex.triq.net/ @@ -19,5 +18,10 @@ USE_GMAKE= Yes USE_LIBTOOL= Yes CONFIGURE_STYLE= gnu +CONFIGURE_ENV+= CFLAGS="-I${LOCALBASE}/include" + +LIB_DEPENDS= usb.>=9::devel/libusb +WRKSRC= ${WRKDIR}/${PKGNAME}/ +WRKDIST= ${WRKDIR}/${PKGNAME}/ .include <bsd.port.mk> diff -urN /usr/ports/comms/openobex/distinfo comms/openobex/distinfo --- /usr/ports/comms/openobex/distinfo Thu Apr 5 17:37:47 2007 +++ comms/openobex/distinfo Wed Jul 9 19:00:51 2008 @@ -1,5 +1,5 @@ -MD5 (openobex-1.0.1.tar.gz) = N0Jma7mCWfrOdr5Jtz6onQ== -RMD160 (openobex-1.0.1.tar.gz) = cNx9Lji4Ga8MNcyyb4BreqdoKw4= -SHA1 (openobex-1.0.1.tar.gz) = qnOz+eNFCI6PHAcODnJ/WGgg0g4= -SHA256 (openobex-1.0.1.tar.gz) = BmHBXotXhsmiINAlfKM5sU+94XTp60WWLuYFvfpNntg= -SIZE (openobex-1.0.1.tar.gz) = 211696 +MD5 (openobex-1.3.tar.gz) = /qpd/lFRwOcOj4aPpGSKQw== +RMD160 (openobex-1.3.tar.gz) = 84R04Xqv8Xmey19F3mqyPDvcjeA= +SHA1 (openobex-1.3.tar.gz) = pvu1mRvBS5C6bEL68Ca/a/oyXX8= +SHA256 (openobex-1.3.tar.gz) = OoC6JSTGakbbOsF6eIp1kBWh953mpJX83zoxbhn+fCM= +SIZE (openobex-1.3.tar.gz) = 337614 diff -urN /usr/ports/comms/openobex/patches/patch-configure comms/openobex/patches/patch-configure --- /usr/ports/comms/openobex/patches/patch-configure Thu Jan 1 01:00:00 1970 +++ comms/openobex/patches/patch-configure Wed Jul 9 19:14:57 2008 @@ -0,0 +1,21 @@ +$OpenBSD$ +--- configure.orig Wed Jul 9 19:13:40 2008 ++++ configure Wed Jul 9 19:14:52 2008 +@@ -9352,7 +9352,7 @@ if test "${ac_cv_lib_usb_usb_get_busses+set}" = set; t + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lusb $LIBS" ++LIBS="-L${prefix}/lib -lusb $LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -9425,7 +9425,7 @@ if test "${ac_cv_lib_usb_usb_interrupt_read+set}" = se + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lusb $LIBS" ++LIBS="-L${prefix}/lib -lusb $LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF diff -urN /usr/ports/comms/openobex/patches/patch-lib_obex_main_c comms/openobex/patches/patch-lib_obex_main_c --- /usr/ports/comms/openobex/patches/patch-lib_obex_main_c Thu Jan 1 01:00:00 1970 +++ comms/openobex/patches/patch-lib_obex_main_c Wed Jul 9 19:35:09 2008 @@ -0,0 +1,21 @@ +$OpenBSD$ +--- lib/obex_main.c.orig Thu May 4 13:24:21 2006 ++++ lib/obex_main.c Wed Jul 9 19:35:05 2008 +@@ -250,7 +250,7 @@ int obex_data_indication(obex_t *self, uint8_t *buf, i + DEBUG(4, "Got %d bytes\n", actual); + + /* Check if we are still connected */ +- if (actual <= 0) { ++ if (buf == NULL && buflen == 0 && actual <= 0) { + obex_deliver_event(self, OBEX_EV_LINKERR, 0, 0, TRUE); + return actual; + } +@@ -270,7 +270,7 @@ int obex_data_indication(obex_t *self, uint8_t *buf, i + buflen); + + /* Check if we are still connected */ +- if (actual <= 0) { ++ if (buf == NULL && buflen == 0 && actual <= 0) { + obex_deliver_event(self, OBEX_EV_LINKERR, 0, 0, TRUE); + return actual; + } diff -urN /usr/ports/comms/openobex/patches/patch-lib_obex_transport_c comms/openobex/patches/patch-lib_obex_transport_c --- /usr/ports/comms/openobex/patches/patch-lib_obex_transport_c Thu Jan 1 01:00:00 1970 +++ comms/openobex/patches/patch-lib_obex_transport_c Sat Jul 19 22:26:49 2008 @@ -0,0 +1,24 @@ +$OpenBSD$ +--- lib/obex_transport.c.orig Thu May 4 13:24:21 2006 ++++ lib/obex_transport.c Sat Jul 19 22:26:47 2008 +@@ -411,9 +411,8 @@ int obex_transport_write(obex_t *self, buf_t *msg) + if (self->trans.connected != TRUE) + break; + DEBUG(4, "Endpoint %d\n", self->trans.self.usb.data_endpoint_write); +- actual = usb_bulk_write(self->trans.self.usb.dev_data, +- self->trans.self.usb.data_endpoint_write, +- (char *) msg->data, msg->data_size, USB_OBEX_TIMEOUT); ++ actual = usb_bulk_write(self->trans.self.usb.dev, ++ self->trans.self.usb.data_endpoint_write, (char *) msg->data, msg->data_size, USB_OBEX_TIMEOUT); + break; + #endif /*HAVE_USB*/ + case OBEX_TRANS_CUSTOM: +@@ -460,7 +459,7 @@ int obex_transport_read(obex_t *self, int max, uint8_t + if (self->trans.connected != TRUE) + break; + DEBUG(4, "Endpoint %d\n", self->trans.self.usb.data_endpoint_read); +- actual = usb_bulk_read(self->trans.self.usb.dev_data, ++ actual = usb_bulk_read(self->trans.self.usb.dev, + self->trans.self.usb.data_endpoint_read, + buf_reserve_end(msg, self->mtu_rx), self->mtu_rx, + USB_OBEX_TIMEOUT); diff -urN /usr/ports/comms/openobex/patches/patch-lib_usbobex_c comms/openobex/patches/patch-lib_usbobex_c --- /usr/ports/comms/openobex/patches/patch-lib_usbobex_c Thu Jan 1 01:00:00 1970 +++ comms/openobex/patches/patch-lib_usbobex_c Sun Jul 20 21:00:53 2008 @@ -0,0 +1,187 @@ +$OpenBSD$ +--- lib/usbobex.c.orig Wed Jan 18 13:59:15 2006 ++++ lib/usbobex.c Sun Jul 20 21:00:49 2008 +@@ -66,28 +66,30 @@ static void find_eps(struct obex_usb_intf_transport_t + struct usb_endpoint_descriptor *ep0, *ep1; + + if (data_intf.bNumEndpoints == 2) { +- ep0 = data_intf.endpoint; +- ep1 = data_intf.endpoint + 1; +- if ((ep0->bEndpointAddress & USB_ENDPOINT_IN) && +- ((ep0->bmAttributes & USB_ENDPOINT_TYPE_MASK) == USB_ENDPOINT_TYPE_BULK) && +- !(ep1->bEndpointAddress & USB_ENDPOINT_IN) && +- ((ep1->bmAttributes & USB_ENDPOINT_TYPE_MASK) == USB_ENDPOINT_TYPE_BULK)) { +- *found_active = 1; +- intf->data_active_setting = data_intf.bAlternateSetting; +- intf->data_interface_active_description = data_intf.iInterface; +- intf->data_endpoint_read = ep0->bEndpointAddress; +- intf->data_endpoint_write = ep1->bEndpointAddress; +- } +- if (!(ep0->bEndpointAddress & USB_ENDPOINT_IN) && +- ((ep0->bmAttributes & USB_ENDPOINT_TYPE_MASK) == USB_ENDPOINT_TYPE_BULK) && +- (ep1->bEndpointAddress & USB_ENDPOINT_IN) && +- ((ep1->bmAttributes & USB_ENDPOINT_TYPE_MASK) == USB_ENDPOINT_TYPE_BULK)) { +- *found_active = 1; +- intf->data_active_setting = data_intf.bAlternateSetting; +- intf->data_interface_active_description = data_intf.iInterface; +- intf->data_endpoint_read = ep1->bEndpointAddress; +- intf->data_endpoint_write = ep0->bEndpointAddress; +- } ++ ep0 = data_intf.endpoint + 1; ++ ep1 = data_intf.endpoint; ++ if ((ep0->bEndpointAddress & USB_ENDPOINT_IN) && ++ ((ep0->bmAttributes & USB_ENDPOINT_TYPE_MASK) == USB_ENDPOINT_TYPE_BULK) && ++ !(ep1->bEndpointAddress & USB_ENDPOINT_IN) && ++ ((ep1->bmAttributes & USB_ENDPOINT_TYPE_MASK) == USB_ENDPOINT_TYPE_BULK)) { ++ *found_active = 1; ++ intf->data_active_setting = data_intf.bAlternateSetting; ++ intf->data_interface_active_description = data_intf.iInterface; ++ intf->data_endpoint_read = ep0->bEndpointAddress; ++ intf->data_endpoint_write = ep1->bEndpointAddress; ++ } ++ ++ if (!(ep0->bEndpointAddress & USB_ENDPOINT_IN) && ++ ((ep0->bmAttributes & USB_ENDPOINT_TYPE_MASK) == USB_ENDPOINT_TYPE_BULK) && ++ (ep1->bEndpointAddress & USB_ENDPOINT_IN) && ++ ((ep1->bmAttributes & USB_ENDPOINT_TYPE_MASK) == USB_ENDPOINT_TYPE_BULK)) { ++ *found_active = 1; ++ intf->data_active_setting = data_intf.bAlternateSetting; ++ intf->data_interface_active_description = data_intf.iInterface; ++ intf->data_endpoint_read = ep1->bEndpointAddress; ++ intf->data_endpoint_write = ep0->bEndpointAddress; ++ } ++ + } + if (data_intf.bNumEndpoints == 0) { + *found_idle = 1; +@@ -266,20 +268,35 @@ int usbobex_find_interfaces(obex_interface_t **interfa + while (current) { + intf_array[num].usb.interface = current; + usb_handle = usb_open(current->device); +- get_intf_string(usb_handle, &intf_array[num].usb.manufacturer, +- current->device->descriptor.iManufacturer); +- get_intf_string(usb_handle, &intf_array[num].usb.product, +- current->device->descriptor.iProduct); +- get_intf_string(usb_handle, &intf_array[num].usb.serial, +- current->device->descriptor.iSerialNumber); +- get_intf_string(usb_handle, &intf_array[num].usb.configuration, +- current->configuration_description); +- get_intf_string(usb_handle, &intf_array[num].usb.control_interface, +- current->control_interface_description); +- get_intf_string(usb_handle, &intf_array[num].usb.data_interface_idle, +- current->data_interface_idle_description); +- get_intf_string(usb_handle, &intf_array[num].usb.data_interface_active, +- current->data_interface_active_description); ++ ++ if (get_intf_string(usb_handle, &intf_array[num].usb.manufacturer, ++ current->device->descriptor.iManufacturer) < 0) ++ DEBUG(1, "Unable to fetch manufacturer string\n"); ++ ++ if (get_intf_string(usb_handle, &intf_array[num].usb.product, ++ current->device->descriptor.iProduct) < 0) ++ DEBUG(1, "Unable to fetch product string\n"); ++ ++ if (get_intf_string(usb_handle, &intf_array[num].usb.serial, ++ current->device->descriptor.iSerialNumber) < 0) ++ DEBUG(1, "Unable to fetch serial number string\n"); ++ ++ if (get_intf_string(usb_handle, &intf_array[num].usb.configuration, ++ current->configuration_description) < 0) ++ DEBUG(1, "Unable to fetch configuration string\n"); ++ ++ if (get_intf_string(usb_handle, &intf_array[num].usb.control_interface, ++ current->control_interface_description) < 0) ++ DEBUG(1, "Unable to fetch control interface string\n"); ++ ++ if (get_intf_string(usb_handle, &intf_array[num].usb.data_interface_idle, ++ current->data_interface_idle_description) < 0) ++ DEBUG(1, "Unable to fetch date interface idle string\n"); ++ ++ if (get_intf_string(usb_handle, &intf_array[num].usb.data_interface_active, ++ current->data_interface_active_description) < 0) ++ DEBUG(1, "Unable to fetch date interface active string\n"); ++ + usb_close(usb_handle); + current = current->next; num++; + } +@@ -331,48 +348,35 @@ int usbobex_connect_request(obex_t *self) + + 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); ++ self->trans.self.usb.dev = usb_open(self->trans.self.usb.device); + +- ret = usb_set_configuration(self->trans.self.usb.dev_control, self->trans.self.usb.configuration); ++ ret = usb_set_configuration(self->trans.self.usb.dev, self->trans.self.usb.configuration); + if (ret < 0) { +- DEBUG(4, "Can't set configuration %d", ret); ++ DEBUG(4, "Can't set configuration %d", ret); + } + +- ret = usb_claim_interface(self->trans.self.usb.dev_control, self->trans.self.usb.control_interface); ++ ret = usb_claim_interface(self->trans.self.usb.dev, self->trans.self.usb.data_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); ++ ret = usb_set_altinterface(self->trans.self.usb.dev, self->trans.self.usb.data_active_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); +- goto err2; +- } +- +- ret = usb_set_altinterface(self->trans.self.usb.dev_data, self->trans.self.usb.data_active_setting); +- if (ret < 0) { +- DEBUG(4, "Can't set data active setting %d", ret); +- goto err3; +- } + self->trans.mtu = OBEX_MAXIMUM_MTU; + DEBUG(2, "transport mtu=%d\n", self->trans.mtu); + return 1; + + err3: +- usb_release_interface(self->trans.self.usb.dev_data, self->trans.self.usb.data_interface); ++ usb_release_interface(self->trans.self.usb.dev, self->trans.self.usb.data_interface); + err2: +- usb_release_interface(self->trans.self.usb.dev_control, self->trans.self.usb.control_interface); ++ usb_release_interface(self->trans.self.usb.dev, self->trans.self.usb.control_interface); + err1: +- usb_close(self->trans.self.usb.dev_data); +- usb_close(self->trans.self.usb.dev_control); ++ usb_close(self->trans.self.usb.dev); + return ret; + + #endif /* _WIN32 */ +@@ -391,21 +395,12 @@ int usbobex_disconnect_request(obex_t *self) + return 0; + #ifndef _WIN32 + DEBUG(4, "\n"); +- 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); ++ ret = usb_release_interface(self->trans.self.usb.dev, 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); ++ ret = usb_close(self->trans.self.usb.dev); + 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); + #endif /* _WIN32 */ + return ret; + } diff -urN /usr/ports/comms/openobex/patches/patch-lib_usbobex_h comms/openobex/patches/patch-lib_usbobex_h --- /usr/ports/comms/openobex/patches/patch-lib_usbobex_h Thu Jan 1 01:00:00 1970 +++ comms/openobex/patches/patch-lib_usbobex_h Fri Jul 11 21:55:57 2008 @@ -0,0 +1,22 @@ +$OpenBSD$ +--- lib/usbobex.h.orig Tue Jan 3 19:36:15 2006 ++++ lib/usbobex.h Fri Jul 11 21:55:54 2008 +@@ -52,8 +52,7 @@ struct obex_usb_intf_transport_t { + * in active setting */ + int data_endpoint_read; /* OBEX data/slave interface read endpoint */ + int data_endpoint_write; /* OBEX data/slave interface write endpoint */ +- usb_dev_handle *dev_control; /* libusb handler for control interace */ +- usb_dev_handle *dev_data; /* libusb handler for data interface */ ++ usb_dev_handle *dev; /* libusb handler for control & data interface */ + }; + + /* "Union Functional Descriptor" from CDC spec 5.2.3.X +@@ -83,7 +82,7 @@ struct cdc_union_desc { + #define USB_DT_CS_INTERFACE 0x24 + #define CDC_DATA_INTERFACE_TYPE 0x0a + +-#define USB_MAX_STRING_SIZE 256 ++#define USB_MAX_STRING_SIZE 127 + #define USB_OBEX_TIMEOUT 10000 /* 10 seconds */ + + void usbobex_prepare_connect(obex_t *self, struct obex_usb_intf_transport_t *intf); diff -urN /usr/ports/comms/openobex/patches/patch-openobex-config_in comms/openobex/patches/patch-openobex-config_in --- /usr/ports/comms/openobex/patches/patch-openobex-config_in Fri Nov 12 09:04:22 2004 +++ comms/openobex/patches/patch-openobex-config_in Thu Jan 1 01:00:00 1970 @@ -1,20 +0,0 @@ -$OpenBSD: patch-openobex-config_in,v 1.1.1.1 2004/11/12 08:04:22 grange Exp $ ---- openobex-config.in.orig Wed Oct 20 22:18:55 2004 -+++ openobex-config.in Wed Oct 20 22:19:30 2004 -@@ -4,6 +4,7 @@ [EMAIL PROTECTED]@ - [EMAIL PROTECTED]@ - exec_prefix_set=no - [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ - - usage() - { -@@ -87,7 +88,7 @@ if $cflags; then - fi - - if $libs; then -- all_flags="$all_flags $services $the_libs -lopenobex" -+ all_flags="$all_flags $services $the_libs -L$libdir -lopenobex" - fi - - if test -z "$all_flags" || test "x$all_flags" = "x "; then diff -urN /usr/ports/comms/openobex/patches/patch-src_Makefile_in comms/openobex/patches/patch-src_Makefile_in --- /usr/ports/comms/openobex/patches/patch-src_Makefile_in Fri Nov 12 09:04:22 2004 +++ comms/openobex/patches/patch-src_Makefile_in Thu Jan 1 01:00:00 1970 @@ -1,12 +0,0 @@ -$OpenBSD: patch-src_Makefile_in,v 1.1.1.1 2004/11/12 08:04:22 grange Exp $ ---- src/Makefile.in.orig Fri Nov 12 10:51:50 2004 -+++ src/Makefile.in Fri Nov 12 10:52:19 2004 -@@ -95,7 +95,7 @@ lib_LTLIBRARIES = libopenobex.la - libopenobex_la_SOURCES = obex.c obex_main.c obex_main.h obex_connect.c obex_connect.h obex_header.c obex_header.h obex_object.c obex_object.h obex_transport.c obex_transport.h obex_server.c obex_server.h obex_client.c obex_client.h irobex.c irobex.h inobex.c inobex.h btobex.c btobex.h netbuf.c netbuf.h irda.h irda_wrap.h - - --libopenobex_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) -export-symbols $(top_srcdir)/src/obex.sym -+libopenobex_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -export-symbols $(top_srcdir)/src/obex.sym - - - INCLUDES = -I$(top_srcdir)/src diff -urN /usr/ports/comms/openobex/patches/patch-src_irda_h comms/openobex/patches/patch-src_irda_h --- /usr/ports/comms/openobex/patches/patch-src_irda_h Fri Nov 12 09:04:22 2004 +++ comms/openobex/patches/patch-src_irda_h Thu Jan 1 01:00:00 1970 @@ -1,13 +0,0 @@ -$OpenBSD: patch-src_irda_h,v 1.1.1.1 2004/11/12 08:04:22 grange Exp $ ---- src/irda.h.orig Wed Oct 20 21:47:28 2004 -+++ src/irda.h Wed Oct 20 21:47:46 2004 -@@ -26,7 +26,9 @@ - #define IRDA_H - - #include <sys/types.h> -+#ifndef __OpenBSD__ - #include <stdint.h> -+#endif - - /* Hint bit positions for first hint byte */ - #define HINT_PNP 0x01 diff -urN /usr/ports/comms/openobex/patches/patch-src_netbuf_h comms/openobex/patches/patch-src_netbuf_h --- /usr/ports/comms/openobex/patches/patch-src_netbuf_h Fri Nov 12 09:04:22 2004 +++ comms/openobex/patches/patch-src_netbuf_h Thu Jan 1 01:00:00 1970 @@ -1,15 +0,0 @@ -$OpenBSD: patch-src_netbuf_h,v 1.1.1.1 2004/11/12 08:04:22 grange Exp $ ---- src/netbuf.h.orig Wed Oct 20 21:48:32 2004 -+++ src/netbuf.h Wed Oct 20 21:48:55 2004 -@@ -37,7 +37,11 @@ - #ifndef G_NETBUF_H - #define G_NETBUF_H - -+#ifndef __OpenBSD__ - #include <stdint.h> -+#else -+#include <sys/types.h> -+#endif - - typedef struct _slist_t{ - void *data; diff -urN /usr/ports/comms/openobex/patches/patch-src_obex_const_h comms/openobex/patches/patch-src_obex_const_h --- /usr/ports/comms/openobex/patches/patch-src_obex_const_h Fri Nov 12 09:04:22 2004 +++ comms/openobex/patches/patch-src_obex_const_h Thu Jan 1 01:00:00 1970 @@ -1,15 +0,0 @@ -$OpenBSD: patch-src_obex_const_h,v 1.1.1.1 2004/11/12 08:04:22 grange Exp $ ---- src/obex_const.h.orig Wed Oct 20 21:46:41 2004 -+++ src/obex_const.h Wed Oct 20 21:47:01 2004 -@@ -30,7 +30,11 @@ - #ifndef OBEX_CONST_H - #define OBEX_CONST_H - -+#ifndef __OpenBSD__ - #include <stdint.h> -+#else -+#include <sys/types.h> -+#endif - - typedef union { - uint32_t bq4; diff -urN /usr/ports/comms/openobex/patches/patch-src_obex_h comms/openobex/patches/patch-src_obex_h --- /usr/ports/comms/openobex/patches/patch-src_obex_h Fri Nov 12 09:04:22 2004 +++ comms/openobex/patches/patch-src_obex_h Thu Jan 1 01:00:00 1970 @@ -1,15 +0,0 @@ -$OpenBSD: patch-src_obex_h,v 1.1.1.1 2004/11/12 08:04:22 grange Exp $ ---- src/obex.h.orig Wed Oct 20 21:47:57 2004 -+++ src/obex.h Wed Oct 20 21:48:22 2004 -@@ -30,7 +30,11 @@ - #ifndef OBEX_H - #define OBEX_H - -+#ifndef __OpenBSD__ - #include <stdint.h> -+#else -+#include <sys/types.h> -+#endif - - #ifdef _WIN32 - #include <winsock.h> diff -urN /usr/ports/comms/openobex/pkg/PLIST comms/openobex/pkg/PLIST --- /usr/ports/comms/openobex/pkg/PLIST Fri Nov 12 09:04:22 2004 +++ comms/openobex/pkg/PLIST Fri Jul 11 17:13:42 2008 @@ -1,10 +1,11 @@ @comment $OpenBSD: PLIST,v 1.1.1.1 2004/11/12 08:04:22 grange Exp $ %%SHARED%% -bin/openobex-config include/openobex/ include/openobex/obex.h include/openobex/obex_const.h lib/libopenobex.a lib/libopenobex.la +lib/pkgconfig/ +lib/pkgconfig/openobex.pc share/aclocal/ share/aclocal/openobex.m4