From 49111d3b8ffb4a2c330ba05c992a33c115081b95 Mon Sep 17 00:00:00 2001 From: "John L. Whiteman" Date: Thu, 4 Sep 2014 10:38:35 -0700 Subject: Adding dbus/systemd config files to start daemons Change-Id: I49c668d286f012657c8c41dc4c820e305af7fcb6 Signed-off-by: John L. Whiteman --- packaging/com.tsc.ipc.server.plugin.conf | 13 ++++++++ packaging/com.tsc.ipc.server.wp.conf | 13 ++++++++ packaging/csf-framework.spec | 51 ++++++++++++++++++++++++++++---- packaging/tpcsserdaemon.service | 11 +++++++ packaging/twpserdaemon.service | 11 +++++++ 5 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 packaging/com.tsc.ipc.server.plugin.conf create mode 100644 packaging/com.tsc.ipc.server.wp.conf create mode 100644 packaging/tpcsserdaemon.service create mode 100644 packaging/twpserdaemon.service diff --git a/packaging/com.tsc.ipc.server.plugin.conf b/packaging/com.tsc.ipc.server.plugin.conf new file mode 100644 index 0000000..0be2c8d --- /dev/null +++ b/packaging/com.tsc.ipc.server.plugin.conf @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/packaging/com.tsc.ipc.server.wp.conf b/packaging/com.tsc.ipc.server.wp.conf new file mode 100644 index 0000000..a97c7d6 --- /dev/null +++ b/packaging/com.tsc.ipc.server.wp.conf @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/packaging/csf-framework.spec b/packaging/csf-framework.spec index 0e631d1..07dd913 100644 --- a/packaging/csf-framework.spec +++ b/packaging/csf-framework.spec @@ -7,6 +7,10 @@ Group: Security/Libraries URL: http://tizen.org Source: %{name}-%{version}.tar.gz Source1001: csf-framework.manifest +Source1002: com.tsc.ipc.server.plugin.conf +Source1003: com.tsc.ipc.server.wp.conf +Source1004: tpcsserdaemon.service +Source1005: twpserdaemon.service BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(dlog) @@ -18,6 +22,10 @@ A general purpose content screening and reputation solution. %prep %setup -q cp %{SOURCE1001} . +cp %{SOURCE1002} . +cp %{SOURCE1003} . +cp %{SOURCE1004} . +cp %{SOURCE1005} . %build cd framework @@ -39,17 +47,44 @@ make -f Makefile_TWPSerDaemon all %install rm -rf %{buildroot} -mkdir -p %{buildroot}%{_libdir}/ mkdir -p %{buildroot}%{_bindir}/ +mkdir -p %{buildroot}%{_libdir}/systemd/system +mkdir -p %{buildroot}/%{_sysconfdir}/dbus-1/system.d install -D framework/lib/libsecfw.so %{buildroot}%{_libdir}/ install -D framework/lib/libscclient.so %{buildroot}%{_libdir}/ install -D framework/lib/libscserver.so %{buildroot}%{_libdir}/ install -D framework/bin/TPCSSerDaemon %{buildroot}%{_bindir}/ install -D framework/bin/TWPSerDaemon %{buildroot}%{_bindir}/ +install -m0644 %{SOURCE1002} %{buildroot}%{_sysconfdir}/dbus-1/system.d/ +install -m0644 %{SOURCE1003} %{buildroot}%{_sysconfdir}/dbus-1/system.d/ +install -m0644 %{SOURCE1004} %{buildroot}%{_libdir}/systemd/system/ +install -m0644 %{SOURCE1005} %{buildroot}%{_libdir}/systemd/system/ -%post -p /sbin/ldconfig +%post +/sbin/ldconfig +systemctl daemon-reload +if [ $1 = 1 ]; then + systemctl restart tpcsserdaemon.service + systemctl restart twpserdaemon.service + systemctl enable tpcsserdaemon.service -q + systemctl enable twpserdaemon.service -q +fi -%postun -p /sbin/ldconfig +%preun +if [ $1 = 0 ]; then + systemctl stop tpcsserdaemon.service + systemctl stop twpserdaemon.service + systemctl disable tpcsserdaemon.service -q + systemctl disable twpserdaemon.service -q +fi + +%postun +/sbin/ldconfig +if [ $1 = 0 ]; then + systemctl daemon-reload +fi +rm -fr /usr/bin/tpcs_config.dtd +rm -fr /usr/bin/tpcs_config.xml %files %manifest %{name}.manifest @@ -57,5 +92,11 @@ install -D framework/bin/TWPSerDaemon %{buildroot}%{_bindir}/ %{_libdir}/libsecfw.so %{_libdir}/libscclient.so %{_libdir}/libscserver.so -%attr(755,root,root) %{_bindir}/TPCSSerDaemon -%attr(755,root,root) %{_bindir}/TWPSerDaemon +%defattr(0755,root,root) +%{_bindir}/TPCSSerDaemon +%{_bindir}/TWPSerDaemon +%defattr(0644,root,root) +%config %{_sysconfdir}/dbus-1/system.d/com.tsc.ipc.server.plugin.conf +%config %{_sysconfdir}/dbus-1/system.d/com.tsc.ipc.server.wp.conf +%{_libdir}/systemd/system/tpcsserdaemon.service +%{_libdir}/systemd/system/twpserdaemon.service diff --git a/packaging/tpcsserdaemon.service b/packaging/tpcsserdaemon.service new file mode 100644 index 0000000..db91ec1 --- /dev/null +++ b/packaging/tpcsserdaemon.service @@ -0,0 +1,11 @@ +[Unit] +Description=CSF Tizen Plugin Control Service Daemon (TPCSSerDaemon) + +[Service] +Type=dbus +ExecStart=/usr/bin/TPCSSerDaemon +BusName=com.tsc.ipc.server.plugin +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/packaging/twpserdaemon.service b/packaging/twpserdaemon.service new file mode 100644 index 0000000..815da09 --- /dev/null +++ b/packaging/twpserdaemon.service @@ -0,0 +1,11 @@ +[Unit] +Description=CSF Tizen Web Protection Service Daemon (TWPSerDaemon) + +[Service] +Type=dbus +ExecStart=/usr/bin/TWPSerDaemon +BusName=com.tsc.ipc.server.wp +Restart=always + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3