summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Stelmach <l.stelmach@samsung.com>2013-11-04 13:56:24 (GMT)
committerŁukasz Stelmach <l.stelmach@samsung.com>2013-11-04 13:56:24 (GMT)
commit54203f036a79b11f80763918ea1ac40284652e44 (patch)
tree99be2e714fec3a0f085d0319553e25e70d5146f5
parent4a40aceceda00f0b954900c9cb6a785ddb7f4439 (diff)
downloadtizen-mobile-session-54203f036a79b11f80763918ea1ac40284652e44.zip
tizen-mobile-session-54203f036a79b11f80763918ea1ac40284652e44.tar.gz
tizen-mobile-session-54203f036a79b11f80763918ea1ac40284652e44.tar.bz2
Provide a different version of user-session@.service for emulatorrefs/changes/64/11764/1
Use RPM's conditional building capabilities to provide a slightly different version of user-session@.service file on the emulator image. Change-Id: I7b2cade5ed4d4115ba50ba199c8e9a33f81a070d Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
-rw-r--r--packaging/tizen-mobile-session.spec20
-rw-r--r--packaging/user-session@.service.in (renamed from packaging/user-session@.service)2
2 files changed, 20 insertions, 2 deletions
diff --git a/packaging/tizen-mobile-session.spec b/packaging/tizen-mobile-session.spec
index f31b5d8..b371b0a 100644
--- a/packaging/tizen-mobile-session.spec
+++ b/packaging/tizen-mobile-session.spec
@@ -1,3 +1,4 @@
+%bcond_with emulator
Name: tizen-mobile-session
Summary: Target for tizen systemd user session
Version: 1
@@ -6,7 +7,7 @@ Group: System/Libraries
License: Public Domain
Source0: tizen-mobile-session.target
Source1: tizen-middleware.target
-Source2: user-session@.service
+Source2: user-session@.service.in
Source3: systemd-user-session
Source4: tizen-generate-env.service
@@ -23,9 +24,24 @@ mkdir -p %{buildroot}%{_libdir}/systemd/system/graphical.target.wants
mkdir -p %{buildroot}%{_libdir}/systemd/system/basic.target.wants
install -m 0644 %SOURCE0 %{buildroot}%{_libdir}/systemd/user/
install -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/user/
-install -m 0644 %SOURCE2 %{buildroot}%{_libdir}/systemd/system/
install -m 0644 %SOURCE4 %{buildroot}%{_libdir}/systemd/system/
+SERVICE_OPTIONS=
+UNIT_OPTIONS=
+%if %{with emulator}
+SERVICE_OPTIONS=TimeoutStartSec=0
+%endif
+sed -e "/@service_options@/ {
+ s/@service_options@/$SERVICE_OPTIONS/
+ /^\$/d
+ }
+ /@unit_options@/ {
+ s/@unit_options@/$UNIT_OPTIONS/
+ /^\$/d
+ }" \
+ %SOURCE2 > ./user-session@.service
+install -m 0644 user-session@.service %{buildroot}%{_libdir}/systemd/system/
+
ln -sf ../user-session@.service %{buildroot}%{_libdir}/systemd/system/graphical.target.wants/user-session@app.service
ln -sf tizen-mobile-session.target %{buildroot}%{_libdir}/systemd/user/default.target
ln -sf ../tizen-generate-env.service %{buildroot}%{_libdir}/systemd/system/basic.target.wants
diff --git a/packaging/user-session@.service b/packaging/user-session@.service.in
index 3f06862..4815433 100644
--- a/packaging/user-session@.service
+++ b/packaging/user-session@.service.in
@@ -8,6 +8,7 @@
[Unit]
Description=User Manager for %I
After=systemd-user-sessions.service dbus.service
+@unit_options@
[Service]
User=%I
@@ -20,3 +21,4 @@ Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/dbus/user_bus_socket
Environment=DISPLAY=:0
Environment=XDG_RUNTIME_DIR=/run/user/%U
EnvironmentFile=/etc/sysconfig/tizen-mobile-ui
+@service_options@