blob: 42ce886ffe1fc8c3d1b08d7d51e2155de86f5d67 [file] [log] [blame]
#
# Copyright 2023 Google LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
EAPI=7
inherit autotools systemd
DESCRIPTION="Utility for controlling IPMI enabled devices"
HOMEPAGE="https://github.com/ipmitool/ipmitool"
MY_P="${PN^^}_${PV//./_}"
SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/${MY_P}.tar.gz -> ${P}.tar.gz
https://dev.gentoo.org/~ajak/distfiles/${CATEGORY}/${PN}/enterprise-numbers-${PV}.xz"
S="${WORKDIR}/${PN}-${MY_P}"
LICENSE="BSD"
SLOT="0"
KEYWORDS="* amd64 arm64 hppa ~ia64 ppc ppc64 ~riscv x86"
IUSE="openbmc openipmi static"
RDEPEND="dev-libs/openssl:0=
sys-libs/readline:0=
openbmc? ( sys-apps/systemd:0= )"
DEPEND="${RDEPEND}
>=sys-devel/autoconf-2.69-r5
virtual/os-headers
openipmi? ( sys-libs/openipmi )"
PATCHES=(
"${FILESDIR}/${P}-missing-func-decl.patch"
"${FILESDIR}/${P}-CVE-2011-4339.patch"
"${FILESDIR}/${PN}-add_bind_interface.patch"
)
src_prepare() {
default
eautoreconf
# If this file is not present, then ipmitool will try to download it during make install!
cp -al "${WORKDIR}/enterprise-numbers-${PV}" "${S}/enterprise-numbers" \
|| die "Could not place IANA enterprise-numbers"
}
src_configure() {
local econfargs=(
$(use_enable static) \
--enable-ipmishell \
--enable-intf-lan \
--enable-intf-usb \
$(use_enable openbmc intf-dbus) \
--enable-intf-lanplus \
--enable-intf-open \
--enable-intf-serial \
--disable-intf-bmc \
--disable-intf-dummy \
--disable-intf-free \
--disable-intf-imb \
--disable-intf-lipmi \
--disable-internal-md5 \
--with-kerneldir="${SYSROOT}"/usr \
--bindir="${EPREFIX}"/usr/bin \
--runstatedir=/run \
CFLAGS="${CFLAGS}"
)
econf "${econfargs[@]}"
}
src_install() {
emake DESTDIR="${D}" PACKAGE="${PN}" install
}