summaryrefslogtreecommitdiff
path: root/comms/obexapp
diff options
context:
space:
mode:
authorplunky <plunky@pkgsrc.org>2007-03-01 21:39:08 +0000
committerplunky <plunky@pkgsrc.org>2007-03-01 21:39:08 +0000
commit6fbb608bdfcc87230eb89c445bc0a216f5103987 (patch)
treec63dd24d305dd4d3fd9a8dc3ef085a7e8bb4e8e2 /comms/obexapp
parentc17a24d8e37a3dfc2f899da7b25859fd345b9140 (diff)
downloadpkgsrc-6fbb608bdfcc87230eb89c445bc0a216f5103987.tar.gz
tweaks and additions:
1. obexapp rc.d script so you can start server mode automatically 2. new patch-ae to make the sdp registration happen before obexapp drops privileges as NetBSD uses LOCAL_CREDS so sdpd can't check the credentials until the client does something. 3. slight tweak to the -A option for NetBSD (in patch-ad) as we have a function to fetch the local device address. 4. use NetBSD-[4-9].*-* instead of checking for <bluetooth.h>
Diffstat (limited to 'comms/obexapp')
-rw-r--r--comms/obexapp/Makefile21
-rw-r--r--comms/obexapp/PLIST3
-rw-r--r--comms/obexapp/distinfo5
-rw-r--r--comms/obexapp/files/obexapp.sh33
-rw-r--r--comms/obexapp/patches/patch-ad27
-rw-r--r--comms/obexapp/patches/patch-ae44
6 files changed, 117 insertions, 16 deletions
diff --git a/comms/obexapp/Makefile b/comms/obexapp/Makefile
index 7573f6a3036..31b7d64e0b6 100644
--- a/comms/obexapp/Makefile
+++ b/comms/obexapp/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2007/02/06 17:50:46 xtraeme Exp $
+# $NetBSD: Makefile,v 1.6 2007/03/01 21:39:08 plunky Exp $
#
DISTNAME= obexapp-1.4.5
@@ -9,17 +9,22 @@ MAINTAINER= xtraeme@NetBSD.org
HOMEPAGE= http://www.geocities.com/m_evmenkin/
COMMENT= Obex application to transfer objects to mobile equipment
-ONLY_FOR_PLATFORM= FreeBSD-*-* NetBSD-*-*
+ONLY_FOR_PLATFORM= FreeBSD-*-* NetBSD-[4-9].*-*
-WRKSRC= ${WRKDIR}/obexapp
+OWN_DIRS+= ${VARBASE}/spool/obex
-SUBST_CLASSES+= mk
+RCD_SCRIPTS+= obexapp
+
+SUBST_CLASSES+= mk var
SUBST_FILES.mk= Makefile
SUBST_STAGE.mk= post-configure
SUBST_SED.mk= -e "s|-lbsdxml|-lexpat|"
SUBST_SED.mk+= -e "s|/usr/local/man|${PREFIX}|"
SUBST_SED.mk+= -e "s|/usr/local|${PREFIX}|"
SUBST_SED.mk+= -e "s|CFLAGS=|CFLAGS+=|"
+SUBST_FILES.var= obexapp.1 obexapp.h
+SUBST_STAGE.var= post-configure
+SUBST_SED.var= -e "s|/var|${VARBASE}|"
# Sigh, this needs the GNU libiconv.
USE_GNU_ICONV= yes
@@ -27,11 +32,9 @@ USE_GNU_ICONV= yes
# Sigh... too many warnings with GCC 4.x, disable them for now.
CFLAGS+= -w
-.include "../../mk/bsd.prefs.mk"
-
-.if (${OPSYS} == "NetBSD" && !exists(/usr/include/bluetooth.h))
-PKG_FAIL_REASON+= Does not build without bluetooth support.
-.endif
+# because the directory name conflicts with the rc.d script
+post-extract:
+ mv ${WRKDIR}/obexapp ${WRKDIR}/${DISTNAME}
.include "../../comms/openobex/buildlink3.mk"
.include "../../converters/libiconv/buildlink3.mk"
diff --git a/comms/obexapp/PLIST b/comms/obexapp/PLIST
index 59029ce1087..c678402edb9 100644
--- a/comms/obexapp/PLIST
+++ b/comms/obexapp/PLIST
@@ -1,4 +1,5 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2006/07/02 18:18:34 xtraeme Exp $
+@comment $NetBSD: PLIST,v 1.2 2007/03/01 21:39:08 plunky Exp $
bin/obexapp
man/cat1/obexapp.0
man/man1/obexapp.1
+share/examples/rc.d/obexapp
diff --git a/comms/obexapp/distinfo b/comms/obexapp/distinfo
index 3e29aedccbb..9365cc3f6b8 100644
--- a/comms/obexapp/distinfo
+++ b/comms/obexapp/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.4 2007/02/20 19:05:51 plunky Exp $
+$NetBSD: distinfo,v 1.5 2007/03/01 21:39:08 plunky Exp $
SHA1 (obexapp-1.4.5.tar.gz) = 567087731e86906bdaef7f3dd792a18e4686ebdd
RMD160 (obexapp-1.4.5.tar.gz) = 71f4903ab80692fba33f8242930ec878b24ad1cd
@@ -6,4 +6,5 @@ Size (obexapp-1.4.5.tar.gz) = 30384 bytes
SHA1 (patch-aa) = 28d245c716a6d8fd57607dd74f239f165da9f4ac
SHA1 (patch-ab) = a0355450e8af326a24d6db5af436851e67d4d395
SHA1 (patch-ac) = d9a09e9ca0118ebb489507e2fe9965fbded4552b
-SHA1 (patch-ad) = 3b985ef15bd81c889f5640835ef670a89b5049f2
+SHA1 (patch-ad) = 8441c157ad3243a25ed3217f3305039b1714de56
+SHA1 (patch-ae) = ee1c382e226e13d278cb91fac205464221b50f87
diff --git a/comms/obexapp/files/obexapp.sh b/comms/obexapp/files/obexapp.sh
new file mode 100644
index 00000000000..1cc3619246f
--- /dev/null
+++ b/comms/obexapp/files/obexapp.sh
@@ -0,0 +1,33 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: obexapp.sh,v 1.1 2007/03/01 21:39:09 plunky Exp $
+#
+# PROVIDE: obexapp
+# REQUIRE: sdpd
+#
+
+# variables used:
+#
+# obexapp_channel RFCOMM channel number
+# obexapp_username username for -u option
+# obexapp_pathname pathname for -r option
+
+$rc_subr_loaded . /etc/rc.subr
+
+name="obexapp"
+rcvar=$name
+command="@PREFIX@/bin/${name}"
+
+load_rc_config ${name}
+
+if @TEST@ -z "${obexapp_channel}"; then
+ err 1 "Must specify obexapp_channel"
+fi
+
+command_args="-s -S -C ${obexapp_channel} -r ${obexapp_pathname:-@VARBASE@/spool/obex}"
+
+if @TEST@ "${obexapp_username}"; then
+ command_args="${command_args} -u ${obexapp_username}"
+fi
+
+run_rc_command "$1"
diff --git a/comms/obexapp/patches/patch-ad b/comms/obexapp/patches/patch-ad
index fb24ab56dc9..96e439b08a8 100644
--- a/comms/obexapp/patches/patch-ad
+++ b/comms/obexapp/patches/patch-ad
@@ -1,8 +1,27 @@
-$NetBSD: patch-ad,v 1.3 2007/02/20 19:05:51 plunky Exp $
+$NetBSD: patch-ad,v 1.4 2007/03/01 21:39:09 plunky Exp $
---- main.c.orig 2006-07-09 18:28:27.000000000 +0200
-+++ main.c 2006-07-09 18:28:37.000000000 +0200
-@@ -265,7 +265,7 @@
+--- main.c.orig 2007-01-30 00:35:23.000000000 +0000
++++ main.c 2007-02-26 10:31:55.000000000 +0000
+@@ -138,6 +138,10 @@
+ break;
+
+ case 'A':
++#ifdef __NetBSD__
++ if (!bt_devaddr(optarg, &context.saddr))
++ err(1, "%s", optarg);
++#else
+ if (!bt_aton(optarg, &context.saddr)) {
+ struct hostent *he = bt_gethostbyname(optarg);
+
+@@ -148,6 +152,7 @@
+ memcpy(&context.saddr, he->h_addr,
+ sizeof(context.saddr));
+ }
++#endif
+ break;
+
+ case 'c': /* client */
+@@ -251,7 +256,7 @@
if (rfcomm_channel_lookup(NULL,
&context.addr.rfcomm_bdaddr,
service, &channel, &n) != 0)
diff --git a/comms/obexapp/patches/patch-ae b/comms/obexapp/patches/patch-ae
new file mode 100644
index 00000000000..5ba31b7058d
--- /dev/null
+++ b/comms/obexapp/patches/patch-ae
@@ -0,0 +1,44 @@
+$NetBSD: patch-ae,v 1.3 2007/03/01 21:39:09 plunky Exp $
+
+--- server.c.orig 2007-02-26 10:34:10.000000000 +0000
++++ server.c 2007-02-26 10:35:11.000000000 +0000
+@@ -149,6 +149,19 @@
+ strlcpy(context->root, pw->pw_dir, PATH_MAX);
+ }
+
++ log_info("%s: Starting OBEX server", __func__);
++
++ if (OBEX_SetTransportMTU(handle, context->mtu, context->mtu) < 0) {
++ log_err("%s(): OBEX_SetTransportMTU failed", __func__);
++ goto done;
++ }
++
++ if (OBEX_ServerRegister(handle, (struct sockaddr *) &context->addr,
++ sizeof(context->addr)) < 0) {
++ log_err("%s(): OBEX_ServerRegister failed", __func__);
++ goto done;
++ }
++
+ if (getuid() == 0) {
+ if (context->secure) {
+ if (chroot(context->root) < 0) {
+@@ -184,19 +197,6 @@
+ goto done;
+ }
+
+- log_info("%s: Starting OBEX server", __func__);
+-
+- if (OBEX_SetTransportMTU(handle, context->mtu, context->mtu) < 0) {
+- log_err("%s(): OBEX_SetTransportMTU failed", __func__);
+- goto done;
+- }
+-
+- if (OBEX_ServerRegister(handle, (struct sockaddr *) &context->addr,
+- sizeof(context->addr)) < 0) {
+- log_err("%s(): OBEX_ServerRegister failed", __func__);
+- goto done;
+- }
+-
+ log_debug("%s(): Entering event processing loop...", __func__);
+
+ for (error = 0, context->done = 0; !context->done; ) {