summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-auth/rtkit/Manifest1
-rw-r--r--sys-auth/rtkit/files/rtkit-0.12_libsystemd_optional.patch63
-rw-r--r--sys-auth/rtkit/files/rtkit-0.12_noexecstack.patch10
-rw-r--r--sys-auth/rtkit/rtkit-0.12.ebuild49
4 files changed, 123 insertions, 0 deletions
diff --git a/sys-auth/rtkit/Manifest b/sys-auth/rtkit/Manifest
index 93133abc2da0..c99b05393585 100644
--- a/sys-auth/rtkit/Manifest
+++ b/sys-auth/rtkit/Manifest
@@ -1 +1,2 @@
DIST rtkit-0.11.tar.xz 126748 BLAKE2B e989f1fb9e33c2e06d7eedbe0aab45982d458b6a80aa8ba9b05ae94ed048ef1351d30f8800859a08d8bb0a53891e7b63f6bda6308b4521da10a61182ca3921f9 SHA512 4641af965dc64c0f498ae469fbee1ceb337204fa7d778fbbb41f2b5c5e88947e633c7e9ad037274fdd778c3c097a4a1dbb0b2add287d74eccbcd2d357cb2da22
+DIST rtkit-0.12.tar.xz 127504 BLAKE2B c2132098b98f24c1f1662df08c9940772cdad9a326c0c4b9180aac2e0878b0c71e5917ab2535628aab12ff29546faef1c68f455625c77bc2bac25864dddfa4b6 SHA512 cee48058367b5b8a705203865538d0ab4bda9d2f1d06d155360922cb095b5d6a5b0311fdda6c45d9f33227324394ca5fd3b5a399fc71e11ea4c609eab18a7b04
diff --git a/sys-auth/rtkit/files/rtkit-0.12_libsystemd_optional.patch b/sys-auth/rtkit/files/rtkit-0.12_libsystemd_optional.patch
new file mode 100644
index 000000000000..9d61f4e5685c
--- /dev/null
+++ b/sys-auth/rtkit/files/rtkit-0.12_libsystemd_optional.patch
@@ -0,0 +1,63 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -116,7 +116,15 @@
+ AC_SEARCH_LIBS([cap_init], [cap])
+
+ PKG_CHECK_MODULES(DBUS, dbus-1)
+-PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd)
++
++AC_ARG_ENABLE(systemd-integration,
++ AS_HELP_STRING([--enable-systemd-integration], [use the sd-daemon API to communicate with systemd]),
++ [enable_libsystemd=$enableval],
++ [enable_libsystemd=yes])
++if test "x${enable_libsystemd}" != "xno"; then
++ PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd)
++ AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define to 1 if you have libsystemd and its header files])
++fi
+
+ AC_ARG_WITH([systemdsystemunitdir],
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+@@ -142,5 +150,6 @@
+ localstatedir: ${localstatedir}
+ Compiler: ${CC}
+ CFLAGS: ${CFLAGS}
++ systemd integration: ${enable_libsystemd}
+ systemd unit directory: ${systemdsystemunitdir}
+ "
+--- a/rtkit-daemon.c
++++ b/rtkit-daemon.c
+@@ -50,7 +50,10 @@
+ #include <dirent.h>
+ #include <syslog.h>
+ #include <grp.h>
++
++#ifdef HAVE_LIBSYSTEMD
+ #include <systemd/sd-daemon.h>
++#endif
+
+ #include "rtkit.h"
+
+@@ -1432,11 +1435,13 @@
+ n_total_processes,
+ n_users);
+
++#ifdef HAVE_LIBSYSTEMD
+ sd_notifyf(0,
+ "STATUS=Supervising %u threads of %u processes of %u users.",
+ n_total_threads,
+ n_total_processes,
+ n_users);
++#endif
+
+ finish:
+ if (r) {
+@@ -2304,7 +2309,9 @@
+
+ syslog(LOG_DEBUG, "Running.\n");
+
++#ifdef HAVE_LIBSYSTEMD
+ sd_notify(0, "STATUS=Running.");
++#endif
+
+ dbus_connection_set_exit_on_disconnect(bus, FALSE);
+
diff --git a/sys-auth/rtkit/files/rtkit-0.12_noexecstack.patch b/sys-auth/rtkit/files/rtkit-0.12_noexecstack.patch
new file mode 100644
index 000000000000..f156422f8f62
--- /dev/null
+++ b/sys-auth/rtkit/files/rtkit-0.12_noexecstack.patch
@@ -0,0 +1,10 @@
+--- a/xml-introspection.S
++++ b/xml-introspection.S
+@@ -1,3 +1,7 @@
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
++
+ .section .rodata
+ .global introspect_xml
+ .type introspect_xml, @object
diff --git a/sys-auth/rtkit/rtkit-0.12.ebuild b/sys-auth/rtkit/rtkit-0.12.ebuild
new file mode 100644
index 000000000000..125517d132b3
--- /dev/null
+++ b/sys-auth/rtkit/rtkit-0.12.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools linux-info
+
+DESCRIPTION="Realtime Policy and Watchdog Daemon"
+HOMEPAGE="https://0pointer.de/blog/projects/rtkit"
+SRC_URI="https://github.com/heftig/${PN}/releases/download/v${PV}/${P}.tar.xz"
+
+LICENSE="GPL-3 BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="systemd"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND="acct-group/rtkit
+ acct-user/rtkit
+ sys-apps/dbus
+ sys-auth/polkit
+ sys-libs/libcap
+ systemd? ( sys-apps/systemd )"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.12_libsystemd_optional.patch
+ "${FILESDIR}"/${PN}-0.12_noexecstack.patch
+)
+
+pkg_pretend() {
+ if use kernel_linux; then
+ CONFIG_CHECK="~!RT_GROUP_SCHED"
+ ERROR_RT_GROUP_SCHED="CONFIG_RT_GROUP_SCHED is enabled. rtkit-daemon (or any other "
+ ERROR_RT_GROUP_SCHED+="real-time task) will not work unless run as root. Please consider "
+ ERROR_RT_GROUP_SCHED+="unsetting this option."
+ check_extra_config
+ fi
+}
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable systemd systemd-integration)
+}