[gentoo-commits] repo/gentoo:master commit in: dev-libs/libcgroup/files/, dev-libs/libcgroup/
commit: 39c69db21c0c4d66fb2685b369b33b5ed3397ff2 Author: Paul Zander gmail com> AuthorDate: Wed Sep 6 15:02:49 2023 + Commit: Sam James gentoo org> CommitDate: Sun Sep 24 22:09:56 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39c69db2 dev-libs/libcgroup: bump 3.1.0, fix CG_CLASSIFY=Yes Fixes SRC_URI. Make CG_CLASSIFY=Yes work by adjusting executable path and add parsing of /etc/cgroup/cgconfig.d. Closes: https://bugs.gentoo.org/628802 Signed-off-by: Paul Zander gmail.com> Closes: https://github.com/gentoo/gentoo/pull/32656 Signed-off-by: Sam James gentoo.org> dev-libs/libcgroup/Manifest | 1 + dev-libs/libcgroup/files/cgconfig.confd-r2 | 8 ++ dev-libs/libcgroup/files/cgconfig.initd-r2 | 53 dev-libs/libcgroup/libcgroup-3.0.0-r1.ebuild | 115 +++ dev-libs/libcgroup/libcgroup-3.1.0.ebuild| 115 +++ 5 files changed, 292 insertions(+) diff --git a/dev-libs/libcgroup/Manifest b/dev-libs/libcgroup/Manifest index fc793519300c..169245e7cdd3 100644 --- a/dev-libs/libcgroup/Manifest +++ b/dev-libs/libcgroup/Manifest @@ -1,3 +1,4 @@ DIST libcgroup-0.41.tar.bz2 500120 BLAKE2B 3410b430aa58613b5b9abedba05bef99b1b8a1fd619d55fb446ab951e052a336efc918879217055bceee886a03d97c3ff46028a87e8231212653a886cfb80521 SHA512 1aedb02cd2ce3bc2e2a328a247a92976ad0978ca4d3aee4eb671fbcc6bb270348efc78dcf84f27fc500f8bfb9bb57c7d6e4d429ef2bc69e4e5118b7cd895a6bd DIST libcgroup-2.0.tar.bz2 953191 BLAKE2B d4fe008a51a4f90047210a3c8e4ce48b1c4a126111ccc7fe919404b1782ea764404894a43a651e0d6b2674d02fb031cb56cf7a689c57600d856c03536524bb63 SHA512 b2c5d1128536bf49782415df2d1530cf48bdb287e5d2abdee68f9fa780d995d9bae79f97da5f0c437130d66054c96301b319cd1631a3b0efbc5bfe1e3414dc4b DIST libcgroup-3.0.0.tar.gz 1125800 BLAKE2B 5d4999ac513de756ffe741d2e959c01d8500a2000f521dff31832e1ef545869fb9c8ae1c78d05aaa051e7e6e68266bd57a751ba3aa897966a83ff50128090ba5 SHA512 1e8a7c9a71d928ab0e354254b007b30fc159a30e441bd52a03ded142420c94e130594bb512680c62fc22f5193934fb78afc31453342b032d1db3197fd4c3e606 +DIST libcgroup-3.1.0.tar.gz 1223547 BLAKE2B 3cd3ca779b4453df71aba584ad8fe654fb55478ad89b36ba5deccf46e3ef331b11dc32a9a72dfa525784558701a72fd0777e05275233e599015ae93269661534 SHA512 84272e811422f2105e275ccadbd333fe6da495da5504cd97acd3101718e27b52e0f56b62f847933b32d613e15c170d1b998d85a89c1591e8ce37c33043f3e00b diff --git a/dev-libs/libcgroup/files/cgconfig.confd-r2 b/dev-libs/libcgroup/files/cgconfig.confd-r2 new file mode 100644 index ..2770c85e2ee1 --- /dev/null +++ b/dev-libs/libcgroup/files/cgconfig.confd-r2 @@ -0,0 +1,8 @@ +# /etc/conf.d/cgconfig: config file for /etc/init.d/cgconfig + +# Configuration file location +CG_CONFIGFILE="/etc/cgroup/cgconfig.conf" +CG_CONFIGDIR="/etc/cgroup/cgconfig.d" + +# Enable calssifying pid according to rules if necessary +CG_CLASSIFY=No diff --git a/dev-libs/libcgroup/files/cgconfig.initd-r2 b/dev-libs/libcgroup/files/cgconfig.initd-r2 new file mode 100644 index ..aaf3ea88031b --- /dev/null +++ b/dev-libs/libcgroup/files/cgconfig.initd-r2 @@ -0,0 +1,53 @@ +#!/sbin/openrc-run +# Copyright 1999-2023 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +CGCONFIGPARSER="/usr/sbin/cgconfigparser" +CGCLASSIFY="/usr/bin/cgclassify" +: "${CG_CONFIGFILE:=/etc/cgroup/cgconfig.conf}" +: "${CG_CONFIGDIR:=/etc/cgroup/cgconfig.d}" +description="Control Group Configuration Service" + +start() +{ + ebegin "Setting up CGroups" + "${CGCONFIGPARSER}" "--load=${CG_CONFIGFILE}" "--load-directory=${CG_CONFIGDIR}" >/dev/null 2>&1 + eend "$?" +} + +start_post() +{ + # Classify PID according to the rules if requested + yesno "${CG_CLASSIFY}" || return 0 + ebegin "Classifying PID to CGroups" + local pid + for pid in $(pgrep ''); do +${CGCLASSIFY} ${pid} || einfo "Classifying ${pid} failed" + done + eend "$?" +} + +stop() +{ + cgconfig_umount +} + +cgconfig_umount() +{ + local ctrl eq mnt_pnt mnt_pts + + while read ctrl eq mnt_pnt; do + case "${ctrl}" in + (\#*)continue;; + (mount*) mnt_pts=true;; + (\}*)mnt_pts=;; + (*) + [ -n "${mnt_pts}" ] || continue + mnt_pnt="${mnt_pnt%;}" + ebegin "Unmounting ${mnt_pnt}" + umount "${mnt_pnt}" + eend "$?" + ;; + esac + done < "${CG_CONFIGFILE}" +} diff --git a/dev-libs/libcgroup/libcgroup-3.0.0-r1.ebuild b/dev-libs/libcgroup/libcgroup-3.0.0-r1.ebuild new file mode 100644 index ..9fdbb7a5bde3 --- /dev/null +++ b/dev-libs/libcgroup/libcgroup-3.0.0-r1.ebuild @@ -0,0 +1,115 @@ +# Copyright 19
[gentoo-commits] repo/gentoo:master commit in: dev-libs/libcgroup/files/, dev-libs/libcgroup/
commit: 70e3169fa8441f6c76d9329edee258e6d5c44ee3 Author: Sam James gentoo org> AuthorDate: Sat Sep 10 12:47:49 2022 + Commit: Sam James gentoo org> CommitDate: Sat Sep 10 13:29:53 2022 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=70e3169f dev-libs/libcgroup: add 3.0.0 Closes: https://bugs.gentoo.org/830071 Signed-off-by: Sam James gentoo.org> dev-libs/libcgroup/Manifest| 1 + .../files/libcgroup-3.0.0-configure-bashism.patch | 35 +++ .../files/libcgroup-3.0.0-musl-strerror_r.patch| 45 dev-libs/libcgroup/libcgroup-3.0.0.ebuild | 113 + 4 files changed, 194 insertions(+) diff --git a/dev-libs/libcgroup/Manifest b/dev-libs/libcgroup/Manifest index b9417a00e1e3..fc793519300c 100644 --- a/dev-libs/libcgroup/Manifest +++ b/dev-libs/libcgroup/Manifest @@ -1,2 +1,3 @@ DIST libcgroup-0.41.tar.bz2 500120 BLAKE2B 3410b430aa58613b5b9abedba05bef99b1b8a1fd619d55fb446ab951e052a336efc918879217055bceee886a03d97c3ff46028a87e8231212653a886cfb80521 SHA512 1aedb02cd2ce3bc2e2a328a247a92976ad0978ca4d3aee4eb671fbcc6bb270348efc78dcf84f27fc500f8bfb9bb57c7d6e4d429ef2bc69e4e5118b7cd895a6bd DIST libcgroup-2.0.tar.bz2 953191 BLAKE2B d4fe008a51a4f90047210a3c8e4ce48b1c4a126111ccc7fe919404b1782ea764404894a43a651e0d6b2674d02fb031cb56cf7a689c57600d856c03536524bb63 SHA512 b2c5d1128536bf49782415df2d1530cf48bdb287e5d2abdee68f9fa780d995d9bae79f97da5f0c437130d66054c96301b319cd1631a3b0efbc5bfe1e3414dc4b +DIST libcgroup-3.0.0.tar.gz 1125800 BLAKE2B 5d4999ac513de756ffe741d2e959c01d8500a2000f521dff31832e1ef545869fb9c8ae1c78d05aaa051e7e6e68266bd57a751ba3aa897966a83ff50128090ba5 SHA512 1e8a7c9a71d928ab0e354254b007b30fc159a30e441bd52a03ded142420c94e130594bb512680c62fc22f5193934fb78afc31453342b032d1db3197fd4c3e606 diff --git a/dev-libs/libcgroup/files/libcgroup-3.0.0-configure-bashism.patch b/dev-libs/libcgroup/files/libcgroup-3.0.0-configure-bashism.patch new file mode 100644 index ..1401953b53a7 --- /dev/null +++ b/dev-libs/libcgroup/files/libcgroup-3.0.0-configure-bashism.patch @@ -0,0 +1,35 @@ +https://github.com/libcgroup/libcgroup/pull/243 + +From a363c163fdeb48e0536545ece856899ed97e99b2 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Sat, 10 Sep 2022 13:52:57 +0100 +Subject: [PATCH] configure.ac: fix bashism + +configure scripts need to be runnable with a POSIX-compliant /bin/sh. + +On many (but not all!) systems, /bin/sh is provided by Bash, so errors +like this aren't spotted. Notably Debian defaults to /bin/sh provided +by dash which doesn't tolerate such bashisms as '=='. + +This retains compatibility with bash. + +Fixes configure warnings/errors like: +``` +checking whether to build static libraries... no +./configure: 14089: test: xno: unexpected operator +checking for x86_64-pc-linux-gnu-g++... x86_64-pc-linux-gnu-g++ +``` + +Signed-off-by: Sam James +--- a/configure.ac b/configure.ac +@@ -137,7 +137,7 @@ AC_ARG_ENABLE([opaque-hierarchy], + AC_ARG_ENABLE([tests], + [AS_HELP_STRING([--enable-tests],[compile libcgroup tests [default=yes]])], + [ +- if test "x$enableval" == xno; then ++ if test "x$enableval" = xno; then + with_tests=false + else + with_tests=true + diff --git a/dev-libs/libcgroup/files/libcgroup-3.0.0-musl-strerror_r.patch b/dev-libs/libcgroup/files/libcgroup-3.0.0-musl-strerror_r.patch new file mode 100644 index ..cc1b0688c79b --- /dev/null +++ b/dev-libs/libcgroup/files/libcgroup-3.0.0-musl-strerror_r.patch @@ -0,0 +1,45 @@ +https://github.com/libcgroup/libcgroup/pull/236 + +From d190c0c548b3219b75e4c399aa89186e77bbe270 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 23 Aug 2022 20:03:09 -0700 +Subject: [PATCH] api: Use GNU strerror_r when available + +GNU strerror_r is only available in glibc, musl impelents the XSI +version which is slightly different, therefore check if GNU version is +available before using it, otherwise use the XSI compliant version. + +Signed-off-by: Khem Raj +--- a/configure.ac b/configure.ac +@@ -183,6 +183,11 @@ AC_FUNC_REALLOC + AC_FUNC_STAT + AC_CHECK_FUNCS([getmntent hasmntopt memset mkdir rmdir strdup]) + ++orig_CFLAGS="$CFLAGS" ++CFLAGS="$CFLAGS -D_GNU_SOURCE" ++AC_FUNC_STRERROR_R ++CFLAGS="$orig_CFLAGS" ++ + AC_SEARCH_LIBS( + [fts_open], + [fts], +--- a/src/api.c b/src/api.c +@@ -4571,9 +4571,13 @@ const char *cgroup_strerror(int code) + { + int idx = code % ECGROUPNOTCOMPILED; + +- if (code == ECGOTHER) ++ if (code == ECGOTHER) { ++#ifdef STRERROR_R_CHAR_P + return strerror_r(cgroup_get_last_errno(), errtext, MAXLEN); +- ++#else ++ return strerror_r(cgroup_get_last_errno(), errtext, sizeof (errtext)) ? "unknown error" : errtext; ++#endif ++ } + if (idx >= sizeof(cgroup_strerror_codes)/sizeof(cgroup_strerror_codes[0])) + retu
[gentoo-commits] repo/gentoo:master commit in: dev-libs/libcgroup/files/, dev-libs/libcgroup/
commit: 0bf2ad14f82df0cfe05eda3cf3cb1c157095a025 Author: Sam James gentoo org> AuthorDate: Wed Mar 24 19:51:26 2021 + Commit: Sam James gentoo org> CommitDate: Wed Mar 24 19:51:26 2021 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0bf2ad14 dev-libs/libcgroup: fix build with slibtool Thanks-to: orbea riseup.net> Closes: https://bugs.gentoo.org/777450 Signed-off-by: Sam James gentoo.org> .../libcgroup/files/libcgroup-0.41-slibtool.patch | 59 ++ dev-libs/libcgroup/libcgroup-0.41-r6.ebuild| 3 +- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/dev-libs/libcgroup/files/libcgroup-0.41-slibtool.patch b/dev-libs/libcgroup/files/libcgroup-0.41-slibtool.patch new file mode 100644 index 000..114209116bf --- /dev/null +++ b/dev-libs/libcgroup/files/libcgroup-0.41-slibtool.patch @@ -0,0 +1,59 @@ +https://bugs.gentoo.org/777450 + +commit 0c710d2f82184984e73b643a8e752f55371c6bc8 +Author: orbea +Date: Sun Mar 21 13:24:23 2021 -0700 + +build: Remove .libs from Makefile.am files. + +Signed-off-by: orbea + +diff --git a/src/bindings/Makefile.am b/src/bindings/Makefile.am +index 8bb7334..c59641b 100644 +--- a/src/bindings/Makefile.am b/src/bindings/Makefile.am +@@ -5,7 +5,7 @@ lib_LTLIBRARIES = _libcgroup.la + _libcgroup_la_SOURCES = libcgroup.c + _libcgroup_la_LDFLAGS = $(shell python-config --ldflags) -module -avoid-version + _libcgroup_la_CFLAGS = $(shell python-config --cflags) +-_libcgroup_la_LIBADD = $(top_builddir)/src/.libs/libcgroup.la ++_libcgroup_la_LIBADD = $(top_builddir)/src/libcgroup.la + SWIG=swig + + +diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am +index 2e08a4d..c8dbe67 100644 +--- a/src/daemon/Makefile.am b/src/daemon/Makefile.am +@@ -4,7 +4,7 @@ if WITH_DAEMON + + sbin_PROGRAMS = cgrulesengd + cgrulesengd_SOURCES = cgrulesengd.c cgrulesengd.h +-cgrulesengd_LDADD = $(top_builddir)/src/.libs/libcgroup.la -lrt ++cgrulesengd_LDADD = $(top_builddir)/src/libcgroup.la -lrt + cgrulesengd_LDFLAGS = -L$(top_builddir)/src/.libs + + endif +diff --git a/src/pam/Makefile.am b/src/pam/Makefile.am +index 852ceae..df173c2 100644 +--- a/src/pam/Makefile.am b/src/pam/Makefile.am +@@ -5,6 +5,6 @@ if WITH_PAM + pamlib_LTLIBRARIES = pam_cgroup.la + pam_cgroup_la_SOURCES = pam_cgroup.c + pam_cgroup_la_LDFLAGS = -module +-pam_cgroup_la_LIBADD = $(top_builddir)/src/.libs/libcgroup.la -lpam ++pam_cgroup_la_LIBADD = $(top_builddir)/src/libcgroup.la -lpam + + endif +diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am +index 0280d4a..cb0b8f3 100644 +--- a/src/tools/Makefile.am b/src/tools/Makefile.am +@@ -1,5 +1,5 @@ + AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include +-LDADD = $(top_builddir)/src/.libs/libcgroup.la ++LDADD = $(top_builddir)/src/libcgroup.la + + if WITH_TOOLS + diff --git a/dev-libs/libcgroup/libcgroup-0.41-r6.ebuild b/dev-libs/libcgroup/libcgroup-0.41-r6.ebuild index 5aaf74bec12..58ba8aad708 100644 --- a/dev-libs/libcgroup/libcgroup-0.41-r6.ebuild +++ b/dev-libs/libcgroup/libcgroup-0.41-r6.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -47,6 +47,7 @@ PATCHES=( "${FILESDIR}"/${P}-replace_INLCUDES.patch "${FILESDIR}"/${P}-reorder-headers.patch "${FILESDIR}"/${P}-remove-umask.patch + "${FILESDIR}"/${P}-slibtool.patch ) src_prepare() {