Blob Blame Raw
%define         crda_version    1.0.1
%define         regdb_version   2009.01.30

Name:           crda
Version:        %{crda_version}_%{regdb_version}
Release:        5%{?dist}
Summary:        Regulatory compliance daemon for 802.11 wireless networking

Group:          System Environment/Base
License:        BSD
URL:            http://www.linuxwireless.org/en/developers/Regulatory/CRDA
BuildRoot:      %{_tmppath}/%{name}-%{crda_version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  kernel-devel >= 2.6.27
BuildRequires:  libnl-devel >= 1.1
BuildRequires:  libgcrypt-devel
BuildRequires:  pkgconfig python m2crypto

Requires:       udev

Source0:        http://wireless.kernel.org/download/crda/crda-%{crda_version}.tar.bz2
Source1:        http://wireless.kernel.org/download/wireless-regdb/wireless-regdb-%{regdb_version}.tar.bz2

Patch0:         wireless-regdb-2009.01.30-non-root-install-fix.patch

%description
CRDA acts as the udev helper for communication between the kernel
and userspace for regulatory compliance. It relies on nl80211
for communication. CRDA is intended to be run only through udev
communication from the kernel.

%prep
%setup -q -c
%setup -q -T -D -a 1

%patch0 -p0


%build

# Use our own signing key to generate regulatory.bin
cd wireless-regdb-%{regdb_version}

make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" maintainer-clean
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" key.priv.pem
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"

# Build CRDA using the new key and regulatory.bin from above
cd ../crda-%{crda_version}
cp ../wireless-regdb-%{regdb_version}/key.pub.pem pubkeys

make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" REG_BIN=../wireless-regdb-%{regdb_version}/regulatory.bin


%install
rm -rf $RPM_BUILD_ROOT

cd crda-%{crda_version}
cp README README.crda
make install DESTDIR=$RPM_BUILD_ROOT

cd ../wireless-regdb-%{regdb_version}
cp README README.wireless-regdb
make install PREFIX=${RPM_BUILD_ROOT}/usr


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
/sbin/%{name}
/sbin/regdbdump
/lib/udev/rules.d/85-regulatory.rules
/usr/lib/%{name}
%{_mandir}/man5/regulatory.bin.5.gz
%{_mandir}/man8/crda.8.gz
%{_mandir}/man8/regdbdump.8.gz
%doc crda-%{crda_version}/LICENSE crda-%{crda_version}/README.crda
%doc wireless-regdb-%{regdb_version}/README.wireless-regdb

%changelog
* Mon Feb 16 2009 John W. Linville <linville@redhat.com> 1.0.1_2009.01.30-5
- Recognize regulatory.bin files signed with the upstream key (#484982)

* Tue Feb 03 2009 John W. Linville <linville@redhat.com> 1.0.1_2009.01.30-4
- Change version to reflect new wireless-regdb upstream release practices
- Update wireless-regdb version to pick-up recent updates and fixes (#483816)

* Tue Jan 27 2009 John W. Linville <linville@redhat.com> 1.0.1_2009_01_15-3
- Update for CRDA verion 1.0.1
- Account for lack of "v" in upstream release tarball naming
- Add patch to let wireless-regdb install w/o being root

* Thu Jan 22 2009 John W. Linville <linville@redhat.com> v0.9.5_2009_01_15-2
- Revamp based on package review comments

* Tue Jan 20 2009 John W. Linville <linville@redhat.com> v0.9.5_2009_01_15-1
- Initial build