Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libcgroup/
Date: Sat, 18 Sep 2021 22:25:25
Message-Id: 1632003898.618f335d5f4cfcc2168e283c6a3c9ea9978dd8aa.blueness@gentoo
1 commit: 618f335d5f4cfcc2168e283c6a3c9ea9978dd8aa
2 Author: Dmitry Baranov <reagentoo <AT> gmail <DOT> com>
3 AuthorDate: Thu Sep 16 12:14:32 2021 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 18 22:24:58 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=618f335d
7
8 dev-libs/libcgroup: add 2.0
9
10 Closes: https://bugs.gentoo.org/813375
11 Signed-off-by: Dmitry Baranov <reagentoo <AT> gmail.com>
12 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
13
14 dev-libs/libcgroup/Manifest | 1 +
15 dev-libs/libcgroup/libcgroup-2.0.ebuild | 98 +++++++++++++++++++++++++++++++++
16 2 files changed, 99 insertions(+)
17
18 diff --git a/dev-libs/libcgroup/Manifest b/dev-libs/libcgroup/Manifest
19 index 368f0cd8bec..b9417a00e1e 100644
20 --- a/dev-libs/libcgroup/Manifest
21 +++ b/dev-libs/libcgroup/Manifest
22 @@ -1 +1,2 @@
23 DIST libcgroup-0.41.tar.bz2 500120 BLAKE2B 3410b430aa58613b5b9abedba05bef99b1b8a1fd619d55fb446ab951e052a336efc918879217055bceee886a03d97c3ff46028a87e8231212653a886cfb80521 SHA512 1aedb02cd2ce3bc2e2a328a247a92976ad0978ca4d3aee4eb671fbcc6bb270348efc78dcf84f27fc500f8bfb9bb57c7d6e4d429ef2bc69e4e5118b7cd895a6bd
24 +DIST libcgroup-2.0.tar.bz2 953191 BLAKE2B d4fe008a51a4f90047210a3c8e4ce48b1c4a126111ccc7fe919404b1782ea764404894a43a651e0d6b2674d02fb031cb56cf7a689c57600d856c03536524bb63 SHA512 b2c5d1128536bf49782415df2d1530cf48bdb287e5d2abdee68f9fa780d995d9bae79f97da5f0c437130d66054c96301b319cd1631a3b0efbc5bfe1e3414dc4b
25
26 diff --git a/dev-libs/libcgroup/libcgroup-2.0.ebuild b/dev-libs/libcgroup/libcgroup-2.0.ebuild
27 new file mode 100644
28 index 00000000000..674b3f6e390
29 --- /dev/null
30 +++ b/dev-libs/libcgroup/libcgroup-2.0.ebuild
31 @@ -0,0 +1,98 @@
32 +# Copyright 1999-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +inherit autotools flag-o-matic linux-info pam systemd
38 +
39 +DESCRIPTION="Tools and libraries to configure and manage kernel control groups"
40 +HOMEPAGE="https://github.com/libcgroup/libcgroup"
41 +SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.bz2"
42 +
43 +LICENSE="LGPL-2.1"
44 +SLOT="0"
45 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
46 +IUSE="+daemon elibc_musl pam static-libs test +tools"
47 +REQUIRED_USE="daemon? ( tools )"
48 +
49 +# Use mount cgroup to build directory
50 +# sandbox restricted to trivial build,
51 +RESTRICT="test"
52 +
53 +BDEPEND="
54 + sys-devel/bison
55 + sys-devel/flex
56 + elibc_musl? ( sys-libs/fts-standalone )
57 +"
58 +DEPEND="pam? ( sys-libs/pam )"
59 +RDEPEND="${DEPEND}"
60 +
61 +pkg_setup() {
62 + local CONFIG_CHECK="~CGROUPS"
63 + if use daemon; then
64 + CONFIG_CHECK="${CONFIG_CHECK} ~CONNECTOR ~PROC_EVENTS"
65 + fi
66 + linux-info_pkg_setup
67 +}
68 +
69 +src_prepare() {
70 + default
71 +
72 + # Change rules file location
73 + find src -name *.c -o -name *.h \
74 + | xargs sed -i '/^#define/s:/etc/cg:/etc/cgroup/cg:'
75 + sed -i 's:/etc/cg:/etc/cgroup/cg:' \
76 + doc/man/cg* samples/*.conf README* || die "sed failed"
77 +
78 + # Drop native libcgconfig init config
79 + sed -i '/^man_MANS/s:cgred.conf.5::' \
80 + doc/man/Makefile.am || die "sed failed"
81 +
82 + # If we're not running tests, don't bother building them.
83 + if ! use test; then
84 + sed -i '/^SUBDIRS/s:tests::' Makefile.am || die
85 + fi
86 +
87 + eautoreconf
88 +}
89 +
90 +src_configure() {
91 + local my_conf
92 +
93 + if use pam; then
94 + my_conf=" --enable-pam-module-dir=$(getpam_mod_dir) "
95 + fi
96 +
97 + use elibc_musl && append-ldflags "-lfts"
98 + econf \
99 + $(use_enable static-libs static) \
100 + $(use_enable daemon) \
101 + $(use_enable pam) \
102 + $(use_enable tools) \
103 + ${my_conf}
104 +}
105 +
106 +src_install() {
107 + default
108 + find "${D}" -name '*.la' -delete || die
109 +
110 + insinto /etc/cgroup
111 + doins samples/cgconfig.conf
112 + doins samples/cgrules.conf
113 + doins samples/cgsnapshot_blacklist.conf
114 +
115 + keepdir /etc/cgroup/cgconfig.d
116 + keepdir /etc/cgroup/cgrules.d
117 +
118 + if use tools; then
119 + newconfd "${FILESDIR}"/cgconfig.confd-r1 cgconfig
120 + newinitd "${FILESDIR}"/cgconfig.initd-r1 cgconfig
121 + systemd_dounit "${FILESDIR}"/cgconfig.service
122 + systemd_dounit "${FILESDIR}"/cgrules.service
123 + fi
124 +
125 + if use daemon; then
126 + newconfd "${FILESDIR}"/cgred.confd-r2 cgred
127 + newinitd "${FILESDIR}"/cgred.initd-r1 cgred
128 + fi
129 +}