fixed systemd file [release 6.10-3mamba;Sat Dec 26 2020]

This commit is contained in:
Silvan Calarco 2024-01-05 17:26:33 +01:00
parent cecf21df0d
commit 19a868eb13
3 changed files with 89 additions and 2 deletions

View File

@ -0,0 +1,51 @@
diff --git a/.travis.yml b/.travis.yml
index be3bf06..b6acd39 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,10 @@
language: c
dist: trusty
+arch:
+ - amd64
+ - arm64
+
compiler:
- clang
- gcc
diff --git a/Makefile.am b/Makefile.am
index db4fcfc..5917023 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,9 +31,10 @@ rngd_LDADD = librngd.a -lsysfs $(LIBS) ${libp11_LIBS} ${libcrypto_LIBS} ${libcur
if PKCS11
rngd_SOURCES += rngd_pkcs11.c
+pkcs11_ENGINE = -DDEFAULT_PKCS11_ENGINE=\"$(PKCS11_ENGINE)\"
endif
-rngd_CFLAGS = ${pkcs11_CFLAGS} ${libp11_CFLAGS} ${libcrypto_CFLAGS} ${libxml2_CFLAGS} ${openssl_CFLAGS} $(PTHREAD_CFLAGS)
+rngd_CFLAGS = ${pkcs11_CFLAGS} ${pkcs11_ENGINE} ${libp11_CFLAGS} ${libcrypto_CFLAGS} ${libxml2_CFLAGS} ${openssl_CFLAGS} $(PTHREAD_CFLAGS)
rngd_LDFLAGS = $(PTHREAD_CFLAGS)
rngtest_SOURCES = exits.h stats.h stats.c rngtest.c
diff --git a/configure.ac b/configure.ac
index f252d03..616d8fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -111,6 +111,15 @@ AS_IF(
PKG_CHECK_MODULES([libp11], [libp11], [], [AC_MSG_ERROR([libp11 is required])])
PKG_CHECK_MODULES([libcrypto], [libcrypto], [], [AC_MSG_ERROR([libcrypto is required])])
AC_DEFINE([HAVE_PKCS11],1,[Enable PKCS11])
+ AS_CASE([$host_cpu],
+ [i?86|armv7hl],
+ [
+ PKCS11_ENGINE=/usr/lib/opensc-pkcs11.so
+ ],
+ [
+ PKCS11_ENGINE=/usr/lib64/opensc-pkcs11.so
+ ])
+ AC_SUBST([PKCS11_ENGINE])
]
)

View File

@ -1,14 +1,15 @@
Name: rng-tools Name: rng-tools
Version: 6.10 Version: 6.10
Release: 1mamba Release: 3mamba
Summary: A random number generator daemon Summary: A random number generator daemon
Group: System/Kernel and Hardware Group: System/Kernel and Hardware
Vendor: openmamba Vendor: openmamba
Distribution: openmamba Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/nhorman/rng-tools.git URL: https://github.com/nhorman/rng-tools.git
## GITSOURCE https://github.com/nhorman/rng-tools.git v6.10
Source: https://github.com/nhorman/rng-tools.git/v%{version}/rng-tools-%{version}.tar.bz2 Source: https://github.com/nhorman/rng-tools.git/v%{version}/rng-tools-%{version}.tar.bz2
Patch0: rng-tools-6.10-pkcs11-path.patch
Source1: rngd.service
License: GPL License: GPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
@ -22,6 +23,7 @@ BuildRequires: libsysfs-devel
BuildRequires: libusb-devel BuildRequires: libusb-devel
BuildRequires: libxml2-devel BuildRequires: libxml2-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
Requires: libopensc
BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description %description
@ -32,6 +34,10 @@ It monitors a set of entropy sources, and supplies entropy from them to the syst
%prep %prep
%setup -q %setup -q
#%ifarch x86_64 aarch64
#% patch0 -p1
#%endif
./autogen.sh ./autogen.sh
%build %build
@ -42,17 +48,38 @@ It monitors a set of entropy sources, and supplies entropy from them to the syst
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall %makeinstall
install -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/rngd.service
%clean %clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post
%systemd_post rngd
:
%preun
%systemd_preun rngd
:
%postun
%systemd_postun rngd
:
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%{_bindir}/rngtest %{_bindir}/rngtest
%{_sbindir}/rngd %{_sbindir}/rngd
%{_unitdir}/rngd.service
%{_mandir}/man1/rngtest.1* %{_mandir}/man1/rngtest.1*
%{_mandir}/man8/rngd.8* %{_mandir}/man8/rngd.8*
%doc AUTHORS COPYING %doc AUTHORS COPYING
%changelog %changelog
* Sat Dec 26 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 6.10-3mamba
- fixed systemd file
* Tue Apr 07 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 6.10-2mamba
- add systemd service file; require libopensc
* Sun Mar 29 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 6.10-1mamba * Sun Mar 29 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 6.10-1mamba
- package created using the webbuild interface - package created using the webbuild interface

9
rngd.service Normal file
View File

@ -0,0 +1,9 @@
[Unit]
Description=Hardware RNG Entropy Gatherer Daemon
ConditionVirtualization=!container
[Service]
ExecStart=/usr/sbin/rngd -f
[Install]
WantedBy=multi-user.target