summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorWilliam Douglas <william.douglas@intel.com>2012-06-22 08:54:34 -0700
committerWilliam Douglas <william.douglas@intel.com>2012-06-22 14:04:12 -0700
commit3db9cbe06ae51bfd5d9f55cbd1d14f1c578dff7c (patch)
treede75f855d9d01b5e40483cb714ca87c35b206e70 /packaging
parent1c61f9e044b4bb490c3f9568ab2c6fcb2e205e02 (diff)
downloadmedia-server-1.0_post.tar.gz
media-server-1.0_post.tar.bz2
media-server-1.0_post.zip
add systemd unit files1.0_post
Signed-off-by: William Douglas <william.douglas@intel.com>
Diffstat (limited to 'packaging')
-rw-r--r--packaging/media-server.changes2
-rw-r--r--packaging/media-server.service11
-rw-r--r--packaging/media-server.spec23
3 files changed, 36 insertions, 0 deletions
diff --git a/packaging/media-server.changes b/packaging/media-server.changes
new file mode 100644
index 0000000..8dbe8b2
--- /dev/null
+++ b/packaging/media-server.changes
@@ -0,0 +1,2 @@
+* Fri Jun 22 2012 William Douglas <william.douglas@intel.com> - 0.1.66
+- Add systemd unit files
diff --git a/packaging/media-server.service b/packaging/media-server.service
new file mode 100644
index 0000000..f691058
--- /dev/null
+++ b/packaging/media-server.service
@@ -0,0 +1,11 @@
+
+[Unit]
+Description=Start the Media Server
+
+[Service]
+ExecStart=/usr/bin/media-server
+
+[Install]
+WantedBy=tizen-mobile.target
+
+
diff --git a/packaging/media-server.spec b/packaging/media-server.spec
index 36d46fa..72f31c1 100644
--- a/packaging/media-server.spec
+++ b/packaging/media-server.spec
@@ -6,9 +6,14 @@ Release: 1
Group: Services
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
+Source101: packaging/media-server.service
Source1001: packaging/media-server.manifest
+Requires(post): /usr/bin/systemctl
Requires(post): /usr/bin/vconftool
+Requires(postun): /usr/bin/systemctl
+Requires(preun): /usr/bin/systemctl
+
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(dlog)
@@ -51,14 +56,30 @@ make %{?jobs:-j%jobs}
%install
rm -rf %{buildroot}
%make_install
+mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
+install -m 0644 %SOURCE101 %{buildroot}%{_libdir}/systemd/system/media-server.service
+ln -s ../media-server.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/media-server.service
+
+%preun
+if [ $1 == 0 ]; then
+ systemctl stop media-server.service
+fi
%post
+systemctl daemon-reload
+if [ $1 == 1 ]; then
+ systemctl restart media-server.service
+fi
+
vconftool set -t int db/filemanager/dbupdate "1"
vconftool set -t int memory/filemanager/Mmc "0" -i
vconftool set -t int db/Apps/mediaserver/usbmode "0"
vconftool set -t string db/Apps/mediaserver/mmc_info ""
+%postun
+systemctl daemon-reload
+
%files
%manifest media-server.manifest
@@ -67,6 +88,8 @@ vconftool set -t string db/Apps/mediaserver/mmc_info ""
%attr(755,-,-) %{_sysconfdir}/rc.d/init.d/mediasvr
/etc/rc.d/rc3.d/S48mediasvr
/etc/rc.d/rc5.d/S48mediasvr
+%{_libdir}/systemd/system/media-server.service
+%{_libdir}/systemd/system/multi-user.target.wants/media-server.service
%files -n libmedia-utils
%manifest media-server.manifest