summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChengwei Yang <chengwei.yang@intel.com>2013-08-21 13:01:13 +0800
committerChengwei Yang <chengwei.yang@intel.com>2013-08-21 13:12:38 +0800
commit3b269607504c4ab518dab56cdaaf4270da022017 (patch)
treefc3e04cbc9ee2b98414cb8aa3d862726811d0d47
parent448157562ba5dfafe46458821a6d2e3f64fcbe74 (diff)
downloadoma-ds-agent-3b269607504c4ab518dab56cdaaf4270da022017.tar.gz
oma-ds-agent-3b269607504c4ab518dab56cdaaf4270da022017.tar.bz2
oma-ds-agent-3b269607504c4ab518dab56cdaaf4270da022017.zip
Move systemd unit file out of packaging
As Tizen packaging guide suggests, systemd unit file should be part of source code rather than part of packaging. Change-Id: I3fa6a6196d881fa9229fe231e025e501f4d00822 Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
-rw-r--r--[-rwxr-xr-x]oma-ds-agent.service (renamed from packaging/oma-ds-agent.service)2
-rw-r--r--packaging/oma-ds-agent.changes3
-rwxr-xr-xpackaging/oma-ds-agent.spec6
-rwxr-xr-xsrc/agent/CMakeLists.txt5
4 files changed, 9 insertions, 7 deletions
diff --git a/packaging/oma-ds-agent.service b/oma-ds-agent.service
index 438d5c3..82092c6 100755..100644
--- a/packaging/oma-ds-agent.service
+++ b/oma-ds-agent.service
@@ -7,4 +7,4 @@ After=calendar.service contacts-service.service pushd.service msg-service.servic
ExecStart=/usr/bin/oma-ds-agent
[Install]
-WantedBy=graphical.target \ No newline at end of file
+WantedBy=graphical.target
diff --git a/packaging/oma-ds-agent.changes b/packaging/oma-ds-agent.changes
index e3a78ee..db80206 100644
--- a/packaging/oma-ds-agent.changes
+++ b/packaging/oma-ds-agent.changes
@@ -1,3 +1,6 @@
+* Wed Aug 21 2013 Chengwei Yang <chengwei.yang@intel.com>
+- Move systemd unit out of packaging
+
* Mon Aug 12 2013 Chengwei Yang <chengwei.yang@intel.com>
- Add .changes file
- Fix build failure due to badness exceeds limitation
diff --git a/packaging/oma-ds-agent.spec b/packaging/oma-ds-agent.spec
index 418851c..d3fbf7b 100755
--- a/packaging/oma-ds-agent.spec
+++ b/packaging/oma-ds-agent.spec
@@ -5,7 +5,6 @@ Release: 1
Group: Base/Device Management
License: Apache-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)
@@ -55,11 +54,6 @@ sqlite3 %{buildroot}/opt/dbspace/.omasyncagent.db "PRAGMA journal_mode = PERSIST
%make_install
-# systemd service script sertup
-mkdir -p %{buildroot}/usr/lib/systemd/system/graphical.target.wants
-install -m 0644 %SOURCE1 %{buildroot}/usr/lib/systemd/system/
-ln -s ../oma-ds-agent.service %{buildroot}/usr/lib/systemd/system/graphical.target.wants/oma-ds-agent.service
-
%clean
rm -rf %{buildroot}
diff --git a/src/agent/CMakeLists.txt b/src/agent/CMakeLists.txt
index 77638be..5588bdb 100755
--- a/src/agent/CMakeLists.txt
+++ b/src/agent/CMakeLists.txt
@@ -74,6 +74,11 @@ INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/oma-ds-cfg DESTINATION /usr/share)
# install oma ds dbus file
INSTALL(FILES ${CMAKE_SOURCE_DIR}/com.samsung.omadsagent.service DESTINATION /usr/share/dbus-1/services)
+# install systemd unit
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/oma-ds-agent.service DESTINATION /usr/lib/systemd/system)
+INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}/usr/lib/systemd/system/graphical.target.wants)")
+INSTALL(CODE "EXECUTE_PROCESS(COMMAND ln -sf ../oma-ds-agent.service . WORKING_DIRECTORY \$ENV{DESTDIR}/usr/lib/systemd/system/graphical.target.wants)")
+
# install booting script file
INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/${PROJECT_NAME} DESTINATION /etc/init.d/)