summaryrefslogtreecommitdiff
path: root/net-wireless/bdaddr/bdaddr-0_p20210511.ebuild
blob: 4b3ac829697a5bbee6f44a2ae45f5ed8c44f206d (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
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="Utility for changing the Bluetooth device address"
HOMEPAGE="https://github.com/thxomas/bdaddr"

if [[ ${PV} == "9999" ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/thxomas/bdaddr"
else
	MY_COMMIT=53dae3f6a33bca202ddae0e7b14beeaf2d7d653b
	SRC_URI="
		https://github.com/thxomas/bdaddr/archive/${MY_COMMIT}.tar.gz
			-> ${P}.tar.gz"
	KEYWORDS="~amd64 ~arm64"
	S="${WORKDIR}/${PN}-${MY_COMMIT}"
fi

# https://github.com/thxomas/bdaddr/pull/6
SRC_URI+="
	https://github.com/Flowdalic/bdaddr/commit/e5cf5666e00828a3769fcda4717b0ee6f277001d.patch
		-> ${PN}-0_p20210511-idiomatic-makefile.patch
"

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

COMMON_DEPEND="
	net-wireless/bluez:=
"
RDEPEND="
	${COMMON_DEPEND}
	sys-apps/hwdata
"
DEPEND="
	${COMMON_DEPEND}
"
BDEPEND="dev-go/go-md2man"

PATCHES=(
	"${DISTDIR}"/${PN}-0_p20210511-idiomatic-makefile.patch
)

src_compile() {
	emake

	go-md2man -in README.md -out ${PN}.1 || die
}

src_install() {
	dobin ${PN}
	doman ${PN}.1
	dosym ../hwdata/oui.txt usr/share/misc/oui.txt
}