3 # - kernel header is additional BR (whatever it means???)
4 # - broken build without kernel
7 %bcond_without dist_kernel # allow non-distribution kernel
8 %bcond_without kernel # don't build kernel modules
9 %bcond_without userspace # don't build userspace module
10 %bcond_with force_userspace # force userspace build (useful if alt_kernel is set)
11 %bcond_with verbose # verbose build (V=1)
13 %define snap_year 2012
16 %define snap %{snap_year}%{snap_month}%{snap_day}
17 %define snapdate %{snap_year}-%{snap_month}-%{snap_day}
18 %define prel 0.%{snap}.%{rel}
23 %if "%{_alt_kernel}" != "%{nil}"
25 %undefine with_userspace
28 %if %{with force_userspace}
29 %define with_userspace 1
31 %if %{without userspace}
32 # nothing to be placed to debuginfo package
33 %define _enable_debug_packages 0
36 %define pname madwifi-ng
37 %define tname madwifi-trunk
39 Summary: Atheros WiFi card driver
40 Summary(pl.UTF-8): Sterownik karty radiowej Atheros
41 Name: %{pname}%{_alt_kernel}
44 License: GPL/BSD (partial source)
48 Source0: http://snapshots.madwifi-project.org/madwifi-trunk/%{tname}-%{trunk}-%{snap}.tar.gz
49 # Source0-md5: 10da9c87bce17879ee660a32cbf9cc83
50 # http://patches.aircrack-ng.org/madwifi-ng-r4073.patch
51 Patch0: %{pname}-r4073.patch
52 # needed when build against (more noisy) pax enabled kernel
53 Patch1: %{pname}-makefile-werror.patch
54 # http://madwifi-project.org/ticket/617
55 Patch2: %{pname}-ticket-617.patch
56 Patch3: %{pname}-ieee80211-skb-update.patch
57 Patch4: format-security.patch
58 URL: http://madwifi-project.org/
60 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:3.0.21}
61 BuildRequires: rpmbuild(macros) >= 1.642
63 ExclusiveArch: alpha arm %{ix86} %{x8664} mips powerpc ppc sparc sparcv9 sparc64 xscale
64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 Atheros WiFi card driver. Supports Virtual APs and WDS Mode. It uses
68 binary HAL and supports AR5210, AR5211, AR5212, RF5111, RF5112, RF2413
71 %description -l pl.UTF-8
72 Sterownik karty radiowej Atheros. Wspiera tryb wirtualnego AP oraz
73 tryb WDS. Używa binarnej wersji HAL i obsługuje karty z układami
74 AR5210, AR5211, AR5212, RF5111, RF5112, RF2413 i RF5413.
77 Summary: Header files for madwifi
78 Summary(pl.UTF-8): Pliki nagłówkowe dla madwifi
79 Group: Development/Libraries
80 Provides: madwifi-devel
81 Obsoletes: madwifi-devel
84 Header files for madwifi.
86 %description devel -l pl.UTF-8
87 Pliki nagłówkowe dla madwifi.
89 %package -n kernel%{_alt_kernel}-net-madwifi-ng
90 Summary: Linux driver for Atheros cards
91 Summary(pl.UTF-8): Sterownik dla Linuksa do kart Atheros
92 Release: %{prel}@%{_kernel_ver_str}
94 Requires(post,postun): /sbin/depmod
95 %if %{with dist_kernel}
96 %requires_releq_kernel
97 Requires(postun): %releq_kernel
98 Obsoletes: kernel-smp-net-madwifi-ng
101 %description -n kernel%{_alt_kernel}-net-madwifi-ng
102 This is driver for Atheros card for Linux.
104 This package contains Linux module.
106 %description -n kernel%{_alt_kernel}-net-madwifi-ng -l pl.UTF-8
107 Sterownik dla Linuksa do kart Atheros.
109 Ten pakiet zawiera moduł jądra Linuksa.
112 %setup -q -n %{tname}-%{trunk}-%{snap}
123 %if %{with userspace}
126 CFLAGS="%{rpmcflags}" \
127 KERNELPATH="%{_kernelsrcdir}"
130 %ifarch alpha %{ix86} %{x8664}
131 %define target %{_target_base_arch}-elf
133 %ifarch sparc sparcv9 sparc64
134 %define target %{_target_base_arch}-be-elf
137 %define target powerpc-be-elf
143 # default is ath_rate_sample now compiles, _onoe does not
144 %define modules_ath ath/ath_pci,ath_hal/ath_hal,ath_rate/sample/ath_rate_sample
145 %define modules_wlan net80211/wlan,net80211/wlan_{wep,xauth,acl,ccmp,tkip,scan_{ap,sta}}
146 %define modules %{modules_ath},%{modules_wlan}
148 %define opts TARGET=%{target} KERNELPATH="%{_kernelsrcdir}" TOOLPREFIX= LDFLAGS_MODULE=
150 %{__make} %{opts} svnversion.h
151 %build_kernel_modules -c -m %{modules} %{opts}
156 rm -rf $RPM_BUILD_ROOT
158 %if %{with userspace}
159 install -d $RPM_BUILD_ROOT%{_bindir}
161 %{__make} install-tools \
163 KERNELPATH="%{_kernelsrcdir}" \
164 DESTDIR=$RPM_BUILD_ROOT \
168 install -d $RPM_BUILD_ROOT%{_includedir}/madwifi/net80211
169 install -d $RPM_BUILD_ROOT%{_includedir}/madwifi/include/sys
170 install net80211/*.h $RPM_BUILD_ROOT%{_includedir}/madwifi/net80211
171 install include/*.h $RPM_BUILD_ROOT%{_includedir}/madwifi/include
172 install include/sys/*.h $RPM_BUILD_ROOT%{_includedir}/madwifi/include/sys
176 %install_kernel_modules -m %{modules} -d kernel/net
180 rm -rf $RPM_BUILD_ROOT
182 %post -n kernel%{_alt_kernel}-net-madwifi-ng
183 %depmod %{_kernel_ver}
185 %postun -n kernel%{_alt_kernel}-net-madwifi-ng
186 %depmod %{_kernel_ver}
188 %if %{with userspace}
190 %defattr(644,root,root,755)
191 %doc COPYRIGHT README
192 %attr(755,root,root) %{_bindir}/80211debug
193 %attr(755,root,root) %{_bindir}/80211stats
194 %attr(755,root,root) %{_bindir}/ath_info
195 %attr(755,root,root) %{_bindir}/athchans
196 %attr(755,root,root) %{_bindir}/athctrl
197 %attr(755,root,root) %{_bindir}/athdebug
198 %attr(755,root,root) %{_bindir}/athkey
199 %attr(755,root,root) %{_bindir}/athstats
200 %attr(755,root,root) %{_bindir}/madwifi-unload
201 %attr(755,root,root) %{_bindir}/wlanconfig
202 %attr(755,root,root) %{_bindir}/wpakey
203 %{_mandir}/man8/80211debug.8*
204 %{_mandir}/man8/80211stats.8*
205 %{_mandir}/man8/ath_info.8*
206 %{_mandir}/man8/athchans.8*
207 %{_mandir}/man8/athctrl.8*
208 %{_mandir}/man8/athdebug.8*
209 %{_mandir}/man8/athkey.8*
210 %{_mandir}/man8/athstats.8*
211 %{_mandir}/man8/wlanconfig.8*
214 %defattr(644,root,root,755)
215 %{_includedir}/madwifi
219 %files -n kernel%{_alt_kernel}-net-madwifi-ng
220 %defattr(644,root,root,755)
221 /lib/modules/%{_kernel_ver}/kernel/net/*.ko*