+#
+# Conditional build:
+%bcond_without verify # don't verify database
+
Summary: Wireless regulatory database for Linux drivers
Summary(pl.UTF-8): Baza danych przepisów dotyczących sieci bezprzewodowych dla sterowników linuksowych
Name: wireless-regdb
-Version: 2011.04.28
+Version: 2024.01.23
Release: 1
License: ISC
Group: Networking/Daemons
-Source0: http://linuxwireless.org/download/wireless-regdb/%{name}-%{version}.tar.bz2
-# Source0-md5: 16b7fabd4d7761ccf206702a3f18cce9
-URL: http://wireless.kernel.org/en/developers/Regulatory
+Source0: https://www.kernel.org/pub/software/network/wireless-regdb/%{name}-%{version}.tar.xz
+# Source0-md5: 3121e855df9512a2c6442d483d209c32
+URL: https://wireless.wiki.kernel.org/en/developers/Regulatory
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
+%{?with_verify:BuildRequires: crda}
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%define _datadir /lib
+
%description
This package contains the wireless regulatory database used by all
cfg80211 based Linux wireless drivers.
%prep
%setup -q
+%build
+%if %{with verify}
+PATH=/sbin:$PATH \
+regdbdump regulatory.bin > dump.txt
+test -s dump.txt
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_datadir}/crda,%{_mandir}/man5}
-
-install regulatory.bin $RPM_BUILD_ROOT%{_datadir}/crda/regulatory.bin
-install regulatory.bin.5 $RPM_BUILD_ROOT%{_mandir}/man5
+install -d $RPM_BUILD_ROOT{/lib/firmware,%{_datadir}/crda,%{_mandir}/man5}
+cp -p regulatory.db regulatory.db.p7s $RPM_BUILD_ROOT/lib/firmware
+cp -p regulatory.bin $RPM_BUILD_ROOT%{_datadir}/crda/regulatory.bin
+cp -p regulatory.bin.5 $RPM_BUILD_ROOT%{_mandir}/man5
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
+%doc LICENSE README
+/lib/firmware/regulatory.db
+/lib/firmware/regulatory.db.p7s
%{_datadir}/crda
%{_mandir}/man5/regulatory.bin.5*