From 2c8fab5d0476dc6d15cad5e1de2f6a8dbe879e564122b4d78667877c69d5108e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Tue, 29 Nov 2011 03:23:27 +0000 Subject: [PATCH] Accepting request 94188 from home:elvigia:branches:security - Use proper systemd macros - reduce verbosity level to the minimum OBS-URL: https://build.opensuse.org/request/show/94188 OBS-URL: https://build.opensuse.org/package/show/security/haveged?expand=0&rev=49 --- haveged.changes | 6 ++++++ haveged.service | 2 +- haveged.spec | 46 ++++++++++++++++++++++++++++++++++------------ 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/haveged.changes b/haveged.changes index 64bb875..fcfda1e 100644 --- a/haveged.changes +++ b/haveged.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Nov 29 03:21:09 UTC 2011 - crrodriguez@opensuse.org + +- Use proper systemd macros +- reduce verbosity level to the minimum + ------------------------------------------------------------------- Tue Nov 22 14:24:33 UTC 2011 - crrodriguez@opensuse.org diff --git a/haveged.service b/haveged.service index fee5074..2e66135 100644 --- a/haveged.service +++ b/haveged.service @@ -4,7 +4,7 @@ After= local-fs.target syslog.target [Service] Type=simple -ExecStart=/sbin/haveged -F 1 -w 1024 -v 1 +ExecStart=/sbin/haveged -F 1 -w 1024 -v 0 [Install] WantedBy=multi-user.target diff --git a/haveged.spec b/haveged.spec index cc4cf8d..9357f4b 100644 --- a/haveged.spec +++ b/haveged.spec @@ -24,10 +24,10 @@ License: GPLv3 Summary: Feed entropy into random pool Url: http://www.issihosts.com/haveged/ Group: System/Daemons -Source0: http://www.issihosts.com/haveged/haveged-%{version}.tar.gz -Source1: haveged.init -Source2: haveged.service -Patch1: haveged-ppc64.patch +Source0: http://www.issihosts.com/haveged/%{name}-%{version}.tar.gz +Source1: %{name}.init +Source2: %{name}.service +Patch1: %{name}-ppc64.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build ExcludeArch: %{arm} Requires(pre): %insserv_prereq @@ -37,6 +37,11 @@ Requires(pre): sysvinit(syslog) Requires(post): grep util-linux Enhances: openssl gpg2 php5 apache2 openvpn smtp_daemon %{!?_initddir: %global _initddir /etc/init.d} +%if 0%{?suse_version} > 1140 +BuildRequires: systemd +%{?systemd_requires} +%define have_systemd 1 +%endif %description The haveged daemon feeds the linux entropy pool with random @@ -59,10 +64,13 @@ make %{?_smp_mflags} check %install %makeinstall -%{__install} -D -m0755 %{S:1} %{buildroot}%{_initddir}/haveged +%{__install} -D -m0755 %{S:1} %{buildroot}%{_initddir}/%{name} %{__mkdir_p} %{buildroot}%{_sbindir} %{__ln_s} -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name} -%{__install} -D -m0755 %{S:2} %{buildroot}/lib/systemd/system/haveged.service + +%if 0%{?have_systemd} +%{__install} -D -m0644 %{S:2} %{buildroot}%{_unitdir}/%{name}.service +%endif %clean %{?buildroot:%__rm -rf "%{buildroot}"} @@ -70,22 +78,36 @@ make %{?_smp_mflags} check %post # do not enable on condition here, let YAST, kiwi or the user do it. %{fillup_and_insserv -f %{name}} +%if 0%{?have_systemd} +%service_add_post %{name}.service +%endif %postun %restart_on_update %{name} %{insserv_cleanup} +%if 0%{?have_systemd} +%service_del_postun %{name}.service +%endif + +%pre +%if 0%{?have_systemd} +%service_add_pre %{name}.service +%endif %preun %stop_on_removal %{name} +%if 0%{?have_systemd} +%service_del_preun %{name}.service +%endif %files %defattr(-,root,root) %{_sbindir}/rc%{name} -/sbin/haveged -%config %{_initddir}/haveged -%{_mandir}/man8/haveged.8.gz -%dir /lib/systemd -%dir /lib/systemd/system -/lib/systemd/system/haveged.service +/sbin/%{name} +%config %{_initddir}/%{name} +%{_mandir}/man8/%{name}.8.gz +%if 0%{?have_systemd} +%{_unitdir}/%{name}.service +%endif %changelog