a38439a45dc535b88e6174ae518d2451f2bfaa8c
[gentoo.git] / sys-apps / irqbalance / irqbalance-1.4.0.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="6"
5 AUTOTOOLS_AUTORECONF=true
6
7 inherit autotools systemd linux-info
8
9 DESCRIPTION="Distribute hardware interrupts across processors on a multiprocessor system"
10 HOMEPAGE="https://github.com/Irqbalance/irqbalance"
11 SRC_URI="https://github.com/Irqbalance/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~ppc ~x86"
16 IUSE="caps +numa selinux"
17
18 CDEPEND="
19         dev-libs/glib:2
20         sys-libs/ncurses:0=[unicode]
21         caps? ( sys-libs/libcap-ng )
22         numa? ( sys-process/numactl )
23 "
24 DEPEND="${CDEPEND}
25         virtual/pkgconfig
26 "
27 RDEPEND="${CDEPEND}
28         selinux? ( sec-policy/selinux-irqbalance )
29 "
30
31 pkg_setup() {
32         CONFIG_CHECK="~PCI_MSI"
33         linux-info_pkg_setup
34 }
35
36 src_prepare() {
37         # Follow systemd policies
38         # https://wiki.gentoo.org/wiki/Project:Systemd/Ebuild_policy
39         sed \
40                 -e 's/ $IRQBALANCE_ARGS//' \
41                 -e '/EnvironmentFile/d' \
42                 -i misc/irqbalance.service || die
43
44         default
45
46         eautoreconf
47 }
48
49 src_configure() {
50         local myeconfargs=(
51                 $(use_with caps libcap-ng)
52                 $(use_enable numa)
53                 )
54
55         econf "${myeconfargs[@]}"
56 }
57
58 src_install() {
59         default
60
61         newinitd "${FILESDIR}"/irqbalance.init.4 irqbalance
62         newconfd "${FILESDIR}"/irqbalance.confd-1 irqbalance
63         systemd_dounit misc/irqbalance.service
64 }