summaryrefslogtreecommitdiff
blob: 5bf9b0440aa6bb88a0bd11ade24dd4705cd3bf20 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit autotools systemd

DESCRIPTION="IPMI Management Utilities"
HOMEPAGE="http://ipmiutil.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~hppa ~ppc ~x86"
IUSE="static-libs"

RDEPEND=">=dev-libs/openssl-1:0="
DEPEND="${RDEPEND}
	virtual/os-headers"

PATCHES=(
	"${FILESDIR}"/${PN}-3.1.7-flags.patch
	"${FILESDIR}"/${PN}-2.9.9-lib_symlink.patch
	"${FILESDIR}"/${PN}-3.1.7-fix-configure.patch
)

src_prepare() {
	default

	sed -i -e 's|-O2 -g|$(CFLAGS)|g;s|-g -O2|$(CFLAGS)|g' util/Makefile.am* || die
	sed -i -e 's|which rpm |which we_are_gentoo_rpm_is_a_guest |' configure.ac || die

	# Don't compress man pages
	sed '/gzip -nf/d' -i doc/Makefile.am || die

	eautoreconf
}

src_configure() {
	local myeconfargs=(
		--disable-systemd
		--enable-sha256
		--enable-lanplus
	)
	econf "${myeconfargs[@]}"
}

src_compile() {
	# Ulgy workaround. Upstream is misusing the make system here
	# and it doesn't even work.
	# Please check on each bump if this workaround is still required.
	pushd lib/lanplus &>/dev/null || die
	emake
	cp libipmi_lanplus.a .. || die
	popd &>/dev/null || die

	emake
}

src_install() {
	emake DESTDIR="${D}" sysdto="${D}/$(systemd_get_systemunitdir)" install
	dodoc -r AUTHORS ChangeLog NEWS README TODO doc/UserGuide

	# Init scripts are only for Fedora
	rm -r "${ED}"/etc/init.d || die 'remove initscripts failed'

	# --disable-static has no effect
	if ! use static-libs ; then
		find "${ED}" -type f -name '*.a' -delete || die
	fi

	keepdir /var/lib/ipmiutil
}