public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/earlyoom/
Date: Fri, 26 Aug 2022 12:31:33 +0000 (UTC)	[thread overview]
Message-ID: <1661516767.c3d149d6d75b441bf8f3292f3e5bbf97ea81c6d3.sam@gentoo> (raw)

commit:     c3d149d6d75b441bf8f3292f3e5bbf97ea81c6d3
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 26 12:21:30 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 26 12:26:07 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3d149d6

sys-apps/earlyoom: add 1.7

- Remove inappropriate USE=systemd (violates small file policy) and fix
  unit dir.
- Rename USE=docs (should've been USE=doc anyway) to USE=man to be more
  accurate
- Simplify ebuild
- Use Bash tests per QA policy
- Fix tests

Closes: https://bugs.gentoo.org/843785
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-apps/earlyoom/Manifest             |  2 ++
 sys-apps/earlyoom/earlyoom-1.7.ebuild  | 61 ++++++++++++++++++++++++++++++++++
 sys-apps/earlyoom/earlyoom-9999.ebuild | 50 ++++++++++++++++++----------
 3 files changed, 95 insertions(+), 18 deletions(-)

diff --git a/sys-apps/earlyoom/Manifest b/sys-apps/earlyoom/Manifest
index 4afcde075831..c56a9dcc2fd8 100644
--- a/sys-apps/earlyoom/Manifest
+++ b/sys-apps/earlyoom/Manifest
@@ -1,2 +1,4 @@
 DIST earlyoom-1.3.tar.gz 31399 BLAKE2B 3867540afb23493fbb532bcb72a5cfacca4ed297a053ff5e2c7e394bfa3640887e3e7c6430789bc1eda4b7a68680d8a74ab56b641fe9e5d4caa4406e2edb0667 SHA512 c5de742289e82c2098bd88c61dcb3e20eb022905a015b4894c95a4de3978ce18d794a9e7c17c97851ca9f8888728908f7bf978c014b3b69799bffa8b546d258a
 DIST earlyoom-1.6.2.tar.gz 49006 BLAKE2B 85a02d4171ba1bb94d5ddf573b8f5ac58d28a0cf9766f4fb2c96be5b45eee7aab853008c36f9e3aac76685b70008051faa2fe339797ecf9137469f089935a6b3 SHA512 d622a5347591d2017f6e62255940482af431e647acf1b35ab035e0dbfd44da7fc52633e6dd6433e42a1348fd294d766550ba092260f3ec59bd51e545f08e466b
+DIST earlyoom-1.7-deps.tar.xz 1974036 BLAKE2B ff378ae64b6b293e3b9d9fa05607209a515edadd18edcb70e204de1e0808b06dfaca7e6dcddeffbda9dae8abbadf7ac6074df725997b96be8a8d8cc35ac4d8c8 SHA512 67072000f8695935f77494faca84c74c67de4b9a4b3b889b310ad674f28c7ed85a0d59e91f4d5caa06cc1d7c1e7ef31aa3a373851361b905dc29e6d4d04eeeb9
+DIST earlyoom-1.7.tar.gz 52210 BLAKE2B c8338434160e4ccaa5ee64299487ca47a3d94e894362c320cf8210caf895a34c7abb584654afcdcb6fc1e058d53c1fa7eb740477acb104ed295700faccbcbdc1 SHA512 5732632c38d9b511aaa81845b3d8f8afe737aa6498dca7e31accaf18bfcf271ba436946aa06a514a34c953f99343f9b197d8a2b8751e16d336aeb084944f3602

diff --git a/sys-apps/earlyoom/earlyoom-1.7.ebuild b/sys-apps/earlyoom/earlyoom-1.7.ebuild
new file mode 100644
index 000000000000..42e4a6373240
--- /dev/null
+++ b/sys-apps/earlyoom/earlyoom-1.7.ebuild
@@ -0,0 +1,61 @@
+# Copyright 2020-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+GO_OPTIONAL=1
+inherit go-module systemd toolchain-funcs
+
+DESCRIPTION="Early OOM Daemon for Linux"
+HOMEPAGE="https://github.com/rfjakob/earlyoom"
+
+if [[ ${PV} == 9999 ]] ; then
+	EGIT_REPO_URI="https://github.com/rfjakob/earlyoom.git"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/rfjakob/earlyoom/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	SRC_URI+=" test? ( https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-deps.tar.xz )"
+
+	KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="MIT-with-advertising"
+SLOT="0"
+IUSE="man test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+	man? ( virtual/pandoc )
+	test? ( dev-lang/go )
+"
+
+src_unpack() {
+	default
+
+	use test && go-module_src_unpack
+}
+
+src_compile() {
+	tc-export CC
+
+	emake \
+		PREFIX="${EPREFIX}"/usr \
+		VERSION="v${PV}" \
+		SYSTEMDUNITDIR="$(systemd_get_systemunitdir)" \
+		earlyoom earlyoom.service $(usev man 'earlyoom.1')
+}
+
+src_install() {
+	dobin earlyoom
+
+	use man && doman earlyoom.1
+
+	insinto /etc/default
+	newins earlyoom.default earlyoom
+
+	dodir /etc/conf.d
+	dosym -r /etc/default/earlyoom /etc/conf.d/earlyoom
+
+	newinitd "${FILESDIR}"/${PN}-r1 ${PN}
+	systemd_dounit earlyoom.service
+}

diff --git a/sys-apps/earlyoom/earlyoom-9999.ebuild b/sys-apps/earlyoom/earlyoom-9999.ebuild
index 6a2d2be6cf4e..42e4a6373240 100644
--- a/sys-apps/earlyoom/earlyoom-9999.ebuild
+++ b/sys-apps/earlyoom/earlyoom-9999.ebuild
@@ -1,47 +1,61 @@
-# Copyright 2020-2021 Gentoo Authors
+# Copyright 2020-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-inherit systemd
+GO_OPTIONAL=1
+inherit go-module systemd toolchain-funcs
 
 DESCRIPTION="Early OOM Daemon for Linux"
 HOMEPAGE="https://github.com/rfjakob/earlyoom"
 
-LICENSE="MIT-with-advertising"
-SLOT="0"
-if [ "${PV}" = "9999" ]; then
+if [[ ${PV} == 9999 ]] ; then
 	EGIT_REPO_URI="https://github.com/rfjakob/earlyoom.git"
 	inherit git-r3
 else
 	SRC_URI="https://github.com/rfjakob/earlyoom/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	SRC_URI+=" test? ( https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-deps.tar.xz )"
+
 	KEYWORDS="~amd64 ~x86"
 fi
-IUSE="docs systemd test"
 
-RDEPEND=""
-DEPEND=""
+LICENSE="MIT-with-advertising"
+SLOT="0"
+IUSE="man test"
+RESTRICT="!test? ( test )"
+
 BDEPEND="
-	docs? ( app-text/pandoc )
+	man? ( virtual/pandoc )
 	test? ( dev-lang/go )
 "
 
-#tests don't work
-RESTRICT=test
+src_unpack() {
+	default
+
+	use test && go-module_src_unpack
+}
 
 src_compile() {
-	VERSION="v${PV}" emake earlyoom
-	use docs && VERSION="v${PV}" emake earlyoom.1
-	use systemd && emake PREFIX=/usr earlyoom.service
+	tc-export CC
+
+	emake \
+		PREFIX="${EPREFIX}"/usr \
+		VERSION="v${PV}" \
+		SYSTEMDUNITDIR="$(systemd_get_systemunitdir)" \
+		earlyoom earlyoom.service $(usev man 'earlyoom.1')
 }
 
 src_install() {
 	dobin earlyoom
-	use docs && doman earlyoom.1
+
+	use man && doman earlyoom.1
 
 	insinto /etc/default
 	newins earlyoom.default earlyoom
 
-	doinitd "${FILESDIR}/${PN}"
-	use systemd && systemd_dounit earlyoom.service
+	dodir /etc/conf.d
+	dosym -r /etc/default/earlyoom /etc/conf.d/earlyoom
+
+	newinitd "${FILESDIR}"/${PN}-r1 ${PN}
+	systemd_dounit earlyoom.service
 }


             reply	other threads:[~2022-08-26 12:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 12:31 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-02-27 23:00 [gentoo-commits] repo/gentoo:master commit in: sys-apps/earlyoom/ Sam James
2024-02-09 13:04 Joonas Niilola
2023-08-23 17:52 Rick Farina
2023-08-23 17:52 Rick Farina
2023-08-23 17:52 Rick Farina
2023-08-23 17:52 Rick Farina
2023-06-08 22:35 Sam James
2022-08-26 12:31 Sam James
2021-07-28  6:42 Agostino Sarubbo
2021-04-03 15:44 Sam James
2021-02-26 17:19 Rick Farina
2020-09-21 18:05 Rick Farina
2020-09-17 12:57 Pacho Ramos
2020-09-15 12:55 Pacho Ramos
2020-01-10 20:50 Rick Farina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1661516767.c3d149d6d75b441bf8f3292f3e5bbf97ea81c6d3.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox