haveged/haveged.spec
Tomáš Chvátal d41d862a9d - Cleanup with spec-cleaner
- Adapt the service file to be forking and match what it does for
  me on Gentoo.
- Disable threads as they seem break some times.
- Capitalize summaries to make rpmlint happy.

OBS-URL: https://build.opensuse.org/package/show/security/haveged?expand=0&rev=90
2014-05-07 09:24:36 +00:00

140 lines
3.6 KiB
RPMSpec

#
# spec file for package haveged
#
# Copyright (c) 2014 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: 1.9.1
Release: 0
Summary: Feed entropy into random pool
License: GPL-3.0
Group: System/Daemons
Url: http://www.issihosts.com/haveged/
Source0: http://www.issihosts.com/haveged/%{name}-%{version}.tar.gz
Source2: %{name}.service
Patch0: ppc64le.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: pkgconfig(systemd)
Enhances: apache2
Enhances: gpg2
Enhances: openssl
Enhances: openvpn
Enhances: php5
Enhances: smtp_daemon
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?systemd_requires}
%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/
%package devel
Summary: Haveged development files
Group: Development/Libraries
Requires: libhavege1 = %{version}
%description devel
Headers and for the haveged library
This package contains the haveged implementation of the HAVEGE
algorithm and supporting features.
%package -n libhavege1
Summary: Haveged interface library
Group: Development/Libraries/C and C++
%description -n libhavege1
Shared object for the haveged library
This package contains the haveged implementation of the HAVEGE
algorithm and supporting features.
%prep
%setup -q
%patch0 -p1
autoreconf -fvi
%build
export CFLAGS="%{optflags} -fpie"
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
# Threads seem broken
%configure \
--disable-static \
--disable-threads \
--enable-nistest \
--enable-daemon \
--enable-clock_gettime
make %{?_smp_mflags}
%check
#XXX: nist test is killed by SIGKILL with static int random_pool1[_32MB] on
# 32bit. Let change it to _08MB to avoid the test beeing killed, even if I
# am not sure allocate of 128M is prohibited
%ifarch %ix86
sed -i 's/\[_32MB\]/[_08MB]/' nist/nist.c
%endif
make %{?_smp_mflags} check
%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
install -D -m0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
rm -f %{buildroot}%{_libdir}/libhavege.*a
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
%post
%service_add_post %{name}.service
%postun
%service_del_postun %{name}.service
%pre
%service_add_pre %{name}.service
%preun
%service_del_preun %{name}.service
%post -n libhavege1 -p /sbin/ldconfig
%postun -n libhavege1 -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc COPYING
%{_sbindir}/rc%{name}
%{_sbindir}/%{name}
%doc %{_mandir}/man8/%{name}.8*
%{_unitdir}/%{name}.service
%files devel
%defattr(-,root,root)
%doc COPYING
%{_mandir}/man3/libhavege.3*
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/havege.h
%doc contrib/build/havege_sample.c
%{_libdir}/*.so
%files -n libhavege1
%defattr(-,root,root)
%doc COPYING
%{_libdir}/*.so.*
%changelog