summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-admin/sysrqd/Manifest1
-rw-r--r--app-admin/sysrqd/files/sysrqd-17-fix-build-system.patch13
-rw-r--r--app-admin/sysrqd/sysrqd-17.ebuild53
3 files changed, 67 insertions, 0 deletions
diff --git a/app-admin/sysrqd/Manifest b/app-admin/sysrqd/Manifest
index 66767c06ced0..4c85a4aeb7f5 100644
--- a/app-admin/sysrqd/Manifest
+++ b/app-admin/sysrqd/Manifest
@@ -1 +1,2 @@
DIST sysrqd-14.tar.gz 4759 BLAKE2B 3ef8b2f5092a899753da487d0a82a71d2d93d0c6a70689b5923fa900f2766de15fa2e416cb667d800dac19499218a0246941b8c52bfe4421af774ccecc62222e SHA512 efad48be3974923ec14d0958e788115c9273bc29b4f03853e6e087f6af872299ea57d42f885be19ff4eeaffa577ecf1c53ea2adb2f84e1487bb2511597b89cb2
+DIST sysrqd-17.tar.gz 5232 BLAKE2B 4fd3baf7bce45b43577db7cd4a383161a8d69bd88e041afe20c33d3812235829729c57b748321195c2bccea819827655080199c0167bafad7252ca29b2a3a27c SHA512 fd0e42d2edd5e8548510aa823b2fef6339b2dc1dde1fe387585b9f2611e7d944fa6d73447e3f58a0aa00d45a88459c6e9cbb619428282abf367f62a8270e5d54
diff --git a/app-admin/sysrqd/files/sysrqd-17-fix-build-system.patch b/app-admin/sysrqd/files/sysrqd-17-fix-build-system.patch
new file mode 100644
index 000000000000..2118b8e682e3
--- /dev/null
+++ b/app-admin/sysrqd/files/sysrqd-17-fix-build-system.patch
@@ -0,0 +1,13 @@
+--- sysrqd-17/Makefile 2019-04-08 15:37:16.000000000 +0200
++++ sysrqd-17-ng/Makefile 2019-05-20 19:55:15.842841704 +0200
+@@ -5,8 +5,9 @@
+ -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wsign-compare \
+ -Wunused -Winit-self -Wpointer-arith -Wredundant-decls \
+ -Wmissing-prototypes -Wmissing-format-attribute -Wmissing-noreturn \
+- -std=gnu99 -pipe -DSYSRQD_VERSION="\"$(VERSION)\"" -O3
++ -std=gnu99
+ LDFLAGS+=-lcrypt
++CPPFLAGS+=-DSYSRQD_VERSION="\"$(VERSION)\""
+
+ SBINDIR=$(DESTDIR)/usr/sbin
+ #MANDIR=$(DESTDIR)/usr/share/man/man1
diff --git a/app-admin/sysrqd/sysrqd-17.ebuild b/app-admin/sysrqd/sysrqd-17.ebuild
new file mode 100644
index 000000000000..541c67095fc1
--- /dev/null
+++ b/app-admin/sysrqd/sysrqd-17.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="Daemon providing access to the kernel sysrq functions via network"
+HOMEPAGE="https://github.com/jd/sysrqd"
+SRC_URI="https://github.com/jd/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-config.patch
+ "${FILESDIR}"/${P}-fix-build-system.patch
+)
+
+src_configure() {
+ tc-export CC
+}
+
+src_install() {
+ dosbin sysrqd
+ newinitd "${FILESDIR}/sysrqd.init" sysrqd
+
+ local bindip='127.0.0.1' secret
+ declare -i secret
+ let secret="${RANDOM}*${RANDOM}*${RANDOM}*${RANDOM}"
+ echo "${bindip}" > sysrqd.bind || die
+ echo "${secret}" > sysrqd.secret || die
+
+ diropts -m 0700 -o root -g root
+ dodir /etc/sysrqd
+ insinto /etc/sysrqd
+ insopts -m 0600 -o root -g root
+ doins sysrqd.bind
+ doins sysrqd.secret
+
+ einstalldocs
+}
+
+pkg_postinst() {
+ elog
+ elog "Be sure to change the initial secret in /etc/sysrqd/sysrqd.secret !"
+ elog "As a security precaution, sysrqd is configured to only listen on"
+ elog "127.0.0.1 by default. Change the content of /etc/sysrqd/sysrqd.bind"
+ elog "to an IPv4 address you want it to listen on or remove the file"
+ elog "to make it listen on any IP address (0.0.0.0)."
+ elog
+}