Blob Blame Raw
%define         crda_version    1.0.1
%define         regdb_version   2009-01-15

Name:           crda
Version:        %{crda_version}_%(echo %{regdb_version} | sed -e 's/-/_/g')
Release:        3%{?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-15-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

rm crda-%{crda_version}/pubkeys/*


%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}
/usr/share/man/man8/crda.8.gz
/usr/share/man/man8/regdbdump.8.gz
%doc crda-%{crda_version}/LICENSE crda-%{crda_version}/README.crda
%doc wireless-regdb-%{regdb_version}/README.wireless-regdb

%changelog
* Tue Jan 27 2008 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 2008 John W. Linville <linville@redhat.com> v0.9.5_2009_01_15-2
- Revamp based on package review comments

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