1 # Marc E. Fiuczynski <mef@cs.princeton.edu>
2 # Thierry Parmentelat <thierry.parmentelat@inria.fr>
3 # Copyright (C) 2006 The Trustees of Princeton University
7 # This specfile has additions so it can build against a stock-fedora kernel
8 # (see the section that defines 'percent' below)
9 # However this is not used, since we use the stock fedora kernel starting with f16
10 # which provides for the atheros drivers as part of the kernel rpm already
11 # also, the release of madwifi for which this addition was made (20100921)
12 # does not seem to build against the stock fedora kernel anyway
15 # kernel_release, kernel_version and kernel_arch are expected to be set by the build to e.g.
16 # kernel_release : 24.onelab (24 is then the planetlab taglevel)
17 # kernel_version : 2.6.27.57 | 2.6.32 (57 in the 27 case is the patch level)
18 # kernel_arch : i686 | x86_64
24 %define actual_name %{name}-trunk-r%{version}-20100921
26 # when no planetlab kernel is being built, kernel_version is defined but empty
27 %define _with_planetlab_kernel %{?kernel_version:1}%{!?kernel_version:0}
28 # we need to make sure that this rpm gets upgraded when the kernel release changes
29 %if %{_with_planetlab_kernel}
30 # with the planetlab kernel
31 %define pl_kernel_taglevel %( echo %{kernel_release} | cut -d. -f1 )
32 %define madwifi_release %{kernel_version}.%{pl_kernel_taglevel}
34 # with the stock kernel
36 #%define madwifi_release %( rpm -q --qf "%{version}" kernel-headers )
37 # causes recursive macro definition no matter how much you quote
41 %define kernel_version %( rpm -q --qf %{percent}%{braop}version%{bracl} kernel-headers )
42 %define kernel_release %( rpm -q --qf %{percent}%{braop}release%{bracl} kernel-headers )
43 %define kernel_arch %( rpm -q --qf %{percent}%{braop}arch%{bracl} kernel-headers )
44 %define madwifi_release %{kernel_version}.%{kernel_release}
47 %define release %{madwifi_release}.%{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
49 # guess which convention is used; k27 and before used dash, k32 uses dot
50 %define kernelpath_dash /usr/src/kernels/%{kernel_version}-%{kernel_release}-%{kernel_arch}
51 %define kernelpath_dot /usr/src/kernels/%{kernel_version}-%{kernel_release}.%{kernel_arch}
52 %define kernelpath %( [ -d %{kernelpath_dot} ] && echo %{kernelpath_dot} || echo %{kernelpath_dash} )
54 # the k32 kernel currently builds e.g. /lib/modules/2.6.32-0.onelab.2010.12.07-i686
55 # the k27 and before does not have the -i686 part
56 %define kernel_id_old %{kernel_version}-%{kernel_release}
57 %define kernel_id_new %{kernel_version}-%{kernel_release}.%{kernel_arch}
58 %define kernel_id %( [ -d %{kernelpath_dot} ] && echo %{kernel_id_new} || echo %{kernel_id_old} )
60 Summary: madwifi Atheros driver
65 Group: System Environment/Kernel
66 Source0: %{actual_name}.tar.gz
67 Source1: ifup-pre-local
68 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
71 Packager: PlanetLab <devel@planet-lab.org>
72 Distribution: PlanetLab %{plrelease}
75 Requires: kernel = %{kernel_version}-%{kernel_release}
79 madwifi is a new generation driver for the Atheros chipset
82 %setup -n %{actual_name}
85 rm -rf $RPM_BUILD_ROOT
87 %__make KERNELPATH=%kernelpath clean
88 %__make KERNELPATH=%kernelpath
91 rm -fr $RPM_BUILD_ROOT
93 echo 'r' | %__make KERNELPATH=%kernelpath BINDIR=/sbin MANDIR=%{_mandir} DESTDIR=$RPM_BUILD_ROOT install
94 install -D -m 755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/ifup-pre-local
96 # Remove depmod files, will be regenerated in %post
97 rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_id}/modules.*
100 rm -rf $RPM_BUILD_ROOT
103 %defattr(-,root,root)
104 %dir /lib/modules/%{kernel_id}
105 /lib/modules/%{kernel_id}/net/ath_hal.ko
106 /lib/modules/%{kernel_id}/net/ath_pci.ko
107 /lib/modules/%{kernel_id}/net/ath_rate_sample.ko
108 /lib/modules/%{kernel_id}/net/ath_rate_amrr.ko
109 /lib/modules/%{kernel_id}/net/ath_rate_onoe.ko
110 /lib/modules/%{kernel_id}/net/wlan.ko
111 /lib/modules/%{kernel_id}/net/wlan_acl.ko
112 /lib/modules/%{kernel_id}/net/wlan_ccmp.ko
113 /lib/modules/%{kernel_id}/net/wlan_scan_ap.ko
114 /lib/modules/%{kernel_id}/net/wlan_scan_sta.ko
115 /lib/modules/%{kernel_id}/net/wlan_tkip.ko
116 /lib/modules/%{kernel_id}/net/wlan_wep.ko
117 /lib/modules/%{kernel_id}/net/wlan_xauth.ko
118 /lib/modules/%{kernel_id}/net/ath_rate_minstrel.ko
131 %{_mandir}/man8/80211debug.8*
132 %{_mandir}/man8/80211stats.8*
133 %{_mandir}/man8/athchans.8*
134 %{_mandir}/man8/athctrl.8*
135 %{_mandir}/man8/athdebug.8*
136 %{_mandir}/man8/athkey.8*
137 %{_mandir}/man8/athstats.8*
138 %{_mandir}/man8/wlanconfig.8*
139 %{_mandir}/man8/ath_info.8*
143 depmod -a %{kernel_id} >/dev/null 2>&1 || :
150 # 0 = erase, 1 = upgrade
151 if [ $1 -eq 0 ] ; then
152 dir=/lib/modules/%{kernel_id}
153 # If we were the only module installed, remove the module dependencies
154 if [ ! -d $dir/kernel ] ; then
155 [ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --rmmoddep --remove %{kernel_id}
157 depmod -a %{kernel_id} >/dev/null 2>&1 || :
162 * Mon Jan 30 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - madwifi-4132-5
163 - search third-party in dual location
165 * Mon Oct 24 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - madwifi-4132-4
166 - for building against k32 on f8
168 * Sun Oct 02 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - madwifi-4132-3
169 - rpm version number has the kernel taglevel embedded
171 * Sun Jan 23 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - madwifi-4132-2
172 - build tweaked for k32
174 * Thu Oct 02 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - madwifi-0.9.4-2
175 - specfile adjustments for 0.9.4
177 * Tue Dec 04 2007 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
178 - updated to build against kernel-devel
180 * Mon Apr 16 2007 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
181 - imported 0.9.3, re-used Marcs spec file
183 * Fri Dec 01 2006 Marc E. Fiuczynski <mef@cs.princeton.edu>