ports/128589: [maintainer-update] comms/gnokii update to 0.6.27

Guido Falsi mad at madpilot.net
Tue Nov 4 22:10:02 UTC 2008


>Number:         128589
>Category:       ports
>Synopsis:       [maintainer-update] comms/gnokii update to 0.6.27
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 04 22:10:02 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Guido Falsi
>Release:        FreeBSD 7.1-PRERELEASE i386
>Organization:
none
>Environment:
System: FreeBSD megatron.madpilot.net 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #11: Sun Sep 14 13:46:56 CEST 2008 root at megatron.madpilot.net:/usr/obj/usr/src/sys/MEGATRON i386

>Description:

Upgrade to 0.6.27.

added file:
files/patch-common-devices-unixbluetooth.c

This one contains a rewrite of one of the functions to interface
it with bluetooth sdp.

Sent it to original author for inclusion. Since I'm not an experienced
c programmer any check on this code is welcome.

I wrote it with help from the people at the bluetooth at freebsd.org
mailing list, Especially Maksim Yevmenkin and Iain Hibbert, and
taking ideas from FreeBSD's bluetooth stack source code.

>How-To-Repeat:
>Fix:

diff -ruN gnokii.old/Makefile gnokii/Makefile
--- gnokii.old/Makefile	2008-10-06 22:32:36.000000000 +0200
+++ gnokii/Makefile	2008-10-06 22:33:43.000000000 +0200
@@ -6,8 +6,7 @@
 #
 
 PORTNAME=	gnokii
-PORTVERSION=	0.6.26
-PORTREVISION=	3
+PORTVERSION=	0.6.27
 PORTEPOCH=	1
 CATEGORIES=	comms
 MASTER_SITES=	http://www.gnokii.org/download/gnokii/ \
diff -ruN gnokii.old/distinfo gnokii/distinfo
--- gnokii.old/distinfo	2008-10-06 22:32:36.000000000 +0200
+++ gnokii/distinfo	2008-10-06 22:33:43.000000000 +0200
@@ -1,3 +1,3 @@
-MD5 (gnokii-0.6.26.tar.bz2) = 60f817d8ce748fea0ec9a05b3537e08d
-SHA256 (gnokii-0.6.26.tar.bz2) = 35242b5545ced25383ac8c771b602c15b5585063c3637a23c9ef0a31d3e591ea
-SIZE (gnokii-0.6.26.tar.bz2) = 1446615
+MD5 (gnokii-0.6.27.tar.bz2) = fd0ae7996a2e2a2c29e9f3c625df8f3d
+SHA256 (gnokii-0.6.27.tar.bz2) = 69f1d75f755a2918e9577cf28dacea9d6fca9b9d722813341d50d12acb8ee886
+SIZE (gnokii-0.6.27.tar.bz2) = 1491564
diff -ruN gnokii.old/files/patch-common-devices-unixbluetooth.c gnokii/files/patch-common-devices-unixbluetooth.c
--- gnokii.old/files/patch-common-devices-unixbluetooth.c	1970-01-01 01:00:00.000000000 +0100
+++ gnokii/files/patch-common-devices-unixbluetooth.c	2008-11-04 22:31:28.000000000 +0100
@@ -0,0 +1,321 @@
+--- common/devices/unixbluetooth.c.orig	2008-10-05 12:14:31.000000000 +0200
++++ common/devices/unixbluetooth.c	2008-11-04 22:30:35.000000000 +0100
+@@ -54,6 +54,8 @@
+ #include <netgraph/bluetooth/include/ng_hci.h>
+ #include <netgraph/bluetooth/include/ng_l2cap.h>
+ #include <netgraph/bluetooth/include/ng_btsocket.h>
++#include <bluetooth.h>
++#include <sdp.h>
+ 
+ #define BTPROTO_RFCOMM BLUETOOTH_PROTO_RFCOMM
+ #define BDADDR_ANY NG_HCI_BDADDR_ANY
+@@ -86,11 +88,6 @@
+ 
+ #endif	/* HAVE_BT_ATON */
+ 
+-static int str2ba(const char *str, bdaddr_t *ba)
+-{
+-	return !bt_aton(str, ba);
+-}
+-
+ #else	/* Linux / BlueZ support */
+ 
+ #include <bluetooth/bluetooth.h>
+@@ -100,6 +97,272 @@
+ 
+ #endif
+ 
++#ifdef HAVE_BLUETOOTH_NETGRAPH	/* FreeBSD / netgraph */
++
++/*
++** FreeBSD version of the find_service_channel function.
++** Written by Guido Falsi <mad at madpilot.net>.
++** Contains code taken from FreeBSD's sdpcontrol and rfcomm_sppd
++** programs, which are Copyright (c) 2001-2003 Maksim Yevmenkin
++** <m_evmenkin at yahoo.com>.
++*/
++
++static int find_service_channel(bdaddr_t *adapter, bdaddr_t *device, int only_gnapplet, uint16_t svclass_id)
++{
++	uint8_t getchan = 0;
++	uint32_t i, good = 0;
++	char name[64];
++	void *ss = NULL;
++
++	uint32_t attrs[] =
++	{
++		SDP_ATTR_RANGE( SDP_ATTR_PRIMARY_LANGUAGE_BASE_ID + SDP_ATTR_SERVICE_NAME_OFFSET,
++			SDP_ATTR_PRIMARY_LANGUAGE_BASE_ID + SDP_ATTR_SERVICE_NAME_OFFSET),
++		SDP_ATTR_RANGE( SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST,
++			SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST),
++	};
++	#define attrs_len	(sizeof(attrs)/sizeof(attrs[0]))
++
++	/* Buffer for the attributes */
++	#define NRECS   25      /* request this much records from the SDP server */
++	#define BSIZE   256     /* one attribute buffer size */
++	static uint8_t          buffer[NRECS * attrs_len][BSIZE];
++
++	/* SDP attributes */
++	static sdp_attr_t       values[NRECS * attrs_len];
++	#define values_len      (sizeof(values)/sizeof(values[0]))
++
++	/* Initialize attribute values array */
++	for (i = 0; i < values_len; i ++) {
++		values[i].flags = SDP_ATTR_INVALID;
++		values[i].attr = 0;
++		values[i].vlen = BSIZE; 
++		values[i].value = buffer[i];
++	}
++
++	if ((ss = sdp_open(adapter, device)) == NULL)
++		return -1;
++
++	if (sdp_error(ss) != 0)
++	{
++		sdp_close(ss);
++		return -1;
++	}
++
++	if (sdp_search(ss, 1, &svclass_id, attrs_len, attrs, values_len, values) != 0)
++	{
++		sdp_close(ss);
++		return -1;
++	}
++
++	for (i = 0; i < values_len; i++)
++	{
++		if (values[i].flags != SDP_ATTR_OK)
++			break;
++
++		union {
++			uint8_t		uint8;
++			uint16_t	uint16;
++			uint32_t	uint32;
++			uint64_t	uint64;
++			int128_t	int128;
++		}			value;
++		uint8_t *start, *end;
++		uint32_t type, len;
++
++		start = values[i].value;
++		end = values[i].value + values[i].vlen;
++
++		switch (values[i].attr) {
++		case SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST:
++			if(getchan) {
++				SDP_GET8(type, start);
++				switch (type) {
++				case SDP_DATA_SEQ8:
++					SDP_GET8(len, start);
++					break;
++
++				case SDP_DATA_SEQ16:
++					SDP_GET16(len, start);
++					break;
++
++				case SDP_DATA_SEQ32:
++					SDP_GET32(len, start);
++					break;
++
++				default:
++					sdp_close(ss);
++					return -1;
++					break;
++				}
++
++				SDP_GET8(type, start);
++				switch (type) {
++				case SDP_DATA_SEQ8:
++					SDP_GET8(len, start);
++					break;
++
++				case SDP_DATA_SEQ16:
++					SDP_GET16(len, start);
++					break;
++
++				case SDP_DATA_SEQ32:
++					SDP_GET32(len, start);
++					break;
++
++				default:
++					sdp_close(ss);
++					return -1;
++					break;
++				}
++
++				while (start < end) {
++					SDP_GET8(type, start);
++					switch (type) {
++					case SDP_DATA_UUID16:
++						SDP_GET16(value.uint16, start);
++						break;
++
++					case SDP_DATA_UUID32:
++						SDP_GET32(value.uint32, start);
++						break;
++
++					case SDP_DATA_UUID128:
++						SDP_GET_UUID128(&value.int128, start);
++						break;
++
++					default:
++						sdp_close(ss);
++						return -1;
++						break;
++					}
++					if(value.uint16 == 3) {
++						SDP_GET8(type, start);
++						switch (type) {
++						case SDP_DATA_UINT8:
++						case SDP_DATA_INT8:
++							SDP_GET8(value.uint8, start);
++							return value.uint8;
++							break;
++
++						case SDP_DATA_UINT16:
++						case SDP_DATA_INT16:
++							SDP_GET16(value.uint16, start);
++							return value.uint16;
++							break;
++
++						case SDP_DATA_UINT32:
++						case SDP_DATA_INT32:
++							SDP_GET32(value.uint32, start);
++							return value.uint32;
++							break;
++
++						default:
++							sdp_close(ss);
++							return -1;
++							break;
++						}
++					} else {
++						SDP_GET8(type, start);
++						switch (type) {
++						case SDP_DATA_SEQ8:
++						case SDP_DATA_UINT8:
++						case SDP_DATA_INT8:
++						case SDP_DATA_BOOL:
++							SDP_GET8(value.uint8, start);
++							break;
++
++						case SDP_DATA_SEQ16:
++						case SDP_DATA_UINT16:
++						case SDP_DATA_INT16:
++						case SDP_DATA_UUID16:
++							SDP_GET16(value.uint16, start);
++							break;
++
++						case SDP_DATA_SEQ32:
++						case SDP_DATA_UINT32:
++						case SDP_DATA_INT32:
++						case SDP_DATA_UUID32:
++							SDP_GET32(value.uint32, start);
++							break;
++
++						case SDP_DATA_UINT64:
++						case SDP_DATA_INT64:
++							SDP_GET64(value.uint64, start);
++							break;
++
++						case SDP_DATA_UINT128:
++						case SDP_DATA_INT128:
++							SDP_GET128(&value.int128, start);
++							break;
++
++						default:
++							sdp_close(ss);
++							return -1;
++							break;
++						}
++					}
++				}
++			}
++			start += len;
++			break;
++
++		case SDP_ATTR_PRIMARY_LANGUAGE_BASE_ID + SDP_ATTR_SERVICE_NAME_OFFSET:
++			SDP_GET8(type, start);
++			switch (type) {
++				case SDP_DATA_STR8:
++				case SDP_DATA_URL8:
++					SDP_GET8(len, start);
++					snprintf(name, sizeof(name), "%*.*s", len, len, (char *) start);
++					start += len;
++					break;
++
++				case SDP_DATA_STR16:
++				case SDP_DATA_URL16:
++					SDP_GET16(len, start);
++					snprintf(name, sizeof(name), "%*.*s", len, len, (char *) start);
++					start += len;
++					break;
++
++				case SDP_DATA_STR32:
++				case SDP_DATA_URL32:
++					SDP_GET32(len, start);
++					snprintf(name, sizeof(name), "%*.*s", len, len, (char *) start);
++					start += len;
++					break;
++
++				default:
++					sdp_close(ss);
++					return -1;
++			}
++			if (name == NULL)
++				return -1;
++
++			if (strcmp(name, "gnapplet") == 0) {
++				if (only_gnapplet != 0)
++					getchan = 1;
++				break;
++			}
++
++			if (strstr(name, "Nokia PC Suite") != NULL)
++				break;
++
++			if (strstr(name, "Bluetooth Serial Port") != NULL)
++				break;
++
++			if (strstr(name, "m-Router Connectivity") != NULL)
++				break;
++
++			getchan = 1;
++			break;
++		}
++	}
++
++	sdp_close(ss);
++	return -1;
++}
++
++#else
+ /*
+  * Taken from gnome-phone-manager
+  */
+@@ -204,6 +467,8 @@
+ 	return channel;
+ }
+ 
++#endif
++
+ static int get_serial_channel(bdaddr_t *device)
+ {
+ 	bdaddr_t src;
+@@ -211,9 +476,15 @@
+ 
+ 	bacpy(&src, BDADDR_ANY);
+ 
++#ifdef HAVE_BLUETOOTH_NETGRAPH	/* FreeBSD / netgraph */
++	channel = find_service_channel(&src, device, 0, SDP_SERVICE_CLASS_SERIAL_PORT);
++	if (channel < 0)
++		channel = find_service_channel(&src, device, 0, SDP_SERVICE_CLASS_DIALUP_NETWORKING);
++#else
+ 	channel = find_service_channel(&src, device, 0, SERIAL_PORT_SVCLASS_ID);
+ 	if (channel < 0)
+ 		channel = find_service_channel(&src, device, 0, DIALUP_NET_SVCLASS_ID);
++#endif
+ 
+ 	return channel;
+ }
diff -ruN gnokii.old/files/patch-configure gnokii/files/patch-configure
--- gnokii.old/files/patch-configure	2008-10-06 22:32:36.000000000 +0200
+++ gnokii/files/patch-configure	2008-11-01 00:28:38.000000000 +0100
@@ -1,6 +1,6 @@
---- configure.orig     2008-02-15 10:21:49.000000000 +0100
-+++ configure  2008-02-23 11:08:39.000000000 +0100
-@@ -1050,7 +1050,7 @@
+--- configure.orig	2008-10-06 08:57:27.000000000 +0200
++++ configure	2008-11-01 00:28:22.000000000 +0100
+@@ -1057,7 +1057,7 @@
  psdir='${docdir}'
  libdir='${exec_prefix}/lib'
  localedir='${datarootdir}/locale'
@@ -9,7 +9,7 @@
  
  ac_prev=
  ac_dashdash=
-@@ -22653,13 +22653,15 @@
+@@ -24163,13 +24163,15 @@
  # First of all, check if the user has set any of the PTHREAD_LIBS,
  # etcetera environment variables, and if threads linking works using
  # them:
@@ -30,7 +30,7 @@
          cat >conftest.$ac_ext <<_ACEOF
  /* confdefs.h.  */
  _ACEOF
-@@ -23023,7 +23025,7 @@
+@@ -24533,7 +24535,7 @@
  echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6; }
          flag=no
          case "${host_cpu}-${host_os}" in
@@ -39,21 +39,96 @@
                  *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
          esac
          { echo "$as_me:$LINENO: result: ${flag}" >&5
-@@ -23840,7 +23842,7 @@
+@@ -26561,9 +26563,9 @@
+ fi
  
- if test "$enable_libical" == "yes"; then
+ 
+-if test "$enable_libical" == "yes"; then
++if test "$enable_libical" = "yes"; then
  	OLD_CFLAGS="$CFLAGS"
 -	LIBS="$LIBS $ICAL_LIBS -lpthread -lical"
 +	LIBS="$LIBS $ICAL_LIBS -pthread -lical"
  	CFLAGS="$CFLAGS $ICAL_CFLAGS"
  	{ echo "$as_me:$LINENO: checking whether libical is installed" >&5
  echo $ECHO_N "checking whether libical is installed... $ECHO_C" >&6; }
-@@ -25684,7 +25686,7 @@
+@@ -26650,7 +26652,7 @@
+   enable_libusb=yes
+ fi
+ 
+-if test "$enable_libusb" == "yes"; then
++if test "$enable_libusb" = "yes"; then
+ 	{ echo "$as_me:$LINENO: checking whether libusb is installed" >&5
+ echo $ECHO_N "checking whether libusb is installed... $ECHO_C" >&6; }
+ 	cat >conftest.$ac_ext <<_ACEOF
+@@ -26872,7 +26874,7 @@
+   enable_irda=yes
+ fi
+ 
+-if test "$enable_irda" == "yes"; then
++if test "$enable_irda" = "yes"; then
+ 	{ echo "$as_me:$LINENO: checking for linux/irda.h" >&5
+ echo $ECHO_N "checking for linux/irda.h... $ECHO_C" >&6; }
+ if test "${ac_cv_header_linux_irda_h+set}" = set; then
+@@ -26955,7 +26957,7 @@
+   enable_bluetooth=yes
+ fi
+ 
+-if test "$enable_bluetooth" == "yes"; then
++if test "$enable_bluetooth" = "yes"; then
+ 	{ echo "$as_me:$LINENO: checking for the bluetooth support" >&5
+ echo $ECHO_N "checking for the bluetooth support... $ECHO_C" >&6; }
+ 	{ echo "$as_me:$LINENO: checking for the struct sockaddr_rc in <bluetooth/rfcomm.h>" >&5
+@@ -27025,7 +27027,7 @@
+ 
+ 	fi
+ fi
+-if test "$enable_bluetooth" == "yes"; then
++if test "$enable_bluetooth" = "yes"; then
+ 	{ echo "$as_me:$LINENO: checking for the MacOS X bluetooth support" >&5
+ echo $ECHO_N "checking for the MacOS X bluetooth support... $ECHO_C" >&6; }
+ 
+@@ -27526,7 +27528,7 @@
+ 	fi
+ fi
+ 
+-if test "$enable_bluetooth" == "yes"; then
++if test "$enable_bluetooth" = "yes"; then
+ 	{ echo "$as_me:$LINENO: checking for the FreeBSD/netgraph bluetooth support" >&5
+ echo $ECHO_N "checking for the FreeBSD/netgraph bluetooth support... $ECHO_C" >&6; }
+ 	{ echo "$as_me:$LINENO: checking for the struct sockaddr_rfcomm in <netgraph/.../ng_btsocket.h>" >&5
+@@ -27602,7 +27604,7 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lbluetooth  $LIBS"
++LIBS="-lsdp -lbluetooth $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+@@ -27658,7 +27660,7 @@
+ { echo "$as_me:$LINENO: result: $ac_cv_lib_bluetooth_bt_aton" >&5
+ echo "${ECHO_T}$ac_cv_lib_bluetooth_bt_aton" >&6; }
+ if test $ac_cv_lib_bluetooth_bt_aton = yes; then
+-  BLUETOOTH_LIBS="$LIBS -lbluetooth"
++  BLUETOOTH_LIBS="$LIBS -lsdp -lbluetooth"
+ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_BT_ATON
+ _ACEOF
+@@ -27676,7 +27678,7 @@
+   enable_libpcsclite=yes
+ fi
+ 
+-if test "$enable_libpcsclite" == "yes"; then
++if test "$enable_libpcsclite" = "yes"; then
+ 
+ 
+ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+@@ -28474,7 +28476,7 @@
  echo "${ECHO_T}$ac_cv_lib_Xpm_XpmWriteFileFromXpmImage" >&6; }
  if test $ac_cv_lib_Xpm_XpmWriteFileFromXpmImage = yes; then
     XPM_CFLAGS="$XINCL"
 -                  XPM_LIBS="$XLIBS -lXpm -lX11"
 +                  XPM_LIBS="$XLIBS -lXpm -lX11 -lroken -lcrypt"
-
+ 
  cat >>confdefs.h <<\_ACEOF
  #define XPM 1
diff -ruN gnokii.old/pkg-plist gnokii/pkg-plist
--- gnokii.old/pkg-plist	2008-10-06 22:32:36.000000000 +0200
+++ gnokii/pkg-plist	2008-11-04 22:33:14.000000000 +0100
@@ -20,7 +20,7 @@
 lib/libgnokii.a
 lib/libgnokii.la
 lib/libgnokii.so
-lib/libgnokii.so.12
+lib/libgnokii.so.4
 libdata/pkgconfig/gnokii.pc
 libdata/pkgconfig/xgnokii.pc
 sbin/gnokiid
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list