summaryrefslogtreecommitdiff
path: root/sys-apps/smc-sum/smc-sum-2.8.0.20220126.ebuild
blob: e309a7ad7f47e5cceb2bd0f2034b5a8fbd9ff081 (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
73
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit linux-mod

MY_DATE="$(ver_cut 4)"
MY_PN="${PN/smc-/}"
MY_PV="$(ver_cut 1-3)"

DESCRIPTION="Updates the BIOS and IPMI firmware and system settings on Supermicro mainboards"
HOMEPAGE="https://www.supermicro.com"
SRC_URI="${MY_PN}_${MY_PV}_Linux_x86_64_${MY_DATE}.tar.gz"
S="${WORKDIR}/${MY_PN}_${MY_PV}_Linux_x86_64"

LICENSE="supermicro"
SLOT="0"
KEYWORDS="-* ~amd64"
IUSE="module"

RDEPEND="
	sys-libs/zlib
	sys-power/iasl
	module? ( !sys-apps/smc-sum-driver )
"

RESTRICT="bindist fetch mirror"

DOCS=(
	"PlatformFeatureSupportMatrix.pdf"
	"ReleaseNote.txt"
	"SUM_UserGuide.pdf"
	"sumrc.sample"
	"ExternalData/SMCIPID.txt"
	"ExternalData/VENID.txt"
)

PATCHES=( "${FILESDIR}/${PN}-2.7.0.20210903-missing-include.patch" )

BUILD_TARGETS="default"
MODULE_NAMES="sum_bios(misc:${S}/driver/Source/Linux)"

QA_PREBUILT="usr/bin/smc-sum"

pkg_nofetch() {
	elog "Please download ${A} from"
	elog "https://www.supermicro.com/SwDownload/UserInfo.aspx?sw=0&cat=SUM"
	elog "and place it in your DISTDIR directory."
}

src_prepare() {
	default

	# Install new Makefile to respect users CFLAGS and LDFLAGS
	cp "${FILESDIR}"/makefile driver/Source/Linux/Makefile || die
}

src_compile() {
	if use module; then
		BUILD_PARAMS="KDIR=${KV_OUT_DIR} M=${S}/driver/Source/Linux"
		linux-mod_src_compile
	else
		:;
	fi
}

src_install() {
	newbin sum smc-sum
	einstalldocs

	use module && linux-mod_src_install
}