summaryrefslogtreecommitdiff
path: root/sys-block/mmc-utils/mmc-utils-1.0.ebuild
blob: e5a477c5fcfa9b88b59f05be3b9c8da3fb894cf7 (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
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit toolchain-funcs

DESCRIPTION="Userspace tools for MMC/SD devices"
HOMEPAGE="https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git/"

SRC_URI="https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git/snapshot/mmc-utils-${PV}.tar.gz"

LICENSE="GPL-2 BSD"
SLOT="0"

KEYWORDS="amd64 ~arm64"

IUSE="doc"

RDEPEND="!dev-lang/mercury"
BDEPEND="doc? ( dev-python/sphinx )"

src_prepare() {
	default
	sed -i \
		-e '/^GIT_VERSION /d' \
		-e 's/-Werror //' \
		-e 's/-D_FORTIFY_SOURCE=2 //' \
		-e "s/-DVERSION=.*/-DVERSION=\\\\\"gentoo-${PVR}\\\\\"/" \
		Makefile || die
}

src_configure() {
	tc-export CC
}

src_compile() {
	emake C=0
	use doc && emake -C docs html
}

src_install() {
	dosbin mmc
	dodoc README
	doman man/mmc.1
	if use doc; then
		docinto html
		dodoc -r docs/_build/html/.
	fi
}