diff options
author | Patrick McCarty <patrick.mccarty@linux.intel.com> | 2012-06-25 11:55:41 -0700 |
---|---|---|
committer | Patrick McCarty <patrick.mccarty@linux.intel.com> | 2012-06-25 11:55:47 -0700 |
commit | 44c53fbc69df4da8fb43a84318ac60bad59bfe69 (patch) | |
tree | 9c76cda0a6a45d33cdeae9c603f7baa420d1a4d1 | |
parent | c58a25bac3a007ea4c244cb873f86aba91c113ed (diff) | |
download | secure-storage-1.0_post.tar.gz secure-storage-1.0_post.tar.bz2 secure-storage-1.0_post.zip |
Add a systemd service file; create initscript symlinks in %install1.0_post
-rw-r--r-- | packaging/secure-storage.changes | 4 | ||||
-rw-r--r-- | packaging/secure-storage.service | 10 | ||||
-rw-r--r-- | packaging/secure-storage.spec | 58 |
3 files changed, 50 insertions, 22 deletions
diff --git a/packaging/secure-storage.changes b/packaging/secure-storage.changes new file mode 100644 index 0000000..348909b --- /dev/null +++ b/packaging/secure-storage.changes @@ -0,0 +1,4 @@ +* Mon Jun 25 2012 Patrick McCarty <patrick.mccarty@linux.intel.com> - 0.12.7 +- Create initscripts in %install instead of %post +- Add a systemd service file + diff --git a/packaging/secure-storage.service b/packaging/secure-storage.service new file mode 100644 index 0000000..d46ceee --- /dev/null +++ b/packaging/secure-storage.service @@ -0,0 +1,10 @@ + +[Unit] +Description=Start the Secure Storage server + +[Service] +ExecStartPre=-/bin/mkdir -p /csa +ExecStart=/usr/bin/ss-server + +[Install] +WantedBy=multi-user.target diff --git a/packaging/secure-storage.spec b/packaging/secure-storage.spec index 7b3d2bc..f784a0b 100644 --- a/packaging/secure-storage.spec +++ b/packaging/secure-storage.spec @@ -1,16 +1,12 @@ -#sbs-git:slp/pkgs/s/secure-storage secure-storage 0.12.7 b703988ab31e25e5cbb23de33d39b411f6052e1f Name: secure-storage Summary: Secure storage -Version: 0.12.7 +Version: 0.12.7 Release: 1 Group: System/Security License: Apache 2.0 Source0: secure-storage-%{version}.tar.gz -Source1001: packaging/secure-storage.manifest -Requires(post): /sbin/service -Requires(post): /sbin/chkconfig -Requires(postun): /sbin/service -Requires(postun): /sbin/chkconfig +Source1: secure-storage.service +Source1001: packaging/secure-storage.manifest BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(security-server) @@ -40,6 +36,10 @@ Secure storage package (client-devel) %package -n ss-server Summary: Secure storage (ss-server) Group: Development/Libraries +Requires(preun): /usr/bin/systemctl +Requires(post): /usr/bin/systemctl +Requires(postun): /usr/bin/systemctl +Requires: systemd Requires: libss-client = %{version}-%{release} %description -n ss-server @@ -60,16 +60,28 @@ make %{?jobs:-j%jobs} rm -rf %{buildroot} %make_install +mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants +install -m 0644 %{SOURCE1} %{buildroot}%{_libdir}/systemd/system/secure-storage.service +ln -s ../secure-storage.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/secure-storage.service + +mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d +mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d +ln -s ../init.d/ss-serverd %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S40ss-server +ln -s ../init.d/ss-serverd %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S40ss-server + +%preun -n ss-server +if [ $1 == 0 ]; then + systemctl stop secure-storage.service +fi %post -n ss-server -mkdir -p /etc/rc.d/rc3.d -mkdir -p /etc/rc.d/rc5.d -ln -s /etc/rc.d/init.d/ss-serverd /etc/rc.d/rc3.d/S40ss-server -ln -s /etc/rc.d/init.d/ss-serverd /etc/rc.d/rc5.d/S40ss-server +systemctl daemon-reload +if [ $1 == 1 ]; then + systemctl restart secure-storage.service +fi %postun -n ss-server -rm -f /etc/rc.d/rc3.d/S40ss-server -rm -f /etc/rc.d/rc5.d/S40ss-server +systemctl daemon-reload %post -n libss-client -p /sbin/ldconfig @@ -77,20 +89,22 @@ rm -f /etc/rc.d/rc5.d/S40ss-server %files -n ss-server %manifest secure-storage.manifest -%defattr(-,root,root,-) -/usr/share/secure-storage/config -/etc/rc.d/init.d/ss-serverd -/usr/bin/ss-server +%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/ss-serverd +%{_sysconfdir}/rc.d/rc3.d/S40ss-server +%{_sysconfdir}/rc.d/rc5.d/S40ss-server +%{_bindir}/ss-server +%{_libdir}/systemd/system/secure-storage.service +%{_libdir}/systemd/system/multi-user.target.wants/secure-storage.service +%{_datadir}/secure-storage/config %files -n libss-client %manifest secure-storage.manifest -%defattr(-,root,root) -/usr/lib/libss-client.so.* +%{_libdir}/libss-client.so.* %files -n libss-client-devel %manifest secure-storage.manifest %defattr(-,root,root,-) -/usr/include/ss_manager.h -/usr/lib/pkgconfig/secure-storage.pc -/usr/lib/libss-client.so +%{_includedir}/ss_manager.h +%{_libdir}/pkgconfig/secure-storage.pc +%{_libdir}/libss-client.so |