dev-python/pytest: arm64 stable (bug #723996)
[gentoo.git] / app-admin / mcelog / mcelog-170.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit linux-info systemd toolchain-funcs
7
8 DESCRIPTION="A tool to log and decode Machine Check Exceptions"
9 HOMEPAGE="http://mcelog.org/"
10 SRC_URI="https://github.com/andikleen/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="selinux"
16
17 RDEPEND="selinux? ( sec-policy/selinux-mcelog )"
18
19 # TODO: add mce-inject to the tree to support test phase
20 RESTRICT="test"
21
22 pkg_pretend() {
23         if [[ ${MERGE_TYPE} != buildonly ]]; then
24                 local CONFIG_CHECK="~X86_MCE"
25                 kernel_is -ge 4 12 && CONFIG_CHECK+=" ~X86_MCELOG_LEGACY"
26                 check_extra_config
27         fi
28 }
29
30 src_prepare() {
31         eapply "${FILESDIR}"/${PN}-0.8_pre1-timestamp-${PN}.patch \
32                 "${FILESDIR}"/${PN}-129-debugflags.patch
33         eapply_user
34         tc-export CC
35 }
36
37 src_install() {
38         default
39
40         insinto /etc/cron.daily
41         newins ${PN}.cron ${PN}
42
43         insinto /etc/logrotate.d/
44         newins ${PN}.logrotate ${PN}
45
46         newinitd "${FILESDIR}"/${PN}.init-r1 ${PN}
47         systemd_dounit "${FILESDIR}"/${PN}.service
48
49         dodoc *.pdf
50 }
51
52 pkg_postinst() {
53         einfo "The default configuration set is now installed in /etc/${PN}"
54         einfo "you might want to edit those files."
55         einfo
56         einfo "A sample cronjob is installed into /etc/cron.daily"
57         einfo "without executable bit (system service is the preferred method now)"
58 }