summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McCarty <patrick.mccarty@linux.intel.com>2012-06-25 12:09:02 -0700
committerPatrick McCarty <patrick.mccarty@linux.intel.com>2012-06-25 14:09:51 -0700
commitb1d3034c1d7a8e5d0acedc94f0070269320b89f6 (patch)
tree62932dded66bac1431ad58377da2242c634c4a33
parent33ee54e4c153de874c3435f3a415fbf173d29005 (diff)
downloadsensor-framework-b1d3034c1d7a8e5d0acedc94f0070269320b89f6.tar.gz
sensor-framework-b1d3034c1d7a8e5d0acedc94f0070269320b89f6.tar.bz2
sensor-framework-b1d3034c1d7a8e5d0acedc94f0070269320b89f6.zip
Add a systemd service file; create initscript symlinks in %install
Change-Id: Icf5c58b3f2e6be301237e3c8231b03fa6ac7fcdd
-rw-r--r--packaging/sensor-framework.changes4
-rw-r--r--packaging/sensor-framework.service11
-rw-r--r--packaging/sensor-framework.spec32
3 files changed, 35 insertions, 12 deletions
diff --git a/packaging/sensor-framework.changes b/packaging/sensor-framework.changes
new file mode 100644
index 0000000..399e248
--- /dev/null
+++ b/packaging/sensor-framework.changes
@@ -0,0 +1,4 @@
+* Mon Jun 25 2012 Patrick McCarty <patrick.mccarty@linux.intel.com> - 0.2.5
+- Add systemd service file
+- Create initscript symlinks in %install instead of %post
+
diff --git a/packaging/sensor-framework.service b/packaging/sensor-framework.service
new file mode 100644
index 0000000..95710ee
--- /dev/null
+++ b/packaging/sensor-framework.service
@@ -0,0 +1,11 @@
+
+[Unit]
+Description=Start the sensor framework
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/sf_server -s /usr/etc/sf_sensor.conf -f /usr/etc/sf_filter.conf -p /usr/etc/sf_processor.conf -d /usr/etc/sf_data_stream.conf
+
+[Install]
+WantedBy=tizen-middleware.target
+
diff --git a/packaging/sensor-framework.spec b/packaging/sensor-framework.spec
index f47ba64..8bc893a 100644
--- a/packaging/sensor-framework.spec
+++ b/packaging/sensor-framework.spec
@@ -1,10 +1,11 @@
Name: sensor-framework
Summary: Sensor framework
-Version: 0.2.5
+Version: 0.2.5
Release: 1
Group: TO_BE/FILLED_IN
License: LGPL
Source0: %{name}-%{version}.tar.gz
+Source1: sensor-framework.service
Source1001: packaging/sensor-framework.manifest
Requires(post): /usr/bin/vconftool
@@ -13,6 +14,7 @@ BuildRequires: cmake
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(sf_common)
BuildRequires: pkgconfig(vconf)
+
%description
Sensor framework
@@ -28,6 +30,17 @@ make %{?jobs:-j%jobs}
%install
%make_install
+mkdir -p %{buildroot}%{_libdir}/systemd/user/tizen-middleware.target.wants
+install -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/user/
+ln -s ../sensor-framework.service %{buildroot}%{_libdir}/systemd/user/tizen-middleware.target.wants/sensor-framework.service
+
+# FIXME: remove initscripts after we start using systemd
+mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d
+mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc4.d
+ln -s ../init.d/sfsvc %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S40sfsvc
+ln -s ../init.d/sfsvc %{buildroot}%{_sysconfdir}/rc.d/rc4.d/S40sfsvc
+
+
%post
vconftool set -t int memory/sensor/10001 0 -i
vconftool set -t int memory/sensor/10002 0 -i
@@ -49,22 +62,17 @@ vconftool set -t int memory/sensor/800040 0 -i
vconftool set -t int memory/sensor/80001 0 -i
vconftool set -t int memory/sensor/80002 0 -i
-mkdir -p /etc/rc.d/rc3.d
-mkdir -p /etc/rc.d/rc4.d
-ln -s /etc/rc.d/init.d/sfsvc /etc/rc.d/rc3.d/S40sfsvc
-ln -s /etc/rc.d/init.d/sfsvc /etc/rc.d/rc4.d/S40sfsvc
-
-%postun
-rm -f /etc/rc.d/rc3.d/S40sfsvc
-rm -f /etc/rc.d/rc4.d/S40sfsvc
%files
%manifest sensor-framework.manifest
-%defattr(-,root,root,-)
-/usr/bin/sf_server
-%{_sysconfdir}/rc.d/init.d/sfsvc
+%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/sfsvc
+%{_sysconfdir}/rc.d/rc3.d/S40sfsvc
+%{_sysconfdir}/rc.d/rc4.d/S40sfsvc
+%{_bindir}/sf_server
%attr(0644,root,root)/usr/etc/sf_data_stream.conf
%attr(0644,root,root)/usr/etc/sf_filter.conf
%attr(0644,root,root)/usr/etc/sf_processor.conf
%attr(0644,root,root)/usr/etc/sf_sensor.conf
+%{_libdir}/systemd/user/sensor-framework.service
+%{_libdir}/systemd/user/tizen-middleware.target.wants/sensor-framework.service