diff options
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/media-server.changes | 2 | ||||
-rw-r--r-- | packaging/media-server.service | 11 | ||||
-rw-r--r-- | packaging/media-server.spec | 23 |
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 |