Source1002: sdbd_emulator.service
Source1003: %{name}.manifest
Source1004: sdbd_tcp.service
+Source1005: sdbd_device_tv.service
+Source1006: sdbd_emulator_tv.service
BuildRequires: capi-system-info-devel >= 0.2.0
BuildRequires: cmake >= 2.8.3
%make_install
mkdir -p %{buildroot}%{_libdir}/systemd/system
mkdir -p %{buildroot}%{_unitdir}
+
%ifarch %{ix86}
+%if "%{profile}" == "tv"
+install -m 0644 %SOURCE1006 %{buildroot}%{_libdir}/systemd/system/sdbd.service
+%else
install -m 0644 %SOURCE1002 %{buildroot}%{_libdir}/systemd/system/sdbd.service
+%endif
mkdir -p %{buildroot}/%{_libdir}/systemd/system/emulator_preinit.target.wants
ln -s %{_libdir}/systemd/system/sdbd.service %{buildroot}/%{_libdir}/systemd/system/emulator_preinit.target.wants/
+
+%else
+%if "%{profile}" == "tv"
+install -m 0644 %SOURCE1005 %{buildroot}%{_unitdir}/sdbd.service
%else
install -m 0644 %SOURCE1001 %{buildroot}%{_unitdir}/sdbd.service
+%endif
install -m 0644 %SOURCE1004 %{buildroot}%{_unitdir}/sdbd_tcp.service
mkdir -p %{buildroot}/%{_libdir}/systemd/system/multi-user.target.wants
ln -s %{_libdir}/systemd/system/sdbd.service %{buildroot}/%{_libdir}/systemd/system/multi-user.target.wants/
--- /dev/null
+[Unit]
+Description=sdbd
+Requires=tizen-system-env.service
+After=tmp.mount
+
+[Service]
+Type=forking
+#location of SDBD log file
+#Environment=SDBD_LOG_PATH=/tmp
+EnvironmentFile=-/run/tizen-system-env
+OOMScoreAdjust=-1000
+PIDFile=/tmp/.sdbd.pid
+Restart=on-failure
+ExecStart=/usr/sbin/sdbd
+
+[Install]
+WantedBy=multi-user.target
--- /dev/null
+[Unit]
+Description=sdbd
+Before=sensord.service
+After=tmp.mount dbus.service
+#DefaultDependencies=false
+
+[Service]
+Type=forking
+#location of SDBD log file
+#Environment=SDBD_LOG_PATH=/tmp
+Environment=DISPLAY=:0
+PIDFile=/tmp/.sdbd.pid
+RemainAfterExit=yes
+OOMScoreAdjust=-1000
+#ExecStartPre=/bin/bash -c "/bin/echo '10.0.2.15/32 system::debugging_network' >> /smack/netlabel"
+ExecStart=/bin/sh -c "/usr/sbin/sdbd `/usr/bin/awk '{match($0, /sdb_port=([0-9]+)/,port_match); match($0, /vm_name=([^, ]*)/,vm_match); print \"--emulator=\" vm_match[1] \":\" port_match[1] \" --connect-to=10.0.2.2:26099\" \" --sensors=10.0.2.2:\"port_match[1]+3 }' /proc/cmdline`"
+
+[Install]
+WantedBy=emulator_preinit.target
+