Convert to systemd API
[framework/system/oma-ds-agent.git] / packaging / oma-ds-agent.spec
index be332b3..3bcae04 100755 (executable)
@@ -5,7 +5,7 @@ Release:    1
 Group:      TO_BE/FILLED_IN
 License:    Apache License, Version 2.0
 Source0:    %{name}-%{version}.tar.gz
-Source1:       packaing/oma-ds-agent.service
+
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 BuildRequires:  pkgconfig(glib-2.0)
@@ -21,6 +21,7 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(aul)
 BuildRequires:  expat-devel
 BuildRequires:  cmake
+BuildRequires: pkgconfig(libsystemd-daemon)
 Requires: sys-assert
 
 
@@ -34,16 +35,13 @@ Group:      TO_BE_FILLED
 %description -n ds-public-plugins
 ds public plugins for sync-agent
 
-
 %prep
 %setup -q
 
-
 %build
 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
 make %{?jobs:-j%jobs}
 
-
 %install
 rm -rf %{buildroot}
 
@@ -56,59 +54,26 @@ sqlite3 %{buildroot}/opt/dbspace/.omasyncagent.db "PRAGMA journal_mode = PERSIST
 
 %make_install
 
-# systemd service script sertup
+# systemd service script startup
 mkdir -p %{buildroot}%{_libdir}/systemd/system/graphical.target.wants
-install -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/
 ln -s ../oma-ds-agent.service %{buildroot}%{_libdir}/systemd/system/graphical.target.wants/oma-ds-agent.service
 
 %clean
 rm -rf %{buildroot}
 
-
 %post
 if [ ! -d /opt/dbspace ]
 then
        mkdir /opt/dbspace
 fi
-if [ ! -d /etc/rc.d/rc3.d ]
-then
-       mkdir /etc/rc.d/rc3.d
-fi
-if [ ! -d /etc/rc.d/rc5.d ]
-then
-       mkdir /etc/rc.d/rc5.d
-fi
-
-if [ ! -f /etc/rc.d/rc3.d/S91oma-ds-agent ]
-then
-ln -s /etc/init.d/oma-ds /etc/rc.d/rc3.d/S91oma-ds-agent
-fi
-
-if [ ! -f /etc/rc.d/rc5.d/S91oma-ds-agent ]
-then
-       ln -s /etc/init.d/oma-ds /etc/rc.d/rc5.d/S91oma-ds-agent
-fi
-
-#/etc/init.d/oma-ds start
-
-
-%preun
-/etc/init.d/oma-ds stop
-
 
 %postun
 
 rm -f /tmp/agent_fw_event_omads*
 rm -f /tmp/agent_fw_noti_reply_omads*
-
-rm -f /etc/rc.d/rc3.d/S91oma-ds-agent
-rm -f /etc/rc.d/rc5.d/S91oma-ds-agent
-
 rm -f /opt/dbspace/.omasyncagent.db /opt/dbspace/.omasyncagent.db-journal
-
 rm -rf /usr/share/oma-ds-cfg
 
-
 %files
 %attr(600,root,root) /opt/dbspace/.omasyncagent.db
 %attr(600,root,root) /opt/dbspace/.omasyncagent.db-journal
@@ -120,9 +85,6 @@ rm -rf /usr/share/oma-ds-cfg
 
 /usr/share/oma-ds-cfg/*
 
-%defattr(700,root,root)
-/etc/init.d/oma-ds
-
 %defattr(644,root,root)
 /usr/lib/systemd/system/oma-ds-agent.service
 /usr/lib/systemd/system/graphical.target.wants/oma-ds-agent.service