haveged/haveged.spec

92 lines
2.6 KiB
RPMSpec

#
# spec file for package haveged
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: haveged
Version: 0.9_git201101042303
Release: 1
License: GPLv3
Summary: Feed entropy into random pool
Url: http://www.issihosts.com/haveged/
Group: System/Daemons
# Our sources https://github.com/crrodriguez/haveged
Source0: http://www.issihosts.com/haveged/haveged-%{version}.tar.bz2
Source1: haveged.init
Source2: haveged.service
BuildRequires: libcap-ng-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(pre): %insserv_prereq
%if 0%{suse_version} >= 1140
Requires(pre): sysvinit(syslog)
%endif
Requires(post): grep util-linux
Enhances: openssl gpg2 php5 apache2 openvpn smtp_daemon
%{!?_initddir: %global _initddir /etc/init.d}
%description
The haveged daemon feeds the linux entropy pool with random
numbers generated from hidden processor state.
For more informations see http://www.issihosts.com/haveged/
%prep
%setup -q
%build
autoreconf -fiv
export LDFLAGS="-Wl,-z,relro,-z,now"
%configure --with-libcap-ng=yes --sbindir=/sbin --enable-nistest=yes
make %{?_smp_mflags}
%check
make %{?_smp_mflags} check
%install
%makeinstall
%{__install} -m0755 %{S:1} %{buildroot}%{_initddir}/haveged
%{__mkdir_p} %{buildroot}%{_sbindir}
%{__ln_s} -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
%{__mkdir_p} %{buildroot}/lib/systemd/system
%{__install} -m0755 %{S:2} %{buildroot}/lib/systemd/system/haveged.service
%clean
rm -rf %{buildroot}
%post
# do not enable on condition here, let YAST, kiwi or the user do it.
%{fillup_and_insserv -f %{name}}
%postun
%restart_on_update %{name}
%{insserv_cleanup}
%preun
%stop_on_removal %{name}
%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
%changelog