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

EAPI=8

inherit cmake systemd udev

DESCRIPTION="Decoded Information from Radio Emissions for Windows Or Linux Fans"
HOMEPAGE="https://github.com/wb2osz/direwolf/blob/master/README.md"
SRC_URI="https://github.com/wb2osz/direwolf/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2 BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
IUSE="gps hamlib test udev"
RESTRICT="!test? ( test )"

RDEPEND="
	media-libs/alsa-lib
	gps? ( sci-geosciences/gpsd )
	hamlib? ( media-libs/hamlib:= )
	udev? ( virtual/libudev:= )
"
DEPEND="${RDEPEND}"

PATCHES=(
	"${FILESDIR}"/${PN}-1.6-use-standard-doc-dir.patch
)

src_configure() {
	local mycmakeargs=(
		-DCMAKE_DISABLE_FIND_PACKAGE_GPSD=$(usex !gps)
		-DCMAKE_DISABLE_FIND_PACKAGE_hamlib=$(usex !hamlib)
		-DCMAKE_DISABLE_FIND_PACKAGE_udev=$(usex !udev)
		-DUNITTEST=$(usex test)
	)

	cmake_src_configure
}

src_install() {
	cmake_src_install

	# Fix udev rule installation path
	udev_dorules "${ED}"/etc/udev/rules.d/99-direwolf-cmedia.rules
	rm "${ED}"/etc/udev/rules.d/99-direwolf-cmedia.rules || die

	keepdir /var/log/direwolf

	# Pre-CMake, we installed a default config to /etc/direwolf.
	# Should we do that now?
	#insinto /etc/direwolf/
	#doins direwolf.conf

	systemd_dounit "${FILESDIR}"/direwolf.service
	systemd_dounit "${FILESDIR}"/direwolf-kiss.service
}

pkg_postinst() {
	if [[ -z "${REPLACING_VERSIONS}" ]] ; then
		einfo "The default configuration files are at:"
		einfo " - ${EROOT}/usr/share/doc/${PF}/conf/direwolf.conf"
		einfo " - ${EROOT}/usr/share/doc/${PF}/conf/sdr.conf"
		einfo "Copy these to the /etc/direwolf/ directory to modify them."
	fi
}