summaryrefslogtreecommitdiff
blob: f44a4d6f81fb4d75205c73c3bb7867aa94911fb2 (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
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit autotools

DESCRIPTION="Near Field Communication (NFC) management daemon"
HOMEPAGE="https://github.com/linux-nfc/neard"
SRC_URI="https://github.com/linux-nfc/neard/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
IUSE="test tools systemd"

RESTRICT="!test? ( test )"

RDEPEND="
	>=dev-libs/glib-2.28
	dev-libs/libnl:3=
	>=sys-apps/dbus-1.2
	systemd? ( sys-apps/systemd:0 )
"

DEPEND="${RDEPEND}"

src_prepare() {
	default
	eautoreconf
}

src_configure() {
	local myeconfargs=(
		--disable-optimization
		--enable-ese
		--enable-nfctype1
		--enable-nfctype2
		--enable-nfctype3
		--enable-nfctype4
		--enable-nfctype5
		--enable-p2p
		--enable-pie
		$(use_enable systemd)
		$(use_enable test)
		$(use_enable tools)
	)
	econf "${myeconfargs[@]}"
}

src_install() {
	default

	# Patch for this has been sent upstream.  Do it manually
	# to avoid having to rebuild autotools. #580876
	mv "${ED}/usr/include/version.h" "${ED}/usr/include/near/" || die

	insinto "/etc/dbus-1/system.d/"
	doins "se/org.neard.se.conf"

	newinitd "${FILESDIR}/neard.rc" neard
	newconfd "${FILESDIR}/neard.confd" neard
}