Magellan Linux

Contents of /smage/branches/alx07x-stable/core/wireless-regdb/wireless-regdb-2019.06.03-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 13509 - (show annotations) (download)
Fri Jul 12 11:55:15 2019 UTC (4 years, 9 months ago) by niro
File size: 2002 byte(s)
-release branches/alx07x-stable
1 # $Id$
2
3 PNAME="wireless-regdb"
4 PVER="2019.06.03"
5 PBUILD="r1"
6
7 PCAT="net-wlan"
8
9 DESCRIPTION="Central Regulatory Domain Database for wireless networks."
10 HOMEPAGE="http://wireless.kernel.org/en/developers/Regulatory"
11
12 DEPEND=""
13 SDEPEND=">= virtual/grep"
14
15 # 0 - disable verify, 1 - enable verify but requires crda, which pratically leeds to an dep loop
16 # use 0 to initially build crda and the rebuild with 1 enabled
17 DATABASE_VERIFY=1
18 if [[ ${DATABASE_VERIFY} -eq 1 ]]
19 then
20 SDEPEND=">= net-wlan/crda-3"
21 fi
22
23 SRCFILE="${PNAME}-${PVER}.tar.xz"
24 SRCDIR="${BUILDDIR}/${PNAME}-${PVER/_pre*/}"
25
26 ALX_PKG_KEEP="etc/conf.d usr/lib/crda"
27 sminclude mtools alx-split
28
29 SRC_URI=(
30 https://www.kernel.org/pub/software/network/${PNAME}/${SRCFILE}
31 mirror://${PNAME}/${SRCFILE}
32 )
33
34 UP2DATE="updatecmd https://www.kernel.org/pub/software/network/${PNAME}/ | highesttarball xz"
35
36 src_prepare()
37 {
38 munpack ${SRCFILE} || die
39 }
40
41 src_compile()
42 {
43 cd ${SRCDIR}
44
45 if [[ ${DATABASE_VERIFY} -eq 1 ]]
46 then
47 echo "Enabled regulatory database verification."
48 if regdbdump ${SRCDIR}/regulatory.bin > /dev/null
49 then
50 echo "Regulatory database verification was succesful."
51 else
52 die "Regulatory database verification failed."
53 fi
54 else
55 echo "Disabled regulatory database verification."
56 fi
57 }
58
59 alx_generic_src_install()
60 {
61 cd ${SRCDIR}
62
63 minstalldir /usr/lib/crda || die
64 minstallfile regulatory.bin /usr/lib/crda || die
65 minstallman regulatory.bin.5 || die
66
67 minstalldir /usr/lib/crda/pubkeys || die
68 minstallfile sforshee.key.pub.pem /usr/lib/crda/pubkeys || die
69
70 minstalldir /etc/conf.d || die
71 MCONFIG="/etc/conf.d/wireless-regdom"
72 mclearconfig || die
73 maddconfig "#"
74 maddconfig "# Wireless regulatory domain configuration"
75 maddconfig "#"
76 maddconfig
77 local i
78 for i in $(grep ^country db.txt | cut -d' ' -f2 | sed 's|:||g' | sort -u)
79 do
80 maddconfig "#WIRELESS_REGDOM=\"${i}\""
81 done
82
83 # alx only, enable DE regdom as default
84 maddconfig 'WIRELESS_REGDOM="DE"' || die
85
86 minstalldocs CONTRIBUTING LICENSE README || die
87 }