- fix building with kerbel 4.11
[packages/wl.git] / wl.spec
1 # Conditional build:
2 %bcond_without  kernel          # don't build kernel modules
3 %bcond_with     verbose         # verbose build (V=1)
4 %bcond_without  userspace       # don't build userspace programs
5 %bcond_without  dkms            # build dkms package
6
7 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
8 %{error:kernel and userspace cannot be built at the same time on PLD builders}
9 exit 1
10 %endif
11
12 %if %{without userspace}
13 %undefine       with_dkms
14 %endif
15
16 # nothing to be placed to debuginfo package
17 %define         _enable_debug_packages  0
18
19 %define         _duplicate_files_terminate_build        0
20
21 %define         rel     6
22 %define         pname   wl
23 %define         file_ver        %(echo %{version} | tr . _)
24 Summary:        Broadcom 802.11 a/b/g/n hybrid Linux networking device driver
25 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
26 Version:        6.30.223.271
27 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
28 License:        other
29 Group:          Base/Kernel
30 Source0:        http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-%{file_ver}.tar.gz
31 # Source0-md5:  4e75f4cb7d87f690f9659ffc478495f0
32 Source1:        http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-%{file_ver}.tar.gz
33 # Source1-md5:  115903050c41d466161784d4c843f4f9
34 Source2:        http://www.broadcom.com/docs/linux_sta/README.txt
35 # Source2-md5:  8a6e8708a5e00ab6d841cde51d70eb1b
36 Source3:        dkms.conf
37 Source4:        modprobe.conf
38 Patch0:         13-broadcom-sta-6.30.223.248-linux-3.18-null-pointer-crash.patch
39 Patch1:         gcc-4.9.patch
40 Patch2:         no-dead-code.patch
41 Patch3:         linux-4.7.patch
42 Patch4:         linux-4.8.patch
43 Patch5:         17-fix-kernel-warnings.patch
44 Patch6:         linux-4.11.patch
45 URL:            http://www.broadcom.com/support/802.11
46 BuildRequires:  rpmbuild(macros) >= 1.701
47 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
48 ExclusiveArch:  %{ix86} %{x8664} x32
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %description
52 These packages contain Broadcom's IEEE 802.11a/b/g/n hybrid Linux
53 device driver for use with Broadcom's BCM4311-, BCM4312-, BCM4313-,
54 BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and
55 BCM43228-based hardware.
56
57 This is an Official Release of Broadcom's hybrid Linux driver for use
58 with Broadcom based hardware.
59
60 %package -n dkms-%{pname}
61 Summary:        DKMS-ready driver for Broadcom WL driver
62 Group:          Base/Kernel
63 Release:        %{rel}
64 Requires(pre):  dkms
65 Requires(post): dkms
66 %if "%{_rpmversion}" >= "5"
67 BuildArch:      noarch
68 %endif
69
70 %description -n dkms-%{pname}
71 This package contains a DKMS-ready driver for Broadcom WL driver.
72
73 %define kernel_pkg()\
74 %package -n kernel%{_alt_kernel}-net-wl\
75 Summary:        Broadcom 802.11 a/b/g/n hybrid Linux networking device driver\
76 Release:        %{rel}@%{_kernel_ver_str}\
77 Group:          Base/Kernel\
78 Requires(post,postun):  /sbin/depmod\
79 %requires_releq_kernel\
80 Requires(postun):       %releq_kernel\
81 \
82 %description -n kernel%{_alt_kernel}-net-wl\
83 These packages contain Broadcom's IEEE 802.11a/b/g/n hybrid Linux\
84 device driver for use with Broadcom's BCM4311-, BCM4312-, BCM4313-,\
85 BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and\
86 BCM43228-based hardware.\
87 \
88 This is an Official Release of Broadcom's hybrid Linux driver for use\
89 with Broadcom based hardware.\
90 \
91 %files -n kernel%{_alt_kernel}-net-wl\
92 %defattr(644,root,root,755)\
93 %doc wl/lib/LICENSE.txt README.txt\
94 /lib/modules/%{_kernel_ver}/kernel/drivers/net/wireless/*.ko*\
95 %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/%{pname}.conf\
96 \
97 %post -n kernel%{_alt_kernel}-net-wl\
98 %depmod %{_kernel_ver}\
99 \
100 %posttrans -n kernel%{_alt_kernel}-net-wl\
101 %banner -e kernel%{_alt_kernel}-net-wl <<EOF\
102 WARNING! This kernel module is not GPL licensed.\
103 Before using it be sure to accept license: %{_docdir}/kernel%{_alt_kernel}-net-wl-%{version}/LICENSE.txt*\
104 EOF\
105 \
106 %postun -n kernel%{_alt_kernel}-net-wl\
107 %depmod %{_kernel_ver}\
108 %{nil}
109
110 %define build_kernel_pkg()\
111 %{__make} -C wl KERNELRELEASE=%{_kernel_ver} KBUILD_DIR=%{_kernelsrcdir} clean\
112 %{__make} -C wl KERNELRELEASE=%{_kernel_ver} KBUILD_DIR=%{_kernelsrcdir}\
113 %install_kernel_modules -D installed -m wl/wl -d kernel/drivers/net/wireless\
114 %{nil}
115
116 %{?with_kernel:%{expand:%create_kernel_packages}}
117
118 %prep
119 %ifarch %{x8664} x32
120 %define src 1
121 %else
122 %define src 0
123 %endif
124 %setup -c -T -q -n %{pname}-%{version} -b%{src}
125 %patch0 -p1
126 %patch1 -p1
127 %patch2 -p1
128 %patch3 -p1
129 %patch4 -p1
130 %patch5 -p2
131 %patch6 -p1
132
133 mkdir wl
134 mv lib src Makefile wl/
135 cp -p %{SOURCE2} .
136
137 # cleanup backups after patching
138 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
139
140 %build
141 %{?with_kernel:%{expand:%build_kernel_packages}}
142
143 %install
144 rm -rf $RPM_BUILD_ROOT
145 install -d $RPM_BUILD_ROOT/etc/modprobe.d
146
147 %if %{with kernel}
148 install -d $RPM_BUILD_ROOT
149 cp -a installed/* $RPM_BUILD_ROOT
150 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/modprobe.d/%{pname}.conf
151 %endif
152
153 %if %{with dkms}
154 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{pname}-%{version}-%{rel}
155 cp -a wl/Makefile wl/lib wl/src $RPM_BUILD_ROOT%{_usrsrc}/%{pname}-%{version}-%{rel}
156 sed -e 's|@pname@|%{pname}|g' -e 's|@MODVERSION@|%{version}-%{rel}|g' \
157         %{SOURCE3} > $RPM_BUILD_ROOT%{_usrsrc}/%{pname}-%{version}-%{rel}/dkms.conf
158 %endif
159
160 %clean
161 rm -rf $RPM_BUILD_ROOT
162
163 %post -n dkms-%{pname}
164 %{_sbindir}/dkms add -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade && \
165 %{_sbindir}/dkms build -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade && \
166 %{_sbindir}/dkms install -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade || :
167
168 %preun -n dkms-%{pname}
169 %{_sbindir}/dkms remove -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade --all || :
170
171 %if %{with dkms}
172 %files -n dkms-%{pname}
173 %defattr(644,root,root,755)
174 %{_usrsrc}/%{pname}-%{version}-%{rel}
175 %endif
This page took 0.048993 seconds and 3 git commands to generate.