Magellan Linux

Annotation of /branches/R11-unstable/core/wireless-regdb/wireless-regdb-2018.10.24-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32084 - (hide annotations) (download)
Mon Apr 29 11:34:35 2019 UTC (5 years ago) by niro
File size: 1857 byte(s)
-release branches/R11-unstable
1 niro 31542 # $Id$
2    
3     PNAME="wireless-regdb"
4     PVER="2018.10.24"
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     sminclude mtools
27    
28     SRC_URI=(
29     https://www.kernel.org/pub/software/network/${PNAME}/${SRCFILE}
30     mirror://${PNAME}/${SRCFILE}
31     )
32    
33     UP2DATE="updatecmd https://www.kernel.org/pub/software/network/${PNAME}/ | highesttarball xz"
34    
35     src_prepare()
36     {
37     munpack ${SRCFILE} || die
38     }
39    
40     src_compile()
41     {
42     cd ${SRCDIR}
43    
44     if [[ ${DATABASE_VERIFY} -eq 1 ]]
45     then
46     echo "Enabled regulatory database verification."
47     if regdbdump ${SRCDIR}/regulatory.bin > /dev/null
48     then
49     echo "Regulatory database verification was succesful."
50     else
51     die "Regulatory database verification failed."
52     fi
53     else
54     echo "Disabled regulatory database verification."
55     fi
56     }
57    
58     src_install()
59     {
60     cd ${SRCDIR}
61    
62     minstalldir /usr/lib/crda || die
63     minstallfile regulatory.bin /usr/lib/crda || die
64     minstallman regulatory.bin.5 || die
65    
66     minstalldir /usr/lib/crda/pubkeys || die
67     minstallfile sforshee.key.pub.pem /usr/lib/crda/pubkeys || die
68    
69     minstalldir /etc/conf.d || die
70     MCONFIG="/etc/conf.d/wireless-regdom"
71     mclearconfig || die
72     maddconfig "#"
73     maddconfig "# Wireless regulatory domain configuration"
74     maddconfig "#"
75     maddconfig
76     local i
77     for i in $(grep ^country db.txt | cut -d' ' -f2 | sed 's|:||g' | sort -u)
78     do
79     maddconfig "#WIRELESS_REGDOM=\"${i}\""
80     done
81    
82     minstalldocs CONTRIBUTING LICENSE README || die
83     }