From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C0882158086 for ; Mon, 20 Dec 2021 04:08:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8D96B2BC027; Mon, 20 Dec 2021 04:08:51 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6FCEB2BC01F for ; Mon, 20 Dec 2021 04:08:50 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 72D98343005 for ; Mon, 20 Dec 2021 04:08:48 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D3A1F261 for ; Mon, 20 Dec 2021 04:08:46 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1639973315.15e061e8643f68741540b6020777898f9df2d7cb.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/atop/, sys-process/atop/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-process/atop/Manifest sys-process/atop/atop-2.7.0.ebuild sys-process/atop/files/atop-2.7.0-netatop-makefile.patch sys-process/atop/files/atop.service-r1 sys-process/atop/files/netatop.rc sys-process/atop/metadata.xml X-VCS-Directories: sys-process/atop/files/ sys-process/atop/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 15e061e8643f68741540b6020777898f9df2d7cb X-VCS-Branch: master Date: Mon, 20 Dec 2021 04:08:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 2d4a05fc-5c5a-47fe-a5eb-da784d105de1 X-Archives-Hash: bc7338b920e5c320bc1a0a161059715d commit: 15e061e8643f68741540b6020777898f9df2d7cb Author: Sam James gentoo org> AuthorDate: Mon Dec 20 02:30:30 2021 +0000 Commit: Sam James gentoo org> CommitDate: Mon Dec 20 04:08:35 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15e061e8 sys-process/atop: add 2.7.0 Closes: https://bugs.gentoo.org/612248 Closes: https://bugs.gentoo.org/736406 Closes: https://bugs.gentoo.org/777903 Closes: https://bugs.gentoo.org/829356 Signed-off-by: Sam James gentoo.org> sys-process/atop/Manifest | 2 + sys-process/atop/atop-2.7.0.ebuild | 111 +++++++++++++++++++++ .../atop/files/atop-2.7.0-netatop-makefile.patch | 42 ++++++++ sys-process/atop/files/atop.service-r1 | 11 ++ sys-process/atop/files/netatop.rc | 17 ++++ sys-process/atop/metadata.xml | 11 +- 6 files changed, 190 insertions(+), 4 deletions(-) diff --git a/sys-process/atop/Manifest b/sys-process/atop/Manifest index 3dabab96bcbd..7b90e6f3cbd5 100644 --- a/sys-process/atop/Manifest +++ b/sys-process/atop/Manifest @@ -1 +1,3 @@ DIST atop-2.6.0.tar.gz 242323 BLAKE2B 8cf39c4b18994de26188ad5e19e282bc3ef7693eeff4853386f6b254d1115dbd2308eaa4c6e7620e6081d44037e6ce01356ad72ba25bcf4b1c3e7674768e5c24 SHA512 46cbc1c67ee6683be8dca79bf68d85962a119469ddce4947519cf4fe178b14d54b69451cfaa2b5c0a3f8c9bf8769de619aa5a7768eae34422688c7fc26fe0a58 +DIST atop-2.7.0.tar.gz 248294 BLAKE2B 94587d1ea07fcbbc8b267b96d0e7aa89b04cef9b39ccae0057bfb6163b15b8fdf3ddc9edb377bf40f48f60b4dd29feaf64201b1fd8c396dfb34c610772bc629c SHA512 2b3a1fbbd01728228df9ab1b6a99458fa0f962cc945b198a79298152ff115f6131fdb86fc806fc647a28d86e6e1a56375ca9d4dc530e082a122cf6ffba3dac7b +DIST netatop-3.1.tar.gz 22812 BLAKE2B 1b1faebf1392a57db6b4662192f90821289c8fc40c2c1ee0ad61feeeee6477c4d091744a1e82cdd987baf59f8dd71fc6d242d6dd294b8fb29b9447a9d5055996 SHA512 b12fd2287d89d3a8277f8fb540a19e6d26aa26c3f88e7ae2e6601b63f78d642e73b8d16cf351f6979ce7bbf53251b9c1faa76798a87f70cf3dcf51279eb0db68 diff --git a/sys-process/atop/atop-2.7.0.ebuild b/sys-process/atop/atop-2.7.0.ebuild new file mode 100644 index 000000000000..100ab24274da --- /dev/null +++ b/sys-process/atop/atop-2.7.0.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# Check on bumps of atop +# https://www.atoptool.nl/downloadnetatop.php +NETATOP_VER=3.1 + +# Controls 'netatop' kernel module +MODULES_OPTIONAL_USE="modules" +NETATOP_P=net${PN}-${NETATOP_VER} +NETATOP_S="${WORKDIR}"/${NETATOP_P} + +inherit linux-info linux-mod systemd toolchain-funcs + +DESCRIPTION="Resource-specific view of processes" +HOMEPAGE="https://www.atoptool.nl/ https://github.com/Atoptool/atop" +SRC_URI="https://github.com/Atoptool/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" +SRC_URI+=" modules? ( https://www.atoptool.nl/download/${NETATOP_P}.tar.gz )" + +# Module is GPL-2 as well +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux" + +RDEPEND="sys-libs/ncurses:0= + >=sys-process/acct-6.6.4-r1 + modules? ( sys-libs/zlib )" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/${PN}-2.6.0-build.patch +) + +pkg_pretend() { + if use kernel_linux ; then + CONFIG_CHECK="~BSD_PROCESS_ACCT" + check_extra_config + fi +} + +src_prepare() { + default + + ( + cd "${WORKDIR}"/${NETATOP_P} || die + eapply -p1 "${FILESDIR}"/${PN}-2.7.0-netatop-makefile.patch + ) + + tc-export CC PKG_CONFIG + + # bug #191926 + sed -i 's: root : :' atop.cronsysv || die + + # prefixify + sed -i "s:/\(usr\|etc\|var\):${EPREFIX}/\1:g" Makefile || die +} + +src_configure() { + default + + BUILD_TARGETS="netatop.ko" + MODULE_NAMES="netatop(:${NETATOP_S}/module)" +} + +src_compile() { + default + + linux-mod_src_compile +} + +src_install() { + linux-mod_src_install + + if use modules ; then + # netatop's Makefile tries to build the kernel module for us + # so let's just replicate parts of it here. + emake -C "${NETATOP_S}"/daemon all + + dosbin "${NETATOP_S}"/daemon/netatopd + doman "${NETATOP_S}"/man/* + + systemd_dounit "${NETATOP_S}"/netatop.service + + # TODO: openrc init script + #install -T -m 0755 netatop.init /etc/init.d/netatop + fi + + emake DESTDIR="${D}" genericinstall + + # useless -${PV} copies ? + rm "${ED}"/usr/bin/atop*-${PV} || die + + newinitd "${FILESDIR}"/${PN}.rc-r2 ${PN} + newinitd "${FILESDIR}"/atopacct.rc atopacct + + systemd_dounit "${FILESDIR}"/${PN}.service-r1 + systemd_dounit "${FILESDIR}"/atopacct.service + + dodoc atop.cronsysv AUTHOR README + + exeinto /usr/share/${PN} + doexe ${PN}.daily + + insinto /etc/default + newins ${PN}{.default,} + + keepdir /var/log/${PN} +} diff --git a/sys-process/atop/files/atop-2.7.0-netatop-makefile.patch b/sys-process/atop/files/atop-2.7.0-netatop-makefile.patch new file mode 100644 index 000000000000..bd2f17658cf8 --- /dev/null +++ b/sys-process/atop/files/atop-2.7.0-netatop-makefile.patch @@ -0,0 +1,42 @@ +--- a/daemon/Makefile ++++ b/daemon/Makefile +@@ -6,7 +6,7 @@ + all: netatopd + + netatopd: netatopd.o Makefile +- $(CC) netatopd.o -o netatopd -lz ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) netatopd.o -o netatopd -lz + + clean: + rm -f *.o netatopd +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,7 @@ + all: + ./mkversion +- cd module; make +- cd daemon; make ++ cd module; $(MAKE) ++ cd daemon; $(MAKE) + + install: module/netatop.ko daemon/netatopd + install -d /lib/modules/`uname -r`/extra +@@ -14,5 +14,5 @@ + install man/netatopd.8 -t /usr/share/man/man8 + + clean: +- cd module; make clean +- cd daemon; make clean ++ cd module; $(MAKE) clean ++ cd daemon; $(MAKE) clean +--- a/module/Makefile ++++ b/module/Makefile +@@ -7,7 +7,7 @@ + + $(MYMODULE).ko: $(MYMODULE).c + echo start the make +- make -C $(KERNDIR) M=$(THISDIR) modules ++ $(MAKE) -C $(KERNDIR) M=$(THISDIR) modules + + clean: + rm -f *.o *.ko diff --git a/sys-process/atop/files/atop.service-r1 b/sys-process/atop/files/atop.service-r1 new file mode 100644 index 000000000000..ba1575ba835e --- /dev/null +++ b/sys-process/atop/files/atop.service-r1 @@ -0,0 +1,11 @@ +[Unit] +Description=Atop advanced performance monitor +Documentation=man:atop(1) + +[Service] +Type=simple +ExecStart=/usr/share/atop/atop.daily +KillSignal=SIGUSR2 + +[Install] +WantedBy=multi-user.target diff --git a/sys-process/atop/files/netatop.rc b/sys-process/atop/files/netatop.rc new file mode 100644 index 000000000000..9f02fab4bcd3 --- /dev/null +++ b/sys-process/atop/files/netatop.rc @@ -0,0 +1,17 @@ +#!/sbin/openrc-run +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 +command="/usr/sbin/netatopd" +procname="netatopd" + +depend() { + before atop atopacct +} + +start_pre() { + modprobe netatop > /dev/null 2>&1 +} + +stop_post() { + rmmod netatop > /dev/null 2>&1 +} diff --git a/sys-process/atop/metadata.xml b/sys-process/atop/metadata.xml index 73dda144f9ac..cbd6bd78916c 100644 --- a/sys-process/atop/metadata.xml +++ b/sys-process/atop/metadata.xml @@ -1,8 +1,11 @@ - - base-system@gentoo.org - Gentoo Base System - + + base-system@gentoo.org + Gentoo Base System + + + Build netatop kernel module and install netatopd daemon. +