Add TIZEN obexd config packaging files
authorWu zheng <wu.zheng@intel.com>
Wed, 23 Oct 2013 03:21:09 +0000 (11:21 +0800)
committerSebastian Chlad <sebastian.chlad@tieto.com>
Tue, 27 May 2014 09:29:01 +0000 (11:29 +0200)
Change-Id: I728cba544250f713c1b45968cc4a5732b14d35c2

packaging/bluez.spec
packaging/create-symlinks [new file with mode: 0755]
packaging/obex-root-setup [new file with mode: 0755]

index ca6ceef..bdd753c 100644 (file)
@@ -31,6 +31,8 @@ Source3:        bluetooth.sysconfig
 Source4:        bluetooth.sh
 Source5:        baselibs.conf
 Source7:        bluetooth.modprobe
+Source101:     obex-root-setup
+Source102:     create-symlinks
 Source1001:    bluez.manifest
 
 %define cups_lib_dir %{_prefix}/lib/cups
@@ -122,6 +124,9 @@ fi
 install --mode 0755 -d $RPM_BUILD_ROOT/var/lib/bluetooth
 
 
+install -D -m 0755 %SOURCE101 %{buildroot}%{_bindir}/obex-root-setup
+install -D -m 0755 %SOURCE102 %{buildroot}%{_sysconfdir}/obex/root-setup.d/000_create-symlinks
+
 %post -n libbluetooth -p /sbin/ldconfig
 
 %postun -n libbluetooth -p /sbin/ldconfig
@@ -175,6 +180,8 @@ install --mode 0755 -d $RPM_BUILD_ROOT/var/lib/bluetooth
 /lib/bluetooth/obexd
 %{_libdir}/systemd/user/obex.service
 %{_datadir}/dbus-1/services/org.bluez.obex.service
+%{_sysconfdir}/obex/root-setup.d/000_create-symlinks
+%{_bindir}/obex-root-setup
 
 %files test
 %manifest %{name}.manifest
diff --git a/packaging/create-symlinks b/packaging/create-symlinks
new file mode 100755 (executable)
index 0000000..31aa6ab
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+OBEX_ROOT="$1"
+
+cd "$OBEX_ROOT"
+
+ln -sf ../MyDocs/.documents Documents
+ln -sf ../MyDocs/.images Images
+ln -sf ../MyDocs/.sounds "Audio clips"
+ln -sf ../MyDocs/.camera Camera
+ln -sf ../MyDocs/.videos "Video clips"
+ln -sf ../MyDocs Data
diff --git a/packaging/obex-root-setup b/packaging/obex-root-setup
new file mode 100755 (executable)
index 0000000..fc0864f
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+ROOT_SETUP=/etc/obex/root-setup.d
+
+OBEX_ROOT="$1"
+
+mkdir -p "$OBEX_ROOT"
+
+if [ -d "$ROOT_SETUP" ]; then
+       run-parts -a "$OBEX_ROOT" "$ROOT_SETUP"
+fi
+
+chmod 0550 "$OBEX_ROOT"