]> git.pld-linux.org Git - packages/madwifi-ng.git/blob - madwifi-ng.spec
0a1181881c9a722c4893129d1f2ee251dc1ad874
[packages/madwifi-ng.git] / madwifi-ng.spec
1 #
2 # TODO:
3 # - kernel header is additional BR  (whatever it means???)
4 # - broken build without kernel
5 #
6 # Conditional build:
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)
12 #
13 %define         snap_year       2012
14 %define         snap_month      01
15 %define         snap_day        31
16 %define         snap            %{snap_year}%{snap_month}%{snap_day}
17 %define         snapdate        %{snap_year}-%{snap_month}-%{snap_day}
18 %define         prel    0.%{snap}.%{rel}
19 %define         trunk   r4177
20
21 %define         rel             71
22
23 %if "%{_alt_kernel}" != "%{nil}"
24 %if %{with kernel}
25 %undefine       with_userspace
26 %endif
27 %endif
28 %if %{with force_userspace}
29 %define         with_userspace 1
30 %endif
31 %if %{without userspace}
32 # nothing to be placed to debuginfo package
33 %define         _enable_debug_packages  0
34 %endif
35
36 %define         pname   madwifi-ng
37 %define         tname   madwifi-trunk
38
39 Summary:        Atheros WiFi card driver
40 Summary(pl.UTF-8):      Sterownik karty radiowej Atheros
41 Name:           %{pname}%{_alt_kernel}
42 Version:        0
43 Release:        %{prel}
44 License:        GPL/BSD (partial source)
45 Group:          Base/Kernel
46 Provides:       madwifi
47 Obsoletes:      madwifi
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/
59 %if %{with kernel}
60 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:3.0.21}
61 BuildRequires:  rpmbuild(macros) >= 1.642
62 %endif
63 ExclusiveArch:  alpha arm %{ix86} %{x8664} mips powerpc ppc sparc sparcv9 sparc64 xscale
64 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65
66 %description
67 Atheros WiFi card driver. Supports Virtual APs and WDS Mode. It uses
68 binary HAL and supports AR5210, AR5211, AR5212, RF5111, RF5112, RF2413
69 and RF5413 cards.
70
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.
75
76 %package devel
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
82
83 %description devel
84 Header files for madwifi.
85
86 %description devel -l pl.UTF-8
87 Pliki nagłówkowe dla madwifi.
88
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}
93 Group:          Base/Kernel
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
99 %endif
100
101 %description -n kernel%{_alt_kernel}-net-madwifi-ng
102 This is driver for Atheros card for Linux.
103
104 This package contains Linux module.
105
106 %description -n kernel%{_alt_kernel}-net-madwifi-ng -l pl.UTF-8
107 Sterownik dla Linuksa do kart Atheros.
108
109 Ten pakiet zawiera moduł jądra Linuksa.
110
111 %prep
112 %setup -q -n %{tname}-%{trunk}-%{snap}
113 # aircrack-ng
114 %patch0 -p1
115 # werror
116 %patch1 -p1
117 # fix - ticket 617
118 %patch2 -p1
119 %patch3 -p1
120 %patch4 -p1
121
122 %build
123 %if %{with userspace}
124 %{__make} -C tools \
125         CC="%{__cc}" \
126         CFLAGS="%{rpmcflags}" \
127         KERNELPATH="%{_kernelsrcdir}"
128 %endif
129
130 %ifarch alpha %{ix86} %{x8664}
131 %define target %{_target_base_arch}-elf
132 %endif
133 %ifarch sparc sparcv9 sparc64
134 %define target %{_target_base_arch}-be-elf
135 %endif
136 %ifarch powerpc ppc
137 %define target powerpc-be-elf
138 %endif
139
140 %if %{with kernel}
141 # kernel module(s)
142
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}
147
148 %define opts TARGET=%{target} KERNELPATH="%{_kernelsrcdir}" TOOLPREFIX= LDFLAGS_MODULE=
149
150 %{__make} %{opts}  svnversion.h
151 %build_kernel_modules -c -m %{modules} %{opts}
152
153 %endif
154
155 %install
156 rm -rf $RPM_BUILD_ROOT
157
158 %if %{with userspace}
159 install -d $RPM_BUILD_ROOT%{_bindir}
160
161 %{__make} install-tools \
162         TARGET=%{target} \
163         KERNELPATH="%{_kernelsrcdir}" \
164         DESTDIR=$RPM_BUILD_ROOT \
165         BINDIR=%{_bindir} \
166         MANDIR=%{_mandir}
167
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
173 %endif
174
175 %if %{with kernel}
176 %install_kernel_modules -m %{modules} -d kernel/net
177 %endif
178
179 %clean
180 rm -rf $RPM_BUILD_ROOT
181
182 %post   -n kernel%{_alt_kernel}-net-madwifi-ng
183 %depmod %{_kernel_ver}
184
185 %postun -n kernel%{_alt_kernel}-net-madwifi-ng
186 %depmod %{_kernel_ver}
187
188 %if %{with userspace}
189 %files
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*
212
213 %files devel
214 %defattr(644,root,root,755)
215 %{_includedir}/madwifi
216 %endif
217
218 %if %{with kernel}
219 %files -n kernel%{_alt_kernel}-net-madwifi-ng
220 %defattr(644,root,root,755)
221 /lib/modules/%{_kernel_ver}/kernel/net/*.ko*
222 %endif
This page took 0.099102 seconds and 2 git commands to generate.