Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/wireless-regdb.git#5a60b504820970d8c8ab0353bd78bd16adffd672
This commit is contained in:
DistroBaker 2021-01-19 11:21:12 +01:00
parent 3c1d0eaeab
commit b2e633e240
6 changed files with 219 additions and 0 deletions

2
.gitignore vendored
View File

@ -0,0 +1,2 @@
/wireless-regdb-2020.04.29.tar.xz
/wireless-regdb-2020.11.20.tar.xz

5
85-regulatory.rules Normal file
View File

@ -0,0 +1,5 @@
# Set wireless regulatory domain at device creation
# For more information:
# man setregdomain
SUBSYSTEM=="ieee80211", ACTION=="add", RUN+="/usr/sbin/setregdomain"

69
setregdomain Executable file
View File

@ -0,0 +1,69 @@
#!/bin/sh
#
# Copyright 2009-2014 Red Hat, Inc. All rights reserved.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
REGDOMAIN=/etc/sysconfig/regdomain
LOCALTIME=/etc/localtime
LOGGER="/usr/bin/logger -t wireless"
getcountry() {
while read c a z r
do
if [ "$z" = "$ZONE" ]
then
echo $c
break
fi
done < /usr/share/zoneinfo/zone.tab
}
if [ -f $REGDOMAIN ]
then
# This should set COUNTRY
. $REGDOMAIN
if [ -n "$COUNTRY" ]
then
/usr/sbin/iw reg set $COUNTRY
exit
fi
fi
if [ -f "$LOCALTIME" ]
then
ZONE=$(readlink -f $LOCALTIME)
ZONE=${ZONE#/usr/share/zoneinfo/}
else
$LOGGER -s "Timezone information not found! Unable to set regulatory domain."
exit 1
fi
if [ -z "$ZONE" -o "$ZONE" = "$LOCALTIME" ]
then
$LOGGER -s "Could not determine timezone! Unable to set regulatory domain."
exit 1
fi
COUNTRY=$(getcountry)
if [ -z "$COUNTRY" ]
then
$LOGGER -s "Could not determine country! Unable to set regulatory domain."
exit 1
fi
$LOGGER "setting regulatory domain to $COUNTRY based on timezone ($ZONE)"
/usr/sbin/iw reg set $COUNTRY

36
setregdomain.1 Normal file
View File

@ -0,0 +1,36 @@
.\" Copyright 2009 Red Hat, Inc.
.TH segregdomain 1 2014-11-19 "CRDA" "User Commands"
.SH NAME
setregdomain \- set regulatory domain based on country code
.SH SYNOPSIS
.B setregdomain
.SH DESCRIPTION
setregdomain sets the regulatory domain for your system; it takes no
arguments and is normally called via system script (eg, udev) rather
than manually by an administrator.
The regulatory domain is represented by an ISO / IEC 3166-1 alpha2
country code. By default, setregdomain attempts to determine
the appropriate country code by examining the target of the
.IR /etc/localtime
symbolic link. That information is used to look-up the matching
country code in the
.IR /usr/share/zoneinfo/zone.tab
file.
The country code look-up may fail. This could be due to faulty
or incomplete information in the
.IR /usr/share/zoneinfo/zone.tab
file, or the use of an actual file rather than a symlink for
.IR /etc/localtime
, among other possibilities. In those cases the system
administrator should define a COUNTRY environment variable in the
.IR /etc/sysconfig/regdomain
file. This value will be used as the country code and the country
code look-up will be skipped.
.SH "FILES"
.BR /etc/sysconfig/regdomain
.BR /etc/localtime
.BR /usr/share/zoneinfo/zone.tab
.SH "SEE ALSO"
.BR iw (1)

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (wireless-regdb-2020.11.20.tar.xz) = 93764e677c4d5cdcb4e927bff206c646061fe1e65896dd63f683e145d45917545b4e08caa14bfb3ea04ffb85438935503bbde386cbabfef2804905e508ecf7a0

106
wireless-regdb.spec Normal file
View File

@ -0,0 +1,106 @@
%global _firmwarepath /usr/lib/firmware
Name: wireless-regdb
Version: 2020.11.20
Release: 1%{?dist}
Summary: Regulatory database for 802.11 wireless networking
License: ISC
URL: https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb
BuildArch: noarch
Requires: udev, iw
Requires: systemd >= 190
BuildRequires: make
BuildRequires: systemd-devel
Provides: crda = 3.18_2019.03.01-3
Obsoletes: crda <= 3.18_2019.03.01-2
Source0: http://www.kernel.org/pub/software/network/wireless-regdb/wireless-regdb-%{version}.tar.xz
Source1: setregdomain
Source2: setregdomain.1
Source3: 85-regulatory.rules
%description
The wireless-regdb package provides the regulatory rules database
used by the kernels 802.11 networking stack in order to comply
with radio frequency regulatory rules around the world.
%prep
%setup -q
%build
: # Package installs a firmware-like, prebuilt binary from upstream...
%install
make install DESTDIR=%{buildroot} MANDIR=%{_mandir} \
FIRMWARE_PATH=%{_firmwarepath}
install -D -pm 0755 %SOURCE1 %{buildroot}%{_sbindir}/setregdomain
install -D -pm 0644 %SOURCE2 %{buildroot}%{_mandir}/man1/setregdomain.1
install -D -pm 0644 %SOURCE3 %{buildroot}%{_udevrulesdir}/85-regulatory.rules
rm -rf %{buildroot}/usr/lib/crda
%files
%{_sbindir}/setregdomain
%{_udevrulesdir}/85-regulatory.rules
%{_firmwarepath}/regulatory.db
%{_firmwarepath}/regulatory.db.p7s
%{_mandir}/man1/setregdomain.1*
%{_mandir}/man5/regulatory.db.5*
%{_mandir}/man5/regulatory.bin.5*
%license LICENSE
%doc README
%changelog
* Wed Dec 09 2020 John W. Linville <linville@redhat.com> - 2020.11.20-1
- Update to version 2020.11.20 from upstream
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2020.04.29-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu May 21 2020 John W. Linville <linville@redhat.com> - 2020.04.29-1
- Update to version 2020.04.29 from upstream
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2019.06.03-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Aug 28 2019 John W. Linville <linville@redhat.com> - 2019.06.03-5
- Remove patch preventing install of regulatory.bin.5 man page
- Include regulatory.bin.5 man page in distributed files
* Mon Aug 26 2019 John W. Linville <linville@redhat.com> - 2019.06.03-4
- Bump crda Provides and Obsoletes to ensure proper upgrades
* Mon Aug 05 2019 John W. Linville <linville@redhat.com> - 2019.06.03-3
- remove Requires for kernel
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2019.06.03-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jun 06 2019 John W. Linville <linville@redhat.com> - 2019.06.03-1
- Update to version 2019.06.03 from upstream
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2018.05.31-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Aug 02 2018 John W. Linville <linville@redhat.com> - 2018.05.31-4
- Enable Provides for crda so as to promote automated upgrades
* Wed Jul 18 2018 John W. Linville <linville@redhat.com> - 2018.05.31-3
- Fix-up changelog typos and bump Release
* Wed Jul 18 2018 John W. Linville <linville@redhat.com> - 2018.05.31-2
- Add BuildRequires for systemd-devel to provide _udevrulesdir definition
* Fri Jul 06 2018 John W. Linville <linville@redhat.com> - 2018.05.31-1
- Initial build