Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/atop/
Date: Sat, 31 Dec 2022 23:28:55
Message-Id: 1672529290.b5e42961096af7a5653c276b03dfc55fb48edff2.sam@gentoo
1 commit: b5e42961096af7a5653c276b03dfc55fb48edff2
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 31 23:28:10 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 31 23:28:10 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b5e42961
7
8 sys-process/atop: add 2.8.0
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 sys-process/atop/Manifest | 1 +
13 sys-process/atop/atop-2.8.0.ebuild | 112 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 113 insertions(+)
15
16 diff --git a/sys-process/atop/Manifest b/sys-process/atop/Manifest
17 index 9c23aa0cbdee..5a5e225adfce 100644
18 --- a/sys-process/atop/Manifest
19 +++ b/sys-process/atop/Manifest
20 @@ -1,2 +1,3 @@
21 DIST atop-2.7.1.tar.gz 248809 BLAKE2B 2cf1a68a7b24d76340295d9bde03a5602e9049a860468217771c696fe4b9062f2155aeefa2e3e810984780f82de6bf922bf7d6b02c7fd19194162dc70b015b81 SHA512 18f30c67d6f86b9270599317eed846c63d19e8ba6ea85bad8ec3d5ffb0489f17c75c8d8b3a14054bd14e89ed40d39e5d37bce834c7422087e6d8b86c99273a72
22 +DIST atop-2.8.0.tar.gz 263650 BLAKE2B 88ec63d482d34866d82d16f1c60a4a04bc749014f22f991ec9e6233a5d63a12b5a9c637544e27e346f751466c636d3b365bce5fc65f62e7bf9224faa9be047e9 SHA512 f601bdabc33f581e85b9b753537bddbeb4dd2a2cd9eec8716d856c7766e489b419eaf15c1b2fd2c1a2a64628d459e113739b939fc06f5d33828b22a9550c76fa
23 DIST netatop-3.1.tar.gz 22812 BLAKE2B 1b1faebf1392a57db6b4662192f90821289c8fc40c2c1ee0ad61feeeee6477c4d091744a1e82cdd987baf59f8dd71fc6d242d6dd294b8fb29b9447a9d5055996 SHA512 b12fd2287d89d3a8277f8fb540a19e6d26aa26c3f88e7ae2e6601b63f78d642e73b8d16cf351f6979ce7bbf53251b9c1faa76798a87f70cf3dcf51279eb0db68
24
25 diff --git a/sys-process/atop/atop-2.8.0.ebuild b/sys-process/atop/atop-2.8.0.ebuild
26 new file mode 100644
27 index 000000000000..960cbc056e3f
28 --- /dev/null
29 +++ b/sys-process/atop/atop-2.8.0.ebuild
30 @@ -0,0 +1,112 @@
31 +# Copyright 1999-2022 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=8
35 +
36 +# Check on bumps of atop
37 +# https://www.atoptool.nl/downloadnetatop.php
38 +NETATOP_VER=3.1
39 +
40 +# Controls 'netatop' kernel module
41 +MODULES_OPTIONAL_USE="modules"
42 +NETATOP_P=net${PN}-${NETATOP_VER}
43 +NETATOP_S="${WORKDIR}"/${NETATOP_P}
44 +
45 +inherit linux-info linux-mod systemd toolchain-funcs
46 +
47 +DESCRIPTION="Resource-specific view of processes"
48 +HOMEPAGE="https://www.atoptool.nl/ https://github.com/Atoptool/atop"
49 +SRC_URI="https://github.com/Atoptool/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
50 +SRC_URI+=" modules? ( https://www.atoptool.nl/download/${NETATOP_P}.tar.gz )"
51 +
52 +# Module is GPL-2 as well
53 +LICENSE="GPL-2"
54 +SLOT="0"
55 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux"
56 +
57 +RDEPEND="sys-libs/ncurses:0=
58 + >=sys-process/acct-6.6.4-r1
59 + modules? ( sys-libs/zlib )"
60 +DEPEND="${RDEPEND}"
61 +BDEPEND="virtual/pkgconfig"
62 +
63 +PATCHES=(
64 + "${FILESDIR}"/${PN}-2.6.0-build.patch
65 +)
66 +
67 +pkg_pretend() {
68 + if use kernel_linux ; then
69 + CONFIG_CHECK="~BSD_PROCESS_ACCT"
70 + check_extra_config
71 + fi
72 +}
73 +
74 +src_prepare() {
75 + default
76 +
77 + if use modules ; then
78 + cd "${WORKDIR}"/${NETATOP_P} || die
79 + eapply -p1 "${FILESDIR}"/${PN}-2.7.0-netatop-makefile.patch
80 + cd "${S}" || die
81 + fi
82 +
83 + tc-export CC PKG_CONFIG
84 +
85 + # bug #191926
86 + sed -i 's: root : :' atop.cronsysv || die
87 +
88 + # prefixify
89 + sed -i "s:/\(usr\|etc\|var\):${EPREFIX}/\1:g" Makefile || die
90 +}
91 +
92 +src_configure() {
93 + default
94 +
95 + BUILD_TARGETS="netatop.ko"
96 + MODULE_NAMES="netatop(:${NETATOP_S}/module)"
97 +}
98 +
99 +src_compile() {
100 + default
101 +
102 + linux-mod_src_compile
103 +}
104 +
105 +src_install() {
106 + linux-mod_src_install
107 +
108 + if use modules ; then
109 + # netatop's Makefile tries to build the kernel module for us
110 + # so let's just replicate parts of it here.
111 + emake -C "${NETATOP_S}"/daemon all
112 +
113 + dosbin "${NETATOP_S}"/daemon/netatopd
114 + doman "${NETATOP_S}"/man/*
115 +
116 + systemd_dounit "${NETATOP_S}"/netatop.service
117 +
118 + # TODO: Release after 2.8.0 may contain this, check!
119 + newinitd "${FILESDIR}"/netatop.rc netatop
120 + fi
121 +
122 + emake DESTDIR="${D}" genericinstall
123 +
124 + # useless -${PV} copies ?
125 + rm "${ED}"/usr/bin/atop*-${PV} || die
126 +
127 + newinitd atop.rc.openrc ${PN}
128 + newinitd atopacct.rc.openrc atopacct
129 +
130 + systemd_dounit "${S}"/${PN}.service
131 + systemd_dounit "${S}"/atopacct.service
132 +
133 + dodoc atop.cronsysv AUTHORS README
134 +
135 + exeinto /usr/share/${PN}
136 + doexe ${PN}.daily
137 +
138 + insinto /etc/default
139 + newins ${PN}{.default,}
140 +
141 + keepdir /var/log/${PN}
142 +}