summaryrefslogtreecommitdiff
path: root/sys-apps/earlyoom/earlyoom-9999.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-08-26 14:52:16 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-08-26 14:52:16 +0100
commitc3d998909264b1ff687b9c65cae3046443e66f7e (patch)
treeed7aa279f601f6c46fb8b7425bd2a051b72be8d6 /sys-apps/earlyoom/earlyoom-9999.ebuild
parentcf91c70bb5a537972156006c46756b9ac75bdb7b (diff)
gentoo auto-resync : 26:08:2022 - 14:52:16
Diffstat (limited to 'sys-apps/earlyoom/earlyoom-9999.ebuild')
-rw-r--r--sys-apps/earlyoom/earlyoom-9999.ebuild50
1 files changed, 32 insertions, 18 deletions
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
}