Diff wireless-regdb-20220606 with a wireless-regdb-20230503-r2

/usr/portage/net-wireless/wireless-regdb/wireless-regdb-20230503-r2.ebuild 2023-10-09 14:52:34.788368484 +0300
1
# Copyright 1999-2022 Gentoo Authors
1
# Copyright 1999-2023 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=8
5 5

  
6
inherit linux-info
7

  
6 8
MY_P="wireless-regdb-${PV:0:4}.${PV:4:2}.${PV:6:2}"
7
DESCRIPTION="Binary regulatory database for CRDA"
9
DESCRIPTION="Wireless Regulatory database for Linux"
8 10
HOMEPAGE="https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb"
9
SRC_URI="https://www.kernel.org/pub/software/network/${PN}/${MY_P}.tar.xz"
11
SRC_URI="https://mirrors.edge.kernel.org/pub/software/network/${PN}/${MY_P}.tar.xz"
10 12
S="${WORKDIR}/${MY_P}"
11 13

  
12 14
LICENSE="ISC"
13 15
SLOT="0"
14
KEYWORDS="~alpha amd64 arm arm64 ~ia64 ~loong ~mips ppc ppc64 ~riscv sparc x86"
16
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
17
IUSE="crda"
18

  
19
#PDEPEND is required here or crda test dep causes circular deps
20
PDEPEND="crda? ( net-wireless/crda )"
21

  
22
REQUIRED_USE="kernel_linux"
23

  
24
pkg_pretend() {
25
	if kernel_is -ge 4 15; then
26
		if linux_config_exists; then
27
			if linux_chkconfig_builtin CFG80211 &&
28
				[[ $(linux_chkconfig_string EXTRA_FIRMWARE) != *regulatory.db* ]]; then
29
				ewarn "REGULATORY DOMAIN PROBLEM:"
30
				ewarn "  With CONFIG_CFG80211=y (built-in), the driver(s) won't be able to load regulatory.db from"
31
				ewarn "  /lib/firmware, resulting in broken regulatory domain support. Please set CONFIG_CFG80211=m"
32
				ewarn "  or add regulatory.db and regulatory.db.p7s to CONFIG_EXTRA_FIRMWARE."
33
			fi
34
			if ! linux_chkconfig_present CFG80211; then
35
				ewarn "REGULARTORY DOMAIN PROBLEM:"
36
				ewarn "  With CONFIG_CFG80211 unset, the driver(s) won't be able to load the regulatory.db from"
37
				ewarn "  /lib/firmware, resulting in broken regulatory domain support. Please set CONFIG_CFG80211=m."
38
			fi
39
			if linux_chkconfig_present EXPERT && linux_chkconfig_present CFG80211_CRDA_SUPPORT; then
40
				ewarn "You can safely disable CFG80211_CRDA_SUPPORT"
41
			fi
42
		fi
43

  
44
		if has_version net-wireless/crda || use crda; then
45
			ewarn "Starting from kernel version 4.15 net-wireless/crda is no longer needed."
46
			ewarn "The crda USE flag will be removed on or after Feb 01, 2024"
47
		fi
48

  
49
	else
50
		CONFIG_CHECK="~CFG80211_CRDA_SUPPORT"
51
		WARNING_CFG80211_CRDA_SUPPORT="REGULATORY DOMAIN PROBLEM: \
52
please enable CFG80211_CRDA_SUPPORT for proper regulatory domain support"
53
	fi
54

  
55
	check_extra_config
56
}
15 57

  
16 58
src_compile() {
17
	einfo "Recompiling regulatory.bin from db.txt would break CRDA verify. Installing unmodified binary version."
59
	einfo "Recompiling regulatory database(s) from db.txt would break signature verification."
60
	einfo "Installing unmodified binary version."
18 61
}
19 62

  
20 63
src_install() {
21
	# This file is not ABI-specific, and crda itself always hardcodes
22
	# this path.  So install into a common location for all ABIs to use.
23
	insinto /usr/lib/crda
24
	doins regulatory.bin
25

  
26
	insinto /etc/wireless-regdb/pubkeys
27
	doins sforshee.key.pub.pem
28

  
29
	# Linux 4.15 now complains if the firmware loader
30
	# can't find these files #643520
64
	if use crda; then
65
		# This file is not ABI-specific, and crda itself always hardcodes
66
		# this path.  So install into a common location for all ABIs to use.
67
		insinto /usr/lib/crda
68
		doins regulatory.bin
69

  
70
		insinto /etc/wireless-regdb/pubkeys
71
		doins sforshee.key.pub.pem
72
	fi
73
	# install the files the kernel needs unconditionally,
74
	# they are small and kernels get upgraded
31 75
	insinto /lib/firmware
32
	doins regulatory.db
33
	doins regulatory.db.p7s
76
	doins regulatory.db regulatory.db.p7s
34 77

  
35
	doman regulatory.bin.5
78
	# regulatory.db.5 is a reference to regulatory.bin.5 so you need both unconditionally
79
	doman -i18n= regulatory.db.5 regulatory.bin.5
36 80
	dodoc README db.txt
37 81
}
Thank you!