summaryrefslogtreecommitdiff
blob: ccd45d42a61d1a59770f23c7f27c18f89f96f133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Copyright 2020-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="Core dump file processor"
HOMEPAGE="https://linutronix.de/minicoredumper"
SRC_URI="https://linutronix.de/minicoredumper/files/${P}.tar.xz"

LICENSE="BSD BSD-2 LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"

DEPEND="
	dev-libs/json-c:=
	virtual/libelf
"

RDEPEND="${DEPEND}"
BDEPEND="virtual/pkgconfig"

src_configure() {
	# regd daemon is disabled as there are no known consumers
	local myconf=(
		--runstatedir="${EPREFIX}/run"
		--with-coreinject
		--with-libminicoredumper
		--with-minicoredumper
		--without-minicoredumper_demo
		--without-minicoredumper_regd
		--without-minicoredumper_trigger
		--without-werror
		MCD_DUMP_PATH="${EPREFIX}/var/lib/${PN}"
	)
	econf ${myconf[@]}
}

src_install() {
	default

	keepdir /var/lib/minicoredumper

	# systemd-coredump uses /usr/lib/sysctl.d/50-coredump.conf
	insinto /usr/lib/sysctl.d
	newins "${FILESDIR}"/60-minicoredumper.conf-r1 60-minicoredumper.conf

	# some files/dirs we don't want
	rmdir -v "${ED}/run" || die
	rm -rv "${ED}"/etc/{init.d,default} || die

	find "${ED}" -name '*.la' -delete || die
}