Mail archive
alpine-aports

[alpine-aports] [PATCH] testing/rng-tools: new aport

From: Dennis Przytarski <dennis_at_przytarski.com>
Date: Mon, 20 Jul 2015 07:56:06 +0000

a random number generator daemon

http://sourceforge.net/projects/gkernel/
---
 testing/rng-tools/APKBUILD   | 58 ++++++++++++++++++++++++++++++++++++++++++++
 testing/rng-tools/rngd.confd |  4 +++
 testing/rng-tools/rngd.initd | 26 ++++++++++++++++++++
 3 files changed, 88 insertions(+)
 create mode 100644 testing/rng-tools/APKBUILD
 create mode 100644 testing/rng-tools/rngd.confd
 create mode 100644 testing/rng-tools/rngd.initd
diff --git a/testing/rng-tools/APKBUILD b/testing/rng-tools/APKBUILD
new file mode 100644
index 0000000..8747e23
--- /dev/null
+++ b/testing/rng-tools/APKBUILD
_at_@ -0,0 +1,58 @@
+# Contributor: Dennis Przytarski <dennis_at_przytarski.com>
+# Maintainer:
+pkgname=rng-tools
+pkgver=5
+pkgrel=0
+pkgdesc="a random number generator daemon"
+url="http://sourceforge.net/projects/gkernel/"
+arch="all"
+license="GPL2"
+depends=""
+depends_dev="argp-standalone linux-headers"
+makedepends="$depends_dev"
+install=
+subpackages=
+source="http://downloads.sourceforge.net/project/gkernel/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz
+	rngd.confd
+	rngd.initd
+	"
+
+_builddir="$srcdir"/$pkgname-$pkgver
+prepare() {
+	local i
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
+
+build() {
+	cd "$_builddir"
+	export LIBS="-largp"
+	./configure \
+		--prefix=/usr \
+		--libexecdir=/usr/lib/rng-tools \
+		--sysconfdir=/etc \
+		--disable-silent-rules
+	make || return 1
+}
+
+package() {
+	cd "$_builddir"
+	make DESTDIR="${pkgdir}" install || return 1
+
+	install -m644 -D "${srcdir}/rngd.confd" "${pkgdir}/etc/conf.d/rngd" || return 1
+	install -m755 -D "${srcdir}/rngd.initd" "${pkgdir}/etc/init.d/rngd" || return 1
+}
+
+md5sums="6726cdc6fae1f5122463f24ae980dd68  rng-tools-5.tar.gz
+6f883db10f299d0640e0b3c5fa6e6175  rngd.confd
+afe366ae9d230898abf7984e4fd6686a  rngd.initd"
+sha256sums="60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e  rng-tools-5.tar.gz
+5cd5751f8b849b3df9c8d5203e137123ef4603eb882f02603c83a61c5365f237  rngd.confd
+3bf0a290067f4e02aa1b655ecd609ab21ff4bea28aab77659c4926a26029ec28  rngd.initd"
+sha512sums="58047c37cad4f5f1210b696e4dba122878f78e57d05d9cb822f79234240ecce31efd2d39061fea1eb5b2e81d48d8c3bf6b92d06451f1ce5d5db7117704e89c50  rng-tools-5.tar.gz
+2823cdb88cd45652d7d5097cdb239b404d7754930995f957dc2653c03762952cefc7c804f3dabfe8a4836bd098a4265cff67cff351b22cccf94d70efad293e2b  rngd.confd
+833612de0fb3f3f4a43a1d570660bd95a544983f1fe6e4a7b34e2a039729512dd76077e1a2469552830b98a869e47f4c8685fc55219beaca267993d8f0bdd2b9  rngd.initd"
diff --git a/testing/rng-tools/rngd.confd b/testing/rng-tools/rngd.confd
new file mode 100644
index 0000000..8650720
--- /dev/null
+++ b/testing/rng-tools/rngd.confd
_at_@ -0,0 +1,4 @@
+command=/usr/sbin/rngd
+command_args="--no-drng=1 --no-tpm=1"
+pidfile=/var/run/rngd.pid
+
diff --git a/testing/rng-tools/rngd.initd b/testing/rng-tools/rngd.initd
new file mode 100644
index 0000000..5ec0423
--- /dev/null
+++ b/testing/rng-tools/rngd.initd
_at_@ -0,0 +1,26 @@
+#!/sbin/openrc-run
+
+name=rngd
+daemon=/usr/sbin/$name
+
+depend() {
+	need localmount
+	after urandom
+	provide entropy
+}
+
+start() {
+	ebegin "Starting ${name}"
+	start-stop-daemon --start \
+		--pidfile $pidfile --exec $command -- $command_args
+        eend $?
+}
+
+stop() {
+	ebegin "Stopping ${name}"
+	if [ -f $pidfile ]; then
+		start-stop-daemon --stop --pidfile $pidfile
+	fi
+	ewend $?
+}
+
-- 
2.4.1
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Mon Jul 20 2015 - 07:56:06 GMT