Accepting request 160369 from home:elvigia:branches:security

- Remove all sysvinit compatibility.

OBS-URL: https://build.opensuse.org/request/show/160369
OBS-URL: https://build.opensuse.org/package/show/security/haveged?expand=0&rev=75
This commit is contained in:
Michal Vyskocil 2013-03-21 11:27:42 +00:00 committed by Git OBS Bridge
parent 056c2cebf7
commit 7216d944f9
3 changed files with 8 additions and 151 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Mar 20 23:28:42 UTC 2013 - crrodriguez@opensuse.org
- Remove all sysvinit compatibility.
-------------------------------------------------------------------
Mon Jan 21 01:18:16 CET 2013 - ro@suse.de

View File

@ -1,113 +0,0 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: haveged
# Required-Start: $syslog $local_fs $remote_fs
# Required-Stop: $syslog $local_fs $remote_fs
# Default-Start: 2 3 5
# Default-Stop:
# Short-Description: Daemon to feed entropy into /dev/urandom
# Description: The haveged daemon uses the timing variations that occur in executing a fixed loop
# to generate random numbers that are fed into the random pool.
### END INIT INFO
HAVEGED_BIN=/usr/sbin/haveged
HAVEGED_PARAMS="-w 1024 -v 0"
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
. /etc/rc.status
# First reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - misc error
# 2 - invalid or excess args
# 3 - unimplemented feature (e.g. reload)
# 4 - insufficient privilege
# 5 - program not installed
# 6 - program not configured
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.
case "$1" in
start)
echo -n "Starting haveged daemon "
## Start daemon with startproc(8). If this fails
## the echo return value is set appropriate.
# startproc should return 0, even if service is
# already running to match LSB spec.
startproc $HAVEGED_BIN $HAVEGED_PARAMS
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down haveged daemon "
killproc -TERM $HAVEGED_BIN
# Remember status and be verbose
rc_status -v
;;
try-restart|condrestart)
## Do a restart only if the service was active before.
## Note: try-restart is now part of LSB (as of 1.9).
## RH has a similar command named condrestart.
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
# Remember status and be quiet
rc_status
;;
restart | force-reload)
$0 stop
$0 start
;;
reload)
## Like force-reload, but if daemon does not support
## signaling, do nothing (!)
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for haveged daemon "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
# NOTE: checkproc returns LSB compliant status values.
checkproc $HAVEGED_BIN
rc_status -v
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload}"
exit 1
;;
esac
rc_exit
# vim: set sw=4 ts=4 et:

View File

@ -24,23 +24,13 @@ License: GPL-3.0
Group: System/Daemons
Url: http://www.issihosts.com/haveged/
Source0: http://www.issihosts.com/haveged/%{name}-%{version}.tar.gz
Source1: %{name}.init
Source2: %{name}.service
Patch0: haveged-ppc.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: automake
Requires(pre): %insserv_prereq
%if 0%{suse_version} >= 1140
Requires(pre): sysvinit(syslog)
%endif
Requires(post): grep util-linux
BuildRequires: libtool
Enhances: openssl gpg2 php5 apache2 openvpn smtp_daemon
%{!?_initddir: %global _initddir /etc/init.d}
%if 0%{?suse_version} > 1140
BuildRequires: systemd
BuildRequires: pkgconfig(systemd)
%{?systemd_requires}
%define have_systemd 1
%endif
%description
The haveged daemon feeds the linux entropy pool with random
@ -72,12 +62,10 @@ algorithm and supporting features.
%patch0 -p1
%build
%if 0%{?suse_version} < 1220
autoreconf -fiv
%endif
export CFLAGS="%optflags -fpie"
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
%configure \
%configure --disable-static \
--enable-nistest=yes \
--enable-daemon=yes \
--enable-clock_gettime=yes
@ -97,42 +85,23 @@ make %{?_smp_mflags} check
%install
%makeinstall
%{__install} -D -m0755 %{S:1} %{buildroot}%{_initddir}/%{name}
%{__mkdir_p} %{buildroot}%{_sbindir}
%{__ln_s} -f %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
%if 0%{?have_systemd}
%{__install} -D -m0644 %{S:2} %{buildroot}%{_unitdir}/%{name}.service
%endif
%{__rm} -f %{buildroot}%{_libdir}/libhavege.*a
%clean
%{?buildroot:%__rm -rf "%{buildroot}"}
%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
%post -n libhavege1 -p /sbin/ldconfig
@ -141,13 +110,9 @@ make %{?_smp_mflags} check
%files
%defattr(-,root,root)
%doc COPYING
%{_sbindir}/rc%{name}
%{_sbindir}/%{name}
%config %{_initddir}/%{name}
%doc %{_mandir}/man8/%{name}.8*
%if 0%{?have_systemd}
%{_unitdir}/%{name}.service
%endif
%files devel
%doc COPYING