- fix shell syntax
[packages/atmelwlandriver.git] / atmelwlandriver.spec
CommitLineData
231a8dcb 1#
9d138039 2# Conditional build:
674f9078
PS
3%bcond_without dist_kernel # allow non-distribution kernel
4%bcond_without kernel # don't build kernel modules
64bd5734 5%bcond_without up # don't build UP modules
674f9078 6%bcond_without smp # don't build SMP modules
a435a0b1 7%bcond_with unicode # use wx-gtk2-unicode-config instead of ansi
674f9078
PS
8%bcond_without userspace # don't build userspace applications
9%bcond_with verbose # verbose build (V=1)
768f8df6 10
a463ba03 11%if !%{with kernel}
768f8df6
PS
12%undefine with_dist_kernel
13%endif
14
142e3637 15%define _rel 0.9
9d138039 16Summary: Linux driver for WLAN card based on AT76C5XXx
202a6fdb 17Summary(pl.UTF-8): Sterownik dla Linuksa do kart WLAN opartych na układach AT76C5XXx
cb561288 18Name: atmelwlandriver
baa9f5fa 19Version: 3.4.1.1
3a1c7b02 20Release: %{_rel}@%{_kernel_ver_str}
9d138039 21License: GPL v2
22Group: Base/Kernel
57cdb5d1 23Source0: http://dl.sourceforge.net/atmelwlandriver/%{name}-%{version}.tar.bz2
84cf3b44 24# Source0-md5: 6cb3671091c7ccaa646222c50ee242c9
57cdb5d1
JB
25Source1: %{name}-vnetrc
26Patch0: %{name}-makefile.patch
27Patch1: %{name}-etc.patch
82cd6bde
PS
28Patch2: %{name}-usb-api.patch
29Patch3: %{name}-gcc4.patch
30Patch4: %{name}-winter-makefile.patch
a435a0b1
31Patch5: %{name}-fwupgrade.patch
32Patch6: %{name}-cmdline.patch
142e3637
ER
33#Patch2: %{name}-fpmath.patch
34#Patch3: %{name}-delay.patch
35#Patch4: %{name}-usb_defctrl.patch
57cdb5d1 36URL: http://atmelwlandriver.sourceforge.net/
768f8df6 37%if %{with kernel}
82cd6bde 38%if %{with dist_kernel}
142e3637 39BuildRequires: kernel-module-build >= 3:2.6.11
82cd6bde
PS
40BuildRequires: kernel-source >= 2.6.11
41%endif
768f8df6 42BuildRequires: rpmbuild(macros) >= 1.217
9d138039 43%endif
674f9078 44%if %{with userspace}
066c1c1f 45BuildRequires: libusb-devel
9d138039 46BuildRequires: ncurses-devel
c364d4cc 47BuildRequires: ncurses-ext-devel
dc334aff 48BuildRequires: wxGTK2-%{?with_unicode:unicode-}devel >= 2.6.0
9d138039 49%endif
50Requires: wireless-tools
9d138039 51BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53%description
54This is driver for WLAN card based on ATMEL AT76C5XXx devices for
55Linux.
56
9b4cae37
JR
57%description -l pl.UTF-8
58Sterownik dla Linuksa do kart sieci bezprzewodowych opartych o układy
9d138039 59ATMELA AT76C5XXx.
60
57cdb5d1 61%package -n kernel-net-atmelwlandriver
9d138039 62Summary: Linux driver for WLAN card based on AT76C5XXx
202a6fdb 63Summary(pl.UTF-8): Sterownik dla Linuksa do kart WLAN na układach AT76C5XXx
3a1c7b02 64Release: %{_rel}@%{_kernel_ver_str}
9d138039 65Group: Base/Kernel
9d138039 66Requires(post,postun): /sbin/depmod
768f8df6
PS
67%if %{with dist_kernel}
68%requires_releq_kernel_up
69Requires(postun): %releq_kernel_up
70%endif
3a1c7b02 71Provides: kernel-net(atmelwlandriver) = %{version}
9d138039 72
57cdb5d1 73%description -n kernel-net-atmelwlandriver
9d138039 74This is driver for WLAN card based on ATMEL AT76C5XXx devices for
75Linux.
76
9b4cae37
JR
77%description -n kernel-net-atmelwlandriver -l pl.UTF-8
78Sterownik dla Linuksa do kart sieci bezprzewodowych opartych o układy
9d138039 79ATMELA AT76C5XXx.
80
57cdb5d1
JB
81%package -n kernel-smp-net-atmelwlandriver
82Summary: Linux SMP driver for WLAN card based on AT76C5XXx
202a6fdb 83Summary(pl.UTF-8): Sterownik dla Linuksa SMP do kart WLAN na układach AT76C5XXx
57cdb5d1
JB
84Release: %{_rel}@%{_kernel_ver_str}
85Group: Base/Kernel
57cdb5d1 86Requires(post,postun): /sbin/depmod
768f8df6
PS
87%if %{with dist_kernel}
88%requires_releq_kernel_smp
89Requires(postun): %releq_kernel_smp
90%endif
57cdb5d1
JB
91Provides: kernel-net(atmelwlandriver) = %{version}
92
93%description -n kernel-smp-net-atmelwlandriver
94This is driver for WLAN card based on ATMEL AT76C5XXx devices for
95Linux SMP.
96
9b4cae37 97%description -n kernel-smp-net-atmelwlandriver -l pl.UTF-8
57cdb5d1 98Sterownik dla Linuksa SMP do kart sieci bezprzewodowych opartych o
9b4cae37 99układy ATMELA AT76C5XXx.
57cdb5d1
JB
100
101%package tools
8113162e 102Summary: Command line tools for managing ATMEL Wireless Card
202a6fdb 103Summary(pl.UTF-8): Narzędzia linii poleceń do obsługi bezprzewodowych kart ATMEL
3a1c7b02 104Release: %{_rel}
9d138039 105Group: Networking/Utilities
3a1c7b02 106Requires: kernel-net(atmelwlandriver) = %{version}
9d138039 107
57cdb5d1 108%description tools
0392bf5c 109Managing tools for the ATMEL Wireless Card adapters. When the PCMCIA
110module pcmf502*, the PCI module pcifvnet, or the USB module usbvnet*
8113162e 111is loaded the lvnet application can monitor the device's statistics or
112change it's runtime parameters.
9d138039 113
9b4cae37
JR
114%description tools -l pl.UTF-8
115Narzędzia do obsługi dla adapterów kart sieci bezprzewodowych ATMEL.
116Kiedy moduł PCMCIA pcmf502*, moduł PCI pcifvnet, albo moduł USB
117usbvnet* jest załadowany to aplikacja lvnet może monitorować dane
118statystyczne urządzenia albo zmienić parametry jego pracy.
8113162e 119
120%package winter
121Summary: Graphical tool for monitoring ATMEL Wireless Cards
202a6fdb 122Summary(pl.UTF-8): Graficzne narzędzie do monitorowania bezprzewodowych kart ATMEL
8113162e 123Release: %{_rel}
124Group: Networking/Utilities
125Requires: kernel-net(atmelwlandriver) = %{version}
126
127%description winter
eb9d9945 128Winter is an X application, that provides a visual environment to
8113162e 129configure and manage ATMEL cards. It's functionality is similar to
130that of lvnet, extended by very useful features such as profiles,
131localization and support for more than one devices alternatively.
132
9b4cae37
JR
133%description winter -l pl.UTF-8
134Winter jest aplikacją dla X, która dostarcza wizualne środowisko
135pozwalające na konfigurację kart ATMELa. Jego funkcjonalność jest
136podobna do tej jaką ma lvnet, dodatkowo rozszerzoną o bardzo przydatne
137funkcje takie jak: profile, lokalizacje i wsparcie dla więcej niż
138jednego urządzenia.
9d138039 139
f2febca1 140%package fucd
141Summary: Firmware upgrade tool for ATMEL Wireless Cards
202a6fdb 142Summary(pl.UTF-8): Narzędzie aktualizacji bezprzewodowych kart ATMEL
f2febca1 143Release: %{_rel}
144Group: Networking/Utilities
145Requires: kernel-net(atmelwlandriver) = %{version}
146
147%description fucd
148Graphical firmware upgrade tool for ATMEL Wireless Cards.
149
9b4cae37
JR
150%description fucd -l pl.UTF-8
151Narzędzie do aktualizacji wewnętrznego oprogramowania bezprzewodowych
f2febca1 152kart ATMELa.
153
9d138039 154%prep
a38a8e66 155%setup -q -n %{name}
11d6fba2 156%patch0 -p1
9d138039 157%patch1 -p1
82cd6bde
PS
158%patch2 -p1
159%patch3 -p1
160%patch4 -p1
a435a0b1
161%patch5 -p1
162%patch6 -p1
9d138039 163
11d6fba2 164ln -sf Makefile.kernelv2.6 Makefile
48eb0125 165
a116edbf 166%build
48eb0125
PS
167%if %{with kernel}
168# kernel module(s)
674f9078
PS
169rm -rf built
170mkdir -p built/{nondist,smp,up}
48eb0125 171for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
c4b574db 172 if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
173 exit 1
174 fi
175 rm -rf include
4efa67b0 176 install -d o/include/{linux,config}
177 ln -sf %{_kernelsrcdir}/config-$cfg o/.config
178 ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
179 ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
180
181%if %{with dist_kernel}
cab3bd8e 182 %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
4efa67b0 183%else
184 install -d o/include/config
185 touch o/include/config/MARKER
186 ln -sf %{_kernelsrcdir}/scripts o/scripts
187%endif
768f8df6 188
c4b574db 189 %{__make} -C %{_kernelsrcdir} clean \
190 RCS_FIND_IGNORE="-name '*.ko' -o" \
4efa67b0 191 M=$PWD O=$PWD/o \
c4b574db 192 %{?with_verbose:V=1}
193 %{__make} pcmcia buildonly=release \
194 KERNEL_VERSION=%{__kernel_ver} \
4efa67b0 195 M=$PWD O=$PWD/o \
c4b574db 196 %{?with_verbose:V=1}
197 %{__make} usb buildonly=release \
198 KERNEL_VERSION=%{__kernel_ver} \
4efa67b0 199 M=$PWD O=$PWD/o \
c4b574db 200 %{?with_verbose:V=1}
768f8df6 201
c4b574db 202 mv -f objs/*/release/*.ko built/$cfg
48eb0125 203done
9d138039 204%endif
205
674f9078 206%if %{with userspace}
064b9d89 207%{__make} winter \
a435a0b1 208 OPT="%{rpmcflags}" \
67ca66f8 209 WXCONFIG="wx-gtk2-%{?with_unicode:unicode}%{!?with_unicode:ansi}-config"
3a1c7b02 210
231a8dcb 211%{__make} lvnet \
a435a0b1 212 OPT="%{rpmcflags} %{rpmldflags}" \
4efa67b0 213 INCDIR=%{_includedir} \
2b96ce30
PS
214
215%{__make} -C src/apps/fw-upgrade atmelup \
a38a8e66 216 CCC="%{__cc}" \
a435a0b1 217 CCFLAGS="%{rpmcflags}" \
67ca66f8 218 WXCONFIG="wx-gtk2-%{?with_unicode:unicode}%{!?with_unicode:ansi}-config"
f2febca1 219
220%{__make} -C src/apps/fw-upgrade fucd \
a435a0b1 221 OPT="%{rpmcflags}" \
67ca66f8 222 WXCONFIG="wx-gtk2-%{?with_unicode:unicode}%{!?with_unicode:ansi}-config"
674f9078 223%endif
9d138039 224
225%install
226rm -rf $RPM_BUILD_ROOT
dd9e7aef 227install -d $RPM_BUILD_ROOT%{_sbindir}
9d138039 228
3a1c7b02
PS
229%if %{with kernel}
230cd built
231install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/kernel/drivers/{net/pcmcia,usb/net}
232install %{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}/pcm* \
233 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/net/pcmcia
234install %{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}/usb* \
235 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/usb/net
236%if %{with smp} && %{with dist_kernel}
237install smp/pcm* \
238 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/pcmcia
239install smp/usb* \
240 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/usb/net
241%endif
242cd -
dd9e7aef
JK
243install -d $RPM_BUILD_ROOT%{_sysconfdir}/pcmcia
244cp scripts/atmel.conf $RPM_BUILD_ROOT%{_sysconfdir}/pcmcia
245cp scripts/fastvnet.sh $RPM_BUILD_ROOT%{_sbindir}
c364d4cc 246install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/vnetrc
3a1c7b02 247%endif
9d138039 248
dd9e7aef
JK
249%if %{with userspace}
250install -d $RPM_BUILD_ROOT%{_mandir}/man1
dd9e7aef 251install man/lvnet.1 $RPM_BUILD_ROOT%{_mandir}/man1
2b96ce30 252install src/apps/fw-upgrade/atmelup $RPM_BUILD_ROOT%{_sbindir}
dd9e7aef 253install src/apps/cmd_line/lvnet $RPM_BUILD_ROOT%{_sbindir}
064b9d89 254install objs/winter $RPM_BUILD_ROOT%{_sbindir}
f2febca1 255install src/apps/fw-upgrade/fucd $RPM_BUILD_ROOT%{_sbindir}
dd9e7aef 256%endif
9d138039 257
258%clean
259rm -rf $RPM_BUILD_ROOT
260
57cdb5d1 261%post -n kernel-net-atmelwlandriver
9d138039 262%depmod %{_kernel_ver}
263
57cdb5d1 264%postun -n kernel-net-atmelwlandriver
9d138039 265%depmod %{_kernel_ver}
266
267%post -n kernel-smp-net-atmelwlandriver
9d138039 268%depmod %{_kernel_ver}smp
269
270%postun -n kernel-smp-net-atmelwlandriver
271%depmod %{_kernel_ver}smp
272
3a1c7b02 273%if %{with kernel}
64bd5734 274%if %{with up} || %{without dist_kernel}
57cdb5d1 275%files -n kernel-net-atmelwlandriver
9d138039 276%defattr(644,root,root,755)
9d138039 277%doc CHANGES README
a38a8e66
ER
278%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pcmcia/atmel.conf
279%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vnetrc
dd9e7aef 280%attr(755,root,root) %{_sbindir}/fastvnet.sh
3a1c7b02
PS
281/lib/modules/%{_kernel_ver}/kernel/drivers/net/pcmcia/*.ko*
282/lib/modules/%{_kernel_ver}/kernel/drivers/usb/net/*.ko*
64bd5734 283%endif
9d138039 284
3a1c7b02 285%if %{with smp} && %{with dist_kernel}
9d138039 286%files -n kernel-smp-net-atmelwlandriver
287%defattr(644,root,root,755)
9d138039 288%doc CHANGES README
a38a8e66
ER
289%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pcmcia/atmel.conf
290%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vnetrc
dd9e7aef 291%attr(755,root,root) %{_sbindir}/fastvnet.sh
3a1c7b02
PS
292/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/pcmcia/*.ko*
293/lib/modules/%{_kernel_ver}smp/kernel/drivers/usb/net/*.ko*
294%endif
9d138039 295%endif
296
674f9078 297%if %{with userspace}
57cdb5d1 298%files tools
9d138039 299%defattr(644,root,root,755)
2b96ce30 300%attr(755,root,root) %{_sbindir}/atmelup
dd9e7aef 301%attr(755,root,root) %{_sbindir}/lvnet
9d138039 302%{_mandir}/man1/*
8113162e 303
304%files winter
305%defattr(644,root,root,755)
306%doc src/apps/winter/README.linux
307%attr(755,root,root) %{_sbindir}/winter
f2febca1 308
309%files fucd
310%defattr(644,root,root,755)
311%attr(755,root,root) %{_sbindir}/fucd
9d138039 312%endif
This page took 0.128466 seconds and 4 git commands to generate.