systemd service
This commit is contained in:
parent
fdf70c311f
commit
ac59ed77dd
@ -1,19 +1,24 @@
|
||||
|
||||
%global _sbindir /sbin
|
||||
|
||||
Summary: Random number generator related utilities
|
||||
Name: rng-tools
|
||||
Version: 3
|
||||
Release: 4%{?dist}
|
||||
Group: System Environment/Base
|
||||
License: GPLv2+
|
||||
URL: http://sourceforge.net/projects/gkernel/
|
||||
Source0: http://downloads.sourceforge.net/project/gkernel/rng-tools/3/rng-tools-%{version}.tar.gz
|
||||
Summary: Random number generator related utilities
|
||||
Name: rng-tools
|
||||
Version: 3
|
||||
Release: 4%{?dist}
|
||||
Group: System Environment/Base
|
||||
License: GPLv2+
|
||||
URL: http://sourceforge.net/projects/gkernel/
|
||||
Source0: http://downloads.sourceforge.net/project/gkernel/rng-tools/3/rng-tools-%{version}.tar.gz
|
||||
Source1: rngd.service
|
||||
|
||||
# Man pages
|
||||
Patch0: rng-tools-man.patch
|
||||
Patch0: rng-tools-man.patch
|
||||
|
||||
BuildRequires: groff gettext
|
||||
BuildRequires: groff gettext
|
||||
BuildRequires: systemd-units
|
||||
Requires(post): systemd-units
|
||||
Requires(preun): systemd-units
|
||||
Requires(postun): systemd-units
|
||||
|
||||
%description
|
||||
Hardware random number generation tools.
|
||||
@ -30,6 +35,29 @@ make %{?_smp_mflags}
|
||||
%install
|
||||
make DESTDIR=%{buildroot} install
|
||||
|
||||
# install systemd unit file
|
||||
mkdir -p %{buildroot}%{_unitdir}
|
||||
install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
|
||||
|
||||
%post
|
||||
if [ $1 -eq 1 ] ; then
|
||||
# Initial installation
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
# Package removal, not upgrade
|
||||
/bin/systemctl --no-reload disable rngd.service > /dev/null 2>&1 || :
|
||||
/bin/systemctl stop rngd.service > /dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%postun
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
if [ $1 -ge 1 ] ; then
|
||||
# Package upgrade, not uninstall
|
||||
/bin/systemctl try-restart rngd.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%files
|
||||
%doc AUTHORS ChangeLog COPYING NEWS README
|
||||
@ -37,9 +65,11 @@ make DESTDIR=%{buildroot} install
|
||||
%{_sbindir}/rngd
|
||||
%{_mandir}/man1/rngtest.1.*
|
||||
%{_mandir}/man8/rngd.8.*
|
||||
%attr(0644,root,root) %{_unitdir}/rngd.service
|
||||
|
||||
%changelog
|
||||
* Thu Jan 12 2012 Jiri Popelka <jpopelka@redhat.com> - 3-4
|
||||
- systemd service
|
||||
- man page fixes
|
||||
- modernize spec file
|
||||
|
||||
|
||||
8
rngd.service
Normal file
8
rngd.service
Normal file
@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Hardware RNG Entropy Gatherer Daemon
|
||||
|
||||
[Service]
|
||||
ExecStart=/sbin/rngd -f
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Reference in New Issue
Block a user