View | Details | Raw Unified | Return to bug 128589 | Differences between
and this patch

Collapse All | Expand All

(-)gnokii/Makefile (-2 / +1 lines)
Lines 6-13 Link Here
6
#
6
#
7
7
8
PORTNAME=	gnokii
8
PORTNAME=	gnokii
9
PORTVERSION=	0.6.26
9
PORTVERSION=	0.6.27
10
PORTREVISION=	3
11
PORTEPOCH=	1
10
PORTEPOCH=	1
12
CATEGORIES=	comms
11
CATEGORIES=	comms
13
MASTER_SITES=	http://www.gnokii.org/download/gnokii/ \
12
MASTER_SITES=	http://www.gnokii.org/download/gnokii/ \
(-)gnokii/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (gnokii-0.6.26.tar.bz2) = 60f817d8ce748fea0ec9a05b3537e08d
1
MD5 (gnokii-0.6.27.tar.bz2) = fd0ae7996a2e2a2c29e9f3c625df8f3d
2
SHA256 (gnokii-0.6.26.tar.bz2) = 35242b5545ced25383ac8c771b602c15b5585063c3637a23c9ef0a31d3e591ea
2
SHA256 (gnokii-0.6.27.tar.bz2) = 69f1d75f755a2918e9577cf28dacea9d6fca9b9d722813341d50d12acb8ee886
3
SIZE (gnokii-0.6.26.tar.bz2) = 1446615
3
SIZE (gnokii-0.6.27.tar.bz2) = 1491564
(-)gnokii/files/patch-common-devices-unixbluetooth.c (+349 lines)
Line 0 Link Here
1
--- common/devices/unixbluetooth.c.orig	2008-10-05 12:14:31.000000000 +0200
2
+++ common/devices/unixbluetooth.c	2008-11-08 20:01:59.000000000 +0100
3
@@ -50,56 +50,293 @@
4
 
5
 #ifdef HAVE_BLUETOOTH_NETGRAPH	/* FreeBSD / netgraph */
6
 
7
-#include <bitstring.h>
8
-#include <netgraph/bluetooth/include/ng_hci.h>
9
-#include <netgraph/bluetooth/include/ng_l2cap.h>
10
-#include <netgraph/bluetooth/include/ng_btsocket.h>
11
+#include <bluetooth.h>
12
+#include <sdp.h>
13
 
14
 #define BTPROTO_RFCOMM BLUETOOTH_PROTO_RFCOMM
15
 #define BDADDR_ANY NG_HCI_BDADDR_ANY
16
+#define GNOKII_SERIAL_PORT_CLASS	SDP_SERVICE_CLASS_SERIAL_PORT
17
+#define GNOKII_DIALUP_NETWORK_CLASS	SDP_SERVICE_CLASS_DIALUP_NETWORKING
18
 #define sockaddr_rc sockaddr_rfcomm
19
 #define rc_family rfcomm_family
20
 #define rc_bdaddr rfcomm_bdaddr
21
 #define rc_channel rfcomm_channel
22
-#define bacpy(dst, src) memcpy((dst), (src), sizeof(bdaddr_t))
23
 
24
-#ifndef HAVE_BT_ATON
25
+#else	/* Linux / BlueZ support */
26
 
27
-static int bt_aton(const char *str, bdaddr_t *ba)
28
-{
29
-	char ch;
30
-	unsigned int b[6];
31
+#include <bluetooth/bluetooth.h>
32
+#include <bluetooth/rfcomm.h>
33
+#include <bluetooth/sdp.h>
34
+#include <bluetooth/sdp_lib.h>
35
 
36
-	memset(ba, 0, sizeof(*ba));
37
-	if (sscanf(str, "%x:%x:%x:%x:%x:%x%c", b + 0, b + 1, b + 2, b + 3, b + 4, b + 5, &ch) != 6) return 0;
38
-	if ((b[0] | b[1] | b[2] | b[3] | b[4] | b[5]) > 0xff) return 0;
39
-
40
-	ba->b[0] = b[0];
41
-	ba->b[1] = b[1];
42
-	ba->b[2] = b[2];
43
-	ba->b[3] = b[3];
44
-	ba->b[4] = b[4];
45
-	ba->b[5] = b[5];
46
+#define GNOKII_SERIAL_PORT_CLASS	SERIAL_PORT_SVCLASS_ID
47
+#define GNOKII_DIALUP_NETWORK_CLASS	DIALUP_NET_SVCLASS_ID
48
 
49
-	return 1;
50
-}
51
+#endif
52
+
53
+#ifdef HAVE_BLUETOOTH_NETGRAPH	/* FreeBSD / netgraph */
54
 
55
-#endif	/* HAVE_BT_ATON */
56
+/*
57
+** FreeBSD version of the find_service_channel function.
58
+** Written by Guido Falsi <mad@madpilot.net>.
59
+** Contains code taken from FreeBSD's sdpcontrol and rfcomm_sppd
60
+** programs, which are Copyright (c) 2001-2003 Maksim Yevmenkin
61
+** <m_evmenkin@yahoo.com>.
62
+**
63
+** Also thanks to Iain Hibbert for his suggestions.
64
+*/
65
 
66
-static int str2ba(const char *str, bdaddr_t *ba)
67
+static int find_service_channel(bdaddr_t *adapter, bdaddr_t *device, int only_gnapplet, uint16_t svclass_id)
68
 {
69
-	return !bt_aton(str, ba);
70
-}
71
+	int i, channel = -1;
72
+	char name[64];
73
+	void *ss = NULL;
74
 
75
-#else	/* Linux / BlueZ support */
76
+	uint32_t attrs[] =
77
+	{
78
+		SDP_ATTR_RANGE( SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST,
79
+			SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST),
80
+		SDP_ATTR_RANGE( SDP_ATTR_PRIMARY_LANGUAGE_BASE_ID + SDP_ATTR_SERVICE_NAME_OFFSET,
81
+			SDP_ATTR_PRIMARY_LANGUAGE_BASE_ID + SDP_ATTR_SERVICE_NAME_OFFSET),
82
+	};
83
+	#define attrs_len	(sizeof(attrs)/sizeof(attrs[0]))
84
+
85
+	/* Buffer for the attributes */
86
+	#define NRECS   25      /* request this much records from the SDP server */
87
+	#define BSIZE   256     /* one attribute buffer size */
88
+	static uint8_t          buffer[NRECS * attrs_len][BSIZE];
89
+
90
+	/* SDP attributes */
91
+	static sdp_attr_t       values[NRECS * attrs_len];
92
+	#define values_len      (sizeof(values)/sizeof(values[0]))
93
+
94
+	/* Initialize attribute values array */
95
+	for (i = 0; i < values_len; i ++) {
96
+		values[i].flags = SDP_ATTR_INVALID;
97
+		values[i].attr = 0;
98
+		values[i].vlen = BSIZE; 
99
+		values[i].value = buffer[i];
100
+	}
101
 
102
-#include <bluetooth/bluetooth.h>
103
-#include <bluetooth/rfcomm.h>
104
-#include <bluetooth/sdp.h>
105
-#include <bluetooth/sdp_lib.h>
106
+	if ((ss = sdp_open(adapter, device)) == NULL)
107
+		return -1;
108
 
109
-#endif
110
+	if (sdp_error(ss) != 0)
111
+		goto end;
112
+
113
+	if (sdp_search(ss, 1, &svclass_id, attrs_len, attrs, values_len, values) != 0)
114
+		goto end;
115
+
116
+	for (i = 0; i < values_len; i++)
117
+	{
118
+		if (values[i].flags != SDP_ATTR_OK)
119
+			break;
120
+
121
+		union {
122
+			uint8_t		uint8;
123
+			uint16_t	uint16;
124
+			uint32_t	uint32;
125
+			uint64_t	uint64;
126
+			int128_t	int128;
127
+		}			value;
128
+		uint8_t *start, *end;
129
+		uint32_t type, len;
130
+
131
+		start = values[i].value;
132
+		end = values[i].value + values[i].vlen;
133
+
134
+		switch (values[i].attr) {
135
+		case SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST:
136
+			SDP_GET8(type, start);
137
+			switch (type) {
138
+			case SDP_DATA_SEQ8:
139
+				SDP_GET8(len, start);
140
+				break;
141
+
142
+			case SDP_DATA_SEQ16:
143
+				SDP_GET16(len, start);
144
+				break;
145
+
146
+			case SDP_DATA_SEQ32:
147
+				SDP_GET32(len, start);
148
+				break;
149
+
150
+			default:
151
+				goto end;
152
+				break;
153
+			}
154
+
155
+			SDP_GET8(type, start);
156
+			switch (type) {
157
+			case SDP_DATA_SEQ8:
158
+				SDP_GET8(len, start);
159
+				break;
160
+
161
+			case SDP_DATA_SEQ16:
162
+				SDP_GET16(len, start);
163
+				break;
164
+
165
+			case SDP_DATA_SEQ32:
166
+				SDP_GET32(len, start);
167
+				break;
168
+
169
+			default:
170
+				goto end;
171
+				break;
172
+			}
173
+
174
+			while (start < end) {
175
+				SDP_GET8(type, start);
176
+				switch (type) {
177
+				case SDP_DATA_UUID16:
178
+					SDP_GET16(value.uint16, start);
179
+					break;
180
+
181
+				case SDP_DATA_UUID32:
182
+					SDP_GET32(value.uint32, start);
183
+					break;
184
+
185
+				case SDP_DATA_UUID128:
186
+					SDP_GET_UUID128(&value.int128, start);
187
+					break;
188
+
189
+				default:
190
+					goto end;
191
+					break;
192
+				}
193
+				if(value.uint16 == 3) {
194
+					SDP_GET8(type, start);
195
+					switch (type) {
196
+					case SDP_DATA_UINT8:
197
+					case SDP_DATA_INT8:
198
+						SDP_GET8(value.uint8, start);
199
+						channel = value.uint8;
200
+						break;
201
+
202
+					case SDP_DATA_UINT16:
203
+					case SDP_DATA_INT16:
204
+						SDP_GET16(value.uint16, start);
205
+						channel = value.uint16;
206
+						break;
207
+
208
+					case SDP_DATA_UINT32:
209
+					case SDP_DATA_INT32:
210
+						SDP_GET32(value.uint32, start);
211
+						channel = value.uint32;
212
+						break;
213
+
214
+					default:
215
+						goto end;
216
+						break;
217
+					}
218
+				} else {
219
+					SDP_GET8(type, start);
220
+					switch (type) {
221
+					case SDP_DATA_SEQ8:
222
+					case SDP_DATA_UINT8:
223
+					case SDP_DATA_INT8:
224
+					case SDP_DATA_BOOL:
225
+						SDP_GET8(value.uint8, start);
226
+						break;
227
+
228
+					case SDP_DATA_SEQ16:
229
+					case SDP_DATA_UINT16:
230
+					case SDP_DATA_INT16:
231
+					case SDP_DATA_UUID16:
232
+						SDP_GET16(value.uint16, start);
233
+						break;
234
+
235
+					case SDP_DATA_SEQ32:
236
+					case SDP_DATA_UINT32:
237
+					case SDP_DATA_INT32:
238
+					case SDP_DATA_UUID32:
239
+						SDP_GET32(value.uint32, start);
240
+						break;
241
+
242
+					case SDP_DATA_UINT64:
243
+					case SDP_DATA_INT64:
244
+						SDP_GET64(value.uint64, start);
245
+						break;
246
+
247
+					case SDP_DATA_UINT128:
248
+					case SDP_DATA_INT128:
249
+						SDP_GET128(&value.int128, start);
250
+						break;
251
+
252
+					default:
253
+						goto end;
254
+						break;
255
+					}
256
+				}
257
+			}
258
+			start += len;
259
+			break;
260
+
261
+		case SDP_ATTR_PRIMARY_LANGUAGE_BASE_ID + SDP_ATTR_SERVICE_NAME_OFFSET:
262
+			if (channel == -1)
263
+				break;
264
+			
265
+			SDP_GET8(type, start);
266
+			switch (type) {
267
+				case SDP_DATA_STR8:
268
+				case SDP_DATA_URL8:
269
+					SDP_GET8(len, start);
270
+					snprintf(name, sizeof(name), "%*.*s", len, len, (char *) start);
271
+					start += len;
272
+					break;
273
+
274
+				case SDP_DATA_STR16:
275
+				case SDP_DATA_URL16:
276
+					SDP_GET16(len, start);
277
+					snprintf(name, sizeof(name), "%*.*s", len, len, (char *) start);
278
+					start += len;
279
+					break;
280
+
281
+				case SDP_DATA_STR32:
282
+				case SDP_DATA_URL32:
283
+					SDP_GET32(len, start);
284
+					snprintf(name, sizeof(name), "%*.*s", len, len, (char *) start);
285
+					start += len;
286
+					break;
287
+
288
+				default:
289
+					goto end;
290
+					break;
291
+			}
292
+			if (name == NULL)
293
+				break;
294
+
295
+			if (strcmp(name, "gnapplet") == 0) {
296
+				if (only_gnapplet != 0)
297
+					return channel;
298
+				break;
299
+			}
300
+
301
+			if (strstr(name, "Nokia PC Suite") != NULL) {
302
+				channel = -1;
303
+				break;
304
+			}
305
+
306
+			if (strstr(name, "Bluetooth Serial Port") != NULL) {
307
+				channel = -1;
308
+				break;
309
+			}
310
+
311
+			if (strstr(name, "m-Router Connectivity") != NULL) {
312
+				channel = -1;
313
+				break;
314
+			}
315
+
316
+			goto end;
317
+		}
318
+	}
319
 
320
+end:
321
+	sdp_close(ss);
322
+	return channel;
323
+}
324
+
325
+#else
326
 /*
327
  * Taken from gnome-phone-manager
328
  */
329
@@ -204,6 +441,8 @@
330
 	return channel;
331
 }
332
 
333
+#endif
334
+
335
 static int get_serial_channel(bdaddr_t *device)
336
 {
337
 	bdaddr_t src;
338
@@ -211,9 +450,9 @@
339
 
340
 	bacpy(&src, BDADDR_ANY);
341
 
342
-	channel = find_service_channel(&src, device, 0, SERIAL_PORT_SVCLASS_ID);
343
+	channel = find_service_channel(&src, device, 0, GNOKII_SERIAL_PORT_CLASS);
344
 	if (channel < 0)
345
-		channel = find_service_channel(&src, device, 0, DIALUP_NET_SVCLASS_ID);
346
+		channel = find_service_channel(&src, device, 0, GNOKII_DIALUP_NETWORK_CLASS);
347
 
348
 	return channel;
349
 }
(-)gnokii/files/patch-configure (-9 / +84 lines)
Lines 1-6 Link Here
1
--- configure.orig     2008-02-15 10:21:49.000000000 +0100
1
--- configure.orig	2008-10-06 08:57:27.000000000 +0200
2
+++ configure  2008-02-23 11:08:39.000000000 +0100
2
+++ configure	2008-11-01 00:28:22.000000000 +0100
3
@@ -1050,7 +1050,7 @@
3
@@ -1057,7 +1057,7 @@
4
 psdir='${docdir}'
4
 psdir='${docdir}'
5
 libdir='${exec_prefix}/lib'
5
 libdir='${exec_prefix}/lib'
6
 localedir='${datarootdir}/locale'
6
 localedir='${datarootdir}/locale'
Lines 9-15 Link Here
9
 
9
 
10
 ac_prev=
10
 ac_prev=
11
 ac_dashdash=
11
 ac_dashdash=
12
@@ -22653,13 +22653,15 @@
12
@@ -24163,13 +24163,15 @@
13
 # First of all, check if the user has set any of the PTHREAD_LIBS,
13
 # First of all, check if the user has set any of the PTHREAD_LIBS,
14
 # etcetera environment variables, and if threads linking works using
14
 # etcetera environment variables, and if threads linking works using
15
 # them:
15
 # them:
Lines 30-36 Link Here
30
         cat >conftest.$ac_ext <<_ACEOF
30
         cat >conftest.$ac_ext <<_ACEOF
31
 /* confdefs.h.  */
31
 /* confdefs.h.  */
32
 _ACEOF
32
 _ACEOF
33
@@ -23023,7 +23025,7 @@
33
@@ -24533,7 +24535,7 @@
34
 echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6; }
34
 echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6; }
35
         flag=no
35
         flag=no
36
         case "${host_cpu}-${host_os}" in
36
         case "${host_cpu}-${host_os}" in
Lines 39-59 Link Here
39
                 *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
39
                 *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
40
         esac
40
         esac
41
         { echo "$as_me:$LINENO: result: ${flag}" >&5
41
         { echo "$as_me:$LINENO: result: ${flag}" >&5
42
@@ -23840,7 +23842,7 @@
42
@@ -26561,9 +26563,9 @@
43
 fi
43
 
44
 
44
 if test "$enable_libical" == "yes"; then
45
 
46
-if test "$enable_libical" == "yes"; then
47
+if test "$enable_libical" = "yes"; then
45
 	OLD_CFLAGS="$CFLAGS"
48
 	OLD_CFLAGS="$CFLAGS"
46
-	LIBS="$LIBS $ICAL_LIBS -lpthread -lical"
49
-	LIBS="$LIBS $ICAL_LIBS -lpthread -lical"
47
+	LIBS="$LIBS $ICAL_LIBS -pthread -lical"
50
+	LIBS="$LIBS $ICAL_LIBS -pthread -lical"
48
 	CFLAGS="$CFLAGS $ICAL_CFLAGS"
51
 	CFLAGS="$CFLAGS $ICAL_CFLAGS"
49
 	{ echo "$as_me:$LINENO: checking whether libical is installed" >&5
52
 	{ echo "$as_me:$LINENO: checking whether libical is installed" >&5
50
 echo $ECHO_N "checking whether libical is installed... $ECHO_C" >&6; }
53
 echo $ECHO_N "checking whether libical is installed... $ECHO_C" >&6; }
51
@@ -25684,7 +25686,7 @@
54
@@ -26650,7 +26652,7 @@
55
   enable_libusb=yes
56
 fi
57
 
58
-if test "$enable_libusb" == "yes"; then
59
+if test "$enable_libusb" = "yes"; then
60
 	{ echo "$as_me:$LINENO: checking whether libusb is installed" >&5
61
 echo $ECHO_N "checking whether libusb is installed... $ECHO_C" >&6; }
62
 	cat >conftest.$ac_ext <<_ACEOF
63
@@ -26872,7 +26874,7 @@
64
   enable_irda=yes
65
 fi
66
 
67
-if test "$enable_irda" == "yes"; then
68
+if test "$enable_irda" = "yes"; then
69
 	{ echo "$as_me:$LINENO: checking for linux/irda.h" >&5
70
 echo $ECHO_N "checking for linux/irda.h... $ECHO_C" >&6; }
71
 if test "${ac_cv_header_linux_irda_h+set}" = set; then
72
@@ -26955,7 +26957,7 @@
73
   enable_bluetooth=yes
74
 fi
75
 
76
-if test "$enable_bluetooth" == "yes"; then
77
+if test "$enable_bluetooth" = "yes"; then
78
 	{ echo "$as_me:$LINENO: checking for the bluetooth support" >&5
79
 echo $ECHO_N "checking for the bluetooth support... $ECHO_C" >&6; }
80
 	{ echo "$as_me:$LINENO: checking for the struct sockaddr_rc in <bluetooth/rfcomm.h>" >&5
81
@@ -27025,7 +27027,7 @@
82
 
83
 	fi
84
 fi
85
-if test "$enable_bluetooth" == "yes"; then
86
+if test "$enable_bluetooth" = "yes"; then
87
 	{ echo "$as_me:$LINENO: checking for the MacOS X bluetooth support" >&5
88
 echo $ECHO_N "checking for the MacOS X bluetooth support... $ECHO_C" >&6; }
89
 
90
@@ -27526,7 +27528,7 @@
91
 	fi
92
 fi
93
 
94
-if test "$enable_bluetooth" == "yes"; then
95
+if test "$enable_bluetooth" = "yes"; then
96
 	{ echo "$as_me:$LINENO: checking for the FreeBSD/netgraph bluetooth support" >&5
97
 echo $ECHO_N "checking for the FreeBSD/netgraph bluetooth support... $ECHO_C" >&6; }
98
 	{ echo "$as_me:$LINENO: checking for the struct sockaddr_rfcomm in <netgraph/.../ng_btsocket.h>" >&5
99
@@ -27602,7 +27604,7 @@
100
   echo $ECHO_N "(cached) $ECHO_C" >&6
101
 else
102
   ac_check_lib_save_LIBS=$LIBS
103
-LIBS="-lbluetooth  $LIBS"
104
+LIBS="-lsdp -lbluetooth $LIBS"
105
 cat >conftest.$ac_ext <<_ACEOF
106
 /* confdefs.h.  */
107
 _ACEOF
108
@@ -27658,7 +27660,7 @@
109
 { echo "$as_me:$LINENO: result: $ac_cv_lib_bluetooth_bt_aton" >&5
110
 echo "${ECHO_T}$ac_cv_lib_bluetooth_bt_aton" >&6; }
111
 if test $ac_cv_lib_bluetooth_bt_aton = yes; then
112
-  BLUETOOTH_LIBS="$LIBS -lbluetooth"
113
+  BLUETOOTH_LIBS="$LIBS -lsdp -lbluetooth"
114
 cat >>confdefs.h <<\_ACEOF
115
 #define HAVE_BT_ATON
116
 _ACEOF
117
@@ -27676,7 +27678,7 @@
118
   enable_libpcsclite=yes
119
 fi
120
 
121
-if test "$enable_libpcsclite" == "yes"; then
122
+if test "$enable_libpcsclite" = "yes"; then
123
 
124
 
125
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
126
@@ -28474,7 +28476,7 @@
52
 echo "${ECHO_T}$ac_cv_lib_Xpm_XpmWriteFileFromXpmImage" >&6; }
127
 echo "${ECHO_T}$ac_cv_lib_Xpm_XpmWriteFileFromXpmImage" >&6; }
53
 if test $ac_cv_lib_Xpm_XpmWriteFileFromXpmImage = yes; then
128
 if test $ac_cv_lib_Xpm_XpmWriteFileFromXpmImage = yes; then
54
    XPM_CFLAGS="$XINCL"
129
    XPM_CFLAGS="$XINCL"
55
-                  XPM_LIBS="$XLIBS -lXpm -lX11"
130
-                  XPM_LIBS="$XLIBS -lXpm -lX11"
56
+                  XPM_LIBS="$XLIBS -lXpm -lX11 -lroken -lcrypt"
131
+                  XPM_LIBS="$XLIBS -lXpm -lX11 -lroken -lcrypt"
57
132
 
58
 cat >>confdefs.h <<\_ACEOF
133
 cat >>confdefs.h <<\_ACEOF
59
 #define XPM 1
134
 #define XPM 1
(-)gnokii/pkg-plist (-1 / +1 lines)
Lines 20-26 Link Here
20
lib/libgnokii.a
20
lib/libgnokii.a
21
lib/libgnokii.la
21
lib/libgnokii.la
22
lib/libgnokii.so
22
lib/libgnokii.so
23
lib/libgnokii.so.12
23
lib/libgnokii.so.4
24
libdata/pkgconfig/gnokii.pc
24
libdata/pkgconfig/gnokii.pc
25
libdata/pkgconfig/xgnokii.pc
25
libdata/pkgconfig/xgnokii.pc
26
sbin/gnokiid
26
sbin/gnokiid

Return to bug 128589