haveged/haveged.spec

103 lines
2.8 KiB
RPMSpec

#
# spec file for package haveged (Version 0.9_git201011232331)
#
# Copyright (c) 2010 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_git201011252143
Release: 1
License: GPLv3
Group: System/Daemons
Summary: Feed entropy into random pool
Url: http://www.issihosts.com/haveged/
# Our sources https://github.com/crrodriguez/haveged
Source0: http://www.issihosts.com/haveged/haveged-%{version}.tar.xz
Source1: haveged.init
Source2: haveged.service
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(pre): %insserv_prereq
Requires(post): grep util-linux
Enhances: openssl gpg2 php5 apache2 openvpn smtp_daemon
BuildRequires: libcap-ng-devel lzma
%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
make DESTDIR=$RPM_BUILD_ROOT install
%{__install} -m0755 %{S:1} %{buildroot}/etc/init.d/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 $RPM_BUILD_ROOT
%post
## brace for impact...
%if 0%{?sles_version}
if [ -x /usr/bin/lscpu ]; then
if /usr/bin/lscpu | grep -q "Virtualization type" ; then
## Is a VM
%{fillup_and_insserv -fy %{name}}
else
## it isnt.
%{fillup_and_insserv -f %{name}}
fi
else
##there is no lscpu! shouldnt happend...
%{fillup_and_insserv -f %{name}}
fi
%else
%{fillup_and_insserv -fy %{name}}
%endif
%postun
%restart_on_update %{name}
%{insserv_cleanup}
%preun
%stop_on_removal %{name}
%files
%defattr(-,root,root)
%{_sbindir}/rc%{name}
/sbin/haveged
%config /etc/init.d/haveged
%{_mandir}/man8/haveged.8.gz
%dir /lib/systemd
%dir /lib/systemd/system
/lib/systemd/system/haveged.service
%changelog