- fix for kernel 4.15 from arch https://bugs.archlinux.org/task/57261
[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     8
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 Patch7:         linux-4.12.patch
46 Patch8:         008-linux415.patch
47 URL:            http://www.broadcom.com/support/802.11
48 BuildRequires:  rpmbuild(macros) >= 1.701
49 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
50 ExclusiveArch:  %{ix86} %{x8664} x32
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %description
54 These packages contain Broadcom's IEEE 802.11a/b/g/n hybrid Linux
55 device driver for use with Broadcom's BCM4311-, BCM4312-, BCM4313-,
56 BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and
57 BCM43228-based hardware.
58
59 This is an Official Release of Broadcom's hybrid Linux driver for use
60 with Broadcom based hardware.
61
62 %package -n dkms-%{pname}
63 Summary:        DKMS-ready driver for Broadcom WL driver
64 Group:          Base/Kernel
65 Release:        %{rel}
66 Requires(pre):  dkms
67 Requires(post): dkms
68 %if "%{_rpmversion}" >= "5"
69 BuildArch:      noarch
70 %endif
71
72 %description -n dkms-%{pname}
73 This package contains a DKMS-ready driver for Broadcom WL driver.
74
75 %define kernel_pkg()\
76 %package -n kernel%{_alt_kernel}-net-wl\
77 Summary:        Broadcom 802.11 a/b/g/n hybrid Linux networking device driver\
78 Release:        %{rel}@%{_kernel_ver_str}\
79 Group:          Base/Kernel\
80 Requires(post,postun):  /sbin/depmod\
81 %requires_releq_kernel\
82 Requires(postun):       %releq_kernel\
83 \
84 %description -n kernel%{_alt_kernel}-net-wl\
85 These packages contain Broadcom's IEEE 802.11a/b/g/n hybrid Linux\
86 device driver for use with Broadcom's BCM4311-, BCM4312-, BCM4313-,\
87 BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and\
88 BCM43228-based hardware.\
89 \
90 This is an Official Release of Broadcom's hybrid Linux driver for use\
91 with Broadcom based hardware.\
92 \
93 %files -n kernel%{_alt_kernel}-net-wl\
94 %defattr(644,root,root,755)\
95 %doc wl/lib/LICENSE.txt README.txt\
96 /lib/modules/%{_kernel_ver}/kernel/drivers/net/wireless/*.ko*\
97 %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/%{pname}.conf\
98 \
99 %post -n kernel%{_alt_kernel}-net-wl\
100 %depmod %{_kernel_ver}\
101 \
102 %posttrans -n kernel%{_alt_kernel}-net-wl\
103 %banner -e kernel%{_alt_kernel}-net-wl <<EOF\
104 WARNING! This kernel module is not GPL licensed.\
105 Before using it be sure to accept license: %{_docdir}/kernel%{_alt_kernel}-net-wl-%{version}/LICENSE.txt*\
106 EOF\
107 \
108 %postun -n kernel%{_alt_kernel}-net-wl\
109 %depmod %{_kernel_ver}\
110 %{nil}
111
112 %define build_kernel_pkg()\
113 %{__make} -C wl KERNELRELEASE=%{_kernel_ver} KBUILD_DIR=%{_kernelsrcdir} clean\
114 %{__make} -C wl KERNELRELEASE=%{_kernel_ver} KBUILD_DIR=%{_kernelsrcdir}\
115 %install_kernel_modules -D installed -m wl/wl -d kernel/drivers/net/wireless\
116 %{nil}
117
118 %{?with_kernel:%{expand:%create_kernel_packages}}
119
120 %prep
121 %ifarch %{x8664} x32
122 %define src 1
123 %else
124 %define src 0
125 %endif
126 %setup -c -T -q -n %{pname}-%{version} -b%{src}
127 %patch0 -p1
128 %patch1 -p1
129 %patch2 -p1
130 %patch3 -p1
131 %patch4 -p1
132 %patch5 -p2
133 %patch6 -p1
134 %patch7 -p1
135 %patch8 -p1
136
137 mkdir wl
138 mv lib src Makefile wl/
139 cp -p %{SOURCE2} .
140
141 # cleanup backups after patching
142 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
143
144 %build
145 %{?with_kernel:%{expand:%build_kernel_packages}}
146
147 %install
148 rm -rf $RPM_BUILD_ROOT
149 install -d $RPM_BUILD_ROOT/etc/modprobe.d
150
151 %if %{with kernel}
152 install -d $RPM_BUILD_ROOT
153 cp -a installed/* $RPM_BUILD_ROOT
154 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/modprobe.d/%{pname}.conf
155 %endif
156
157 %if %{with dkms}
158 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{pname}-%{version}-%{rel}
159 cp -a wl/Makefile wl/lib wl/src $RPM_BUILD_ROOT%{_usrsrc}/%{pname}-%{version}-%{rel}
160 sed -e 's|@pname@|%{pname}|g' -e 's|@MODVERSION@|%{version}-%{rel}|g' \
161         %{SOURCE3} > $RPM_BUILD_ROOT%{_usrsrc}/%{pname}-%{version}-%{rel}/dkms.conf
162 %endif
163
164 %clean
165 rm -rf $RPM_BUILD_ROOT
166
167 %post -n dkms-%{pname}
168 %{_sbindir}/dkms add -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade && \
169 %{_sbindir}/dkms build -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade && \
170 %{_sbindir}/dkms install -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade || :
171
172 %preun -n dkms-%{pname}
173 %{_sbindir}/dkms remove -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade --all || :
174
175 %if %{with dkms}
176 %files -n dkms-%{pname}
177 %defattr(644,root,root,755)
178 %{_usrsrc}/%{pname}-%{version}-%{rel}
179 %endif
This page took 0.144878 seconds and 3 git commands to generate.