f7ff72
%define         crda_version    3.18
f7ff72
%define         regdb_version   2018.05.31
f7ff72
f7ff72
%global         _firmwarepath   /usr/lib/firmware
d81fc2
d81fc2
Name:           crda
d81fc2
Version:        %{crda_version}_%{regdb_version}
f7ff72
Release:        4%{?dist}
d81fc2
Summary:        Regulatory compliance daemon for 802.11 wireless networking
d81fc2
d81fc2
Group:          System Environment/Base
d81fc2
License:        ISC
f7ff72
URL:            http://wireless.kernel.org/en/developers/Regulatory/CRDA
d81fc2
BuildRoot:      %{_tmppath}/%{name}-%{crda_version}-%{release}-root-%(%{__id_u} -n)
d81fc2
d81fc2
BuildRequires:  kernel-headers >= 2.6.27
bc266b
BuildRequires:  libnl3-devel
d81fc2
BuildRequires:  libgcrypt-devel
d81fc2
BuildRequires:  pkgconfig python m2crypto
d81fc2
BuildRequires:  openssl
d81fc2
d81fc2
Requires:       udev, iw
d81fc2
Requires:       systemd >= 190
d81fc2
2da2c8
Source0:        http://www.kernel.org/pub/software/network/crda/crda-%{crda_version}.tar.xz
3cad05
Source1:        http://www.kernel.org/pub/software/network/wireless-regdb/wireless-regdb-%{regdb_version}.tar.xz
d81fc2
Source2:        setregdomain
d81fc2
Source3:        setregdomain.1
d81fc2
d81fc2
# Add udev rule to call setregdomain on wireless device add
d81fc2
Patch0:         regulatory-rules-setregdomain.patch
2da2c8
# Do not call ldconfig in crda Makefile
f7ff72
Patch1:         crda-remove-ldconfig.patch
f7ff72
# Ensure rebuild of regulatory.db after signature regeneration
f7ff72
Patch2:         wireless-regdb-fw-dependency.patch
d81fc2
d81fc2
d81fc2
%description
d81fc2
CRDA acts as the udev helper for communication between the kernel
d81fc2
and userspace for regulatory compliance. It relies on nl80211
d81fc2
for communication. CRDA is intended to be run only through udev
d81fc2
communication from the kernel.
d81fc2
d81fc2
2da2c8
%package devel
2da2c8
Summary:        Header files for use with libreg.
2da2c8
Group:          Development/System
2da2c8
2da2c8
2da2c8
%description devel
2da2c8
Header files to make use of libreg for accessing regulatory info.
2da2c8
2da2c8
d81fc2
%prep
d81fc2
%setup -q -c
d81fc2
%setup -q -T -D -a 1
d81fc2
d81fc2
%patch0 -p1 -b .setregdomain
d81fc2
5b5f64
cd crda-%{crda_version}
f7ff72
%patch1 -p1 -b .ldconfig-remove
f7ff72
cd ../wireless-regdb-%{regdb_version}
f7ff72
%patch2 -p2 -b .fwsign
5b5f64
d81fc2
d81fc2
%build
2da2c8
export CFLAGS="%{optflags}" LDFLAGS="%{?__global_ldflags}"
d81fc2
f7ff72
# Build CRDA using the sforshee.key.pub.pem key and regulatory.bin
f7ff72
cd crda-%{crda_version}
f7ff72
cp ../wireless-regdb-%{regdb_version}/sforshee.key.pub.pem pubkeys
f7ff72
 
2da2c8
make %{?_smp_mflags} SBINDIR=%{_sbindir}/ LIBDIR=%{_libdir}/ \
2da2c8
	REG_BIN=../wireless-regdb-%{regdb_version}/regulatory.bin
d81fc2
d81fc2
d81fc2
%install
d81fc2
rm -rf %{buildroot}
d81fc2
d81fc2
cd crda-%{crda_version}
2da2c8
cp LICENSE LICENSE.crda
d81fc2
cp README README.crda
2da2c8
make install DESTDIR=%{buildroot} MANDIR=%{_mandir}/ \
2da2c8
	SBINDIR=%{_sbindir}/ LIBDIR=%{_libdir}/
d81fc2
d81fc2
cd ../wireless-regdb-%{regdb_version}
2da2c8
cp LICENSE LICENSE.wireless-regdb
d81fc2
cp README README.wireless-regdb
f7ff72
make install DESTDIR=%{buildroot} MANDIR=%{_mandir} \
f7ff72
        FIRMWARE_PATH=%{_firmwarepath}
d81fc2
2da2c8
install -D -pm 0755 %SOURCE2 %{buildroot}%{_sbindir}
d81fc2
install -D -pm 0644 %SOURCE3 %{buildroot}%{_mandir}/man1/setregdomain.1
d81fc2
d81fc2
2da2c8
%post -p /sbin/ldconfig
2da2c8
%postun -p /sbin/ldconfig
2da2c8
2da2c8
d81fc2
%clean
d81fc2
rm -rf %{buildroot}
d81fc2
d81fc2
d81fc2
%files
d81fc2
%defattr(-,root,root,-)
2da2c8
%{_sbindir}/%{name}
2da2c8
%{_sbindir}/regdbdump
2da2c8
%{_sbindir}/setregdomain
2da2c8
%{_libdir}/libreg.so
d81fc2
/lib/udev/rules.d/85-regulatory.rules
f7ff72
# location of database is hardcoded to /usr/lib/%%{name}
2da2c8
/usr/lib/%{name}
f7ff72
%{_firmwarepath}/regulatory.db
f7ff72
%{_firmwarepath}/regulatory.db.p7s
d81fc2
%{_mandir}/man1/setregdomain.1*
d81fc2
%{_mandir}/man5/regulatory.bin.5*
f7ff72
%{_mandir}/man5/regulatory.db.5*
d81fc2
%{_mandir}/man8/crda.8*
d81fc2
%{_mandir}/man8/regdbdump.8*
2da2c8
%license crda-%{crda_version}/LICENSE.crda
2da2c8
%license wireless-regdb-%{regdb_version}/LICENSE.wireless-regdb
d81fc2
%doc crda-%{crda_version}/LICENSE crda-%{crda_version}/README.crda
d81fc2
%doc wireless-regdb-%{regdb_version}/README.wireless-regdb
d81fc2
d81fc2
2da2c8
%files devel
2da2c8
%{_includedir}/reglib/nl80211.h
2da2c8
%{_includedir}/reglib/regdb.h
2da2c8
%{_includedir}/reglib/reglib.h
2da2c8
2da2c8
d81fc2
%changelog
f7ff72
* Thu Aug 09 2018 John W. Linville <linville@redhat.com> - 3.18_2018.05.31-4
f7ff72
- Update changelog and bump Release
f7ff72
f7ff72
* Thu Aug 09 2018 Stanislaw Gruszka <sgruszka@redhat.com> - 3.18_2018.05.31-3
f7ff72
- Update wireless-regdb to version 2018.05.31
f7ff72
f7ff72
* Fri Jun 01 2018 John W. Linville <linville@redhat.com> - 3.18_2017.12.23-2
f7ff72
- Update URL in package header
f7ff72
f7ff72
* Thu May 31 2018 John W. Linville <linville@redhat.com> - 3.18_2017.12.23-1
f7ff72
- Update crda to version 3.18
f7ff72
- Update wireless-regdb to version 2017.12.23
f7ff72
2da2c8
* Tue Feb 09 2016 John W. Linville <linville@redhat.com> - 3.13_2016.02.08-1
2da2c8
- Update crda to version 3.13
2da2c8
- Update wireless-regdb to version 2016.02.08
2da2c8
2da2c8
* Mon Jan 18 2016 John W. Linville <linville@redhat.com> - 1.1.3_2015.12.14-1
2da2c8
- Update wireless-regdb to version 2015.12.14
2da2c8
5b5f64
* Tue Apr 21 2015 John W. Linville <linville@redhat.com> - 1.1.3_2015.04.06-2
5b5f64
- Update wireless-regdb to version 2015.04.06
5b5f64
- Add patch for regdbdump to display DFS region
5b5f64
- Make some improvements to setregdomain and its man page
5b5f64
3cad05
* Mon Jul 28 2014 John W. Linville <linville@redhat.com> - 1.1.3_2014.06.13-1
3cad05
- Update wireless-regdb to version 2014.06.13
3cad05
- Add logger commands to setregdomain to make it more communicative
3cad05
bc266b
* Fri Feb 28 2014 John W. Linville <linville@redhat.com> - 1.1.3_2013.11.27-5
bc266b
- Accomodate relative pathnames in the symlink for /etc/localtime
bc266b
bc266b
* Mon Feb 10 2014 John W. Linville <linville@redhat.com> - 1.1.3_2013.11.27-4
bc266b
- Correct a typo in setregdomain
bc266b
bc266b
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 1.1.3_2013.11.27-3
bc266b
- Mass rebuild 2014-01-24
bc266b
bc266b
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.1.3_2013.11.27-2
bc266b
- Mass rebuild 2013-12-27
bc266b
bc266b
* Mon Dec  2 2013 John W. Linville <linville@redhat.com> - 1.1.3_2013.11.27-1
bc266b
- Update wireless-regdb to version 2013.11.27
bc266b
bc266b
* Fri Nov 22 2013 Xose Vazquez Perez <xose.vazquez@gmail.com> - 1.1.3_2013.02.13-5
bc266b
- fixed wrong dates
bc266b
- link with libnl3
bc266b
- new home for sources
bc266b
bc266b
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.3_2013.02.13-4
bc266b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
bc266b
bc266b
* Wed Apr  3 2013 John W. Linville <linville@redhat.com> - 1.1.3_2013.02.13-3
bc266b
- setregdomain: remove sed and awk calls
bc266b
- setregdomain: reimplement COUNTRY assignment with shell function
bc266b
d81fc2
* Fri Mar  1 2013 John W. Linville <linville@redhat.com> - 1.1.3_2013.02.13-2
d81fc2
- Bump release to prevent upgrade issues from F17...oops!
d81fc2
d81fc2
* Wed Feb 13 2013 John W. Linville <linville@redhat.com> - 1.1.3_2013.02.13-1
d81fc2
- Update wireless-regdb to version 2013.02.13
d81fc2
d81fc2
* Tue Feb 12 2013 John W. Linville <linville@redhat.com> - 1.1.3_2013.02.12-1
d81fc2
- Update wireless-regdb to version 2013.02.12
d81fc2
bc266b
* Fri Jan 25 2013 John W. Linville <linville@redhat.com> - 1.1.3_2013.01.11-2
d81fc2
- Update setregdomain to determine timezone info from /etc/timezone
d81fc2
bc266b
* Fri Jan 25 2013 John W. Linville <linville@redhat.com> - 1.1.3_2013.01.11-1
d81fc2
- Update crda to version 1.1.3
d81fc2
- Update wireless-regdb to version 2013.01.11
d81fc2
d81fc2
* Fri Aug 10 2012 John W. Linville <linville@redhat.com>
d81fc2
- Add BuildRequires for openssl
d81fc2
d81fc2
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2_2011.04.28-3
d81fc2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
d81fc2
d81fc2
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2_2011.04.28-2
d81fc2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
d81fc2
d81fc2
* Thu Aug 11 2011 John W. Linville <linville@redhat.com> 1.1.2_2011.04.28-1
d81fc2
- Update crda to version 1.1.2
d81fc2
- Update wireless-regdb to version 2011.04.28 
d81fc2
- Fix mis-numbered version comment in changelog for Nov 23 2010
d81fc2
d81fc2
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1_2010.11.22-2
d81fc2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
d81fc2
d81fc2
* Tue Nov 23 2010 John W. Linville <linville@redhat.com> 1.1.1_2010.11.22-1
d81fc2
- Update wireless-regdb to version 2010.11.22 
d81fc2
d81fc2
* Thu Feb 25 2010 John W. Linville <linville@redhat.com> 1.1.1_2009.11.25-3
d81fc2
- Correct license tag from BSD to ISC
d81fc2
- Comment purpose of regulatory-rules-setregdomain.patch
d81fc2
- Add copyright and license statement to setregdomain
d81fc2
- Add comment for why /lib is hardcoded in files section
d81fc2
- Reformat Dec 21 2009 changelog entry so rpmlint stops complaining
d81fc2
d81fc2
* Tue Jan 26 2010 John W. Linville <linville@redhat.com> 1.1.1_2009.11.25-2
d81fc2
- Change RPM_OPT_FLAGS to optflags
d81fc2
- Leave man page compression to rpmbuild
d81fc2
- Correct date in previous changelog entry
d81fc2
d81fc2
* Tue Jan 26 2010 John W. Linville <linville@redhat.com> 1.1.1_2009.11.25-1
d81fc2
- Update for crda version 1.1.1
d81fc2
bc266b
* Mon Dec 21 2009 John W. Linville <linville@redhat.com> 1.1.0_2009.11.25-5
d81fc2
- Remove unnecessary explicit Requries for libgcrypt and libnl -- oops!
d81fc2
bc266b
* Mon Dec 21 2009 John W. Linville <linville@redhat.com> 1.1.0_2009.11.25-4
d81fc2
- Add libgcrypt and libnl to Requires
d81fc2
d81fc2
* Mon Dec 21 2009 John W. Linville <linville@redhat.com> 1.1.0_2009.11.25-3
d81fc2
- Add man page for setregdomain (from Andrew Hecox <ahecox@redhat.com>)
d81fc2
- Change $RPM_BUILD_ROOT to buildroot
d81fc2
d81fc2
* Fri Dec 18 2009 John W. Linville <linville@redhat.com> 1.1.0_2009.11.25-2
d81fc2
- Specify path to iw in setregdomain
d81fc2
d81fc2
* Wed Dec  2 2009 John W. Linville <linville@redhat.com> 1.1.0_2009.11.25-1
d81fc2
- Update wireless-regdb to version 2009.11.25 
d81fc2
d81fc2
* Wed Nov 11 2009 John W. Linville <linville@redhat.com> 1.1.0_2009.11.10-1
d81fc2
- Update wireless-regdb to version 2009.11.10 
d81fc2
bc266b
* Thu Oct  1 2009 John W. Linville <linville@redhat.com> 1.1.0_2009.09.08-3
d81fc2
- Move regdb to /lib/crda to facilitate /usr mounted over wireless network
d81fc2
d81fc2
* Wed Sep  9 2009 John W. Linville <linville@redhat.com> 1.1.0_2009.09.08-2
d81fc2
- Use kernel-headers instead of kernel-devel
d81fc2
d81fc2
* Wed Sep  9 2009 John W. Linville <linville@redhat.com> 1.1.0_2009.09.08-1
d81fc2
- Update wireless-regdb to version 2009.09.08 
d81fc2
- Start resetting release number with version updates
d81fc2
d81fc2
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0_2009.04.17-12
d81fc2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
d81fc2
d81fc2
* Wed May 13 2009 John W. Linville <linville@redhat.com> 1.1.0_2009.04.17-11
d81fc2
- Update crda version to version 1.1.0
d81fc2
- Update wireless-regdb to version 2009.04.17 
d81fc2
d81fc2
* Fri Apr 17 2009 John W. Linville <linville@redhat.com> 1.0.1_2009.04.16-10
d81fc2
- Update wireless-regdb version to pick-up recent updates and fixes (#496392)
d81fc2
d81fc2
* Tue Mar 31 2009 John W. Linville <linville@redhat.com> 1.0.1_2009.03.09-9
d81fc2
- Add Requires line for iw package (#492762)
d81fc2
- Update setregdomain script to correctly check if COUNTRY is set
d81fc2
d81fc2
* Thu Mar 19 2009 John W. Linville <linville@redhat.com> 1.0.1_2009.03.09-8
d81fc2
- Add setregdomain script to set regulatory domain based on timezone
d81fc2
- Expand 85-regulatory.rules to invoke setregdomain script on device add
d81fc2
d81fc2
* Tue Mar 10 2009 John W. Linville <linville@redhat.com> 1.0.1_2009.03.09-7
d81fc2
- Update wireless-regdb version to pick-up recent updates and fixes (#489560)
d81fc2
d81fc2
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1_2009.01.30-6
d81fc2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
d81fc2
d81fc2
* Mon Feb 16 2009 John W. Linville <linville@redhat.com> 1.0.1_2009.01.30-5
d81fc2
- Recognize regulatory.bin files signed with the upstream key (#484982)
d81fc2
d81fc2
* Tue Feb 03 2009 John W. Linville <linville@redhat.com> 1.0.1_2009.01.30-4
d81fc2
- Change version to reflect new wireless-regdb upstream release practices
d81fc2
- Update wireless-regdb version to pick-up recent updates and fixes (#483816)
d81fc2
d81fc2
* Tue Jan 27 2009 John W. Linville <linville@redhat.com> 1.0.1_2009_01_15-3
d81fc2
- Update for CRDA verion 1.0.1
d81fc2
- Account for lack of "v" in upstream release tarball naming
d81fc2
- Add patch to let wireless-regdb install w/o being root
d81fc2
d81fc2
* Thu Jan 22 2009 John W. Linville <linville@redhat.com> v0.9.5_2009_01_15-2
d81fc2
- Revamp based on package review comments
d81fc2
d81fc2
* Tue Jan 20 2009 John W. Linville <linville@redhat.com> v0.9.5_2009_01_15-1
d81fc2
- Initial build