- x32 rebuild
[packages/wl.git] / wl.spec
CommitLineData
cd8b6608 1# Conditional build:
b51b81d5 2%bcond_without kernel # don't build kernel modules
cd8b6608 3%bcond_with verbose # verbose build (V=1)
cd0280d0 4%bcond_without userspace # don't build userspace programs
493de627 5%bcond_without dkms # build dkms package
ed656948 6
cd0280d0
JR
7%if %{without userspace}
8%undefine with_dkms
9%endif
10
7cf02690
JR
11# nothing to be placed to debuginfo package
12%define _enable_debug_packages 0
13
14b68eb3 14%define rel 5
7cf02690 15%define pname wl
041038fe 16%define file_ver %(echo %{version} | tr . _)
682c838a 17Summary: Broadcom 802.11 a/b/g/n hybrid Linux networking device driver
7cf02690 18Name: %{pname}%{_alt_kernel}
c2429599 19Version: 6.30.223.248
ed656948 20Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
cd8b6608
ZU
21License: other
22Group: Base/Kernel
b2160a76 23Source0: http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-%{file_ver}.tar.gz
c2429599 24# Source0-md5: e048154b3f4c7ad6bee36cab5b37486d
b2160a76 25Source1: http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-%{file_ver}.tar.gz
c2429599 26# Source1-md5: 0237917f75d121589ec16a44eac5f5b0
ab9a647c 27Source2: http://www.broadcom.com/docs/linux_sta/README.txt
b2160a76 28# Source2-md5: 8a6e8708a5e00ab6d841cde51d70eb1b
b51b81d5 29Source3: dkms.conf
10c48a9f 30Patch0: linux-3.17.patch
1f723013 31Patch1: gcc-4.9.patch
cd8b6608 32URL: http://www.broadcom.com/support/802.11/linux_sta.php
87d5fa42
JR
33BuildRequires: rpmbuild(macros) >= 1.701
34%{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
c0eef975 35ExclusiveArch: %{ix86} %{x8664} x32
cd8b6608
ZU
36BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38%description
39These packages contain Broadcom's IEEE 802.11a/b/g/n hybrid Linux
041038fe
ER
40device driver for use with Broadcom's BCM4311-, BCM4312-, BCM4313-,
41BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and
42BCM43228-based hardware.
cd8b6608 43
b2160a76
ER
44This is an Official Release of Broadcom's hybrid Linux driver for use
45with Broadcom based hardware.
46
7cf02690 47%package -n dkms-%{pname}
b51b81d5
ER
48Summary: DKMS-ready driver for Broadcom WL driver
49Group: Base/Kernel
50Release: %{rel}
51Requires(pre): dkms
52Requires(post): dkms
53%if "%{_rpmversion}" >= "5"
54BuildArch: noarch
55%endif
56
7cf02690 57%description -n dkms-%{pname}
b51b81d5
ER
58This package contains a DKMS-ready driver for Broadcom WL driver.
59
ed656948
JR
60%define kernel_pkg()\
61%package -n kernel%{_alt_kernel}-net-wl\
62Summary: Broadcom 802.11 a/b/g/n hybrid Linux networking device driver\
63Release: %{rel}@%{_kernel_ver_str}\
64Group: Base/Kernel\
65Requires(post,postun): /sbin/depmod\
ed656948
JR
66%requires_releq_kernel\
67Requires(postun): %releq_kernel\
ed656948
JR
68\
69%description -n kernel%{_alt_kernel}-net-wl\
70These packages contain Broadcom's IEEE 802.11a/b/g/n hybrid Linux\
71device driver for use with Broadcom's BCM4311-, BCM4312-, BCM4313-,\
72BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and\
73BCM43228-based hardware.\
74\
75This is an Official Release of Broadcom's hybrid Linux driver for use\
76with Broadcom based hardware.\
77\
78%files -n kernel%{_alt_kernel}-net-wl\
79%defattr(644,root,root,755)\
80%doc lib/LICENSE.txt README.txt\
81/lib/modules/%{_kernel_ver}/kernel/drivers/net/wireless/*.ko*\
82\
83%post -n kernel%{_alt_kernel}-net-wl\
84%depmod %{_kernel_ver}\
85\
86%posttrans -n kernel%{_alt_kernel}-net-wl\
87%banner -e kernel%{_alt_kernel}-net-wl <<EOF\
88WARNING! This kernel module is not GPL licensed.\
89Before using it be sure to accept license: %{_docdir}/kernel%{_alt_kernel}-net-wl-%{version}/LICENSE.txt*\
90EOF\
91\
92%postun -n kernel%{_alt_kernel}-net-wl\
93%depmod %{_kernel_ver}\
94%{nil}
95
96%define build_kernel_pkg()\
97%build_kernel_modules -m wl\
98%install_kernel_modules -D installed -m wl -d kernel/drivers/net/wireless\
99%{nil}
100
87d5fa42 101%{?with_kernel:%{expand:%create_kernel_packages}}
ed656948 102
cd8b6608 103%prep
ab9a647c 104%ifarch %{x8664}
041038fe 105%define src 1
ab9a647c 106%else
041038fe 107%define src 0
ab9a647c 108%endif
7cf02690 109%setup -c -T -q -n %{pname}-%{version} -b%{src}
10c48a9f 110%patch0 -p1
1f723013 111%patch1 -p1
cd8b6608 112
b51b81d5
ER
113# cleanup backups after patching
114find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
115
0c2c4e39
ER
116cp -p %{SOURCE2} .
117
b8a75460 118cat > Makefile << 'EOF'
ab9a647c 119obj-m += wl.o
cd8b6608 120
b2160a76 121wl-objs += src/wl/sys/wl_linux.o
ab9a647c 122wl-objs += src/wl/sys/wl_iw.o
123wl-objs += src/shared/linux_osl.o
cd8b6608 124
b8a75460
ER
125EXTRA_CFLAGS += -I$(KBUILD_EXTMOD)/src/include
126EXTRA_CFLAGS += -I$(KBUILD_EXTMOD)/src/common/include
127EXTRA_CFLAGS += -I$(KBUILD_EXTMOD)/src/wl/sys
128EXTRA_CFLAGS += -I$(KBUILD_EXTMOD)/src/shared/bcmwifi/include
cd8b6608 129
b8a75460 130EXTRA_LDFLAGS := $(KBUILD_EXTMOD)/lib/wlc_hybrid.o_shipped
cd8b6608
ZU
131EOF
132
cd8b6608 133%build
87d5fa42 134%{?with_kernel:%{expand:%build_kernel_packages}}
cd8b6608 135
cd8b6608
ZU
136%install
137rm -rf $RPM_BUILD_ROOT
b51b81d5 138%if %{with kernel}
ed656948
JR
139install -d $RPM_BUILD_ROOT
140cp -a installed/* $RPM_BUILD_ROOT
b51b81d5
ER
141%endif
142
143%if %{with dkms}
7cf02690
JR
144install -d $RPM_BUILD_ROOT%{_usrsrc}/%{pname}-%{version}-%{rel}
145cp -a Makefile lib src $RPM_BUILD_ROOT%{_usrsrc}/%{pname}-%{version}-%{rel}
146sed -e 's|@pname@|%{pname}|g' -e 's|@MODVERSION@|%{version}-%{rel}|g' \
147 %{SOURCE3} > $RPM_BUILD_ROOT%{_usrsrc}/%{pname}-%{version}-%{rel}/dkms.conf
b51b81d5 148%endif
cd8b6608 149
cd8b6608
ZU
150%clean
151rm -rf $RPM_BUILD_ROOT
152
7cf02690
JR
153%post -n dkms-%{pname}
154%{_sbindir}/dkms add -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade && \
155%{_sbindir}/dkms build -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade && \
156%{_sbindir}/dkms install -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade || :
b51b81d5 157
7cf02690
JR
158%preun -n dkms-%{pname}
159%{_sbindir}/dkms remove -m %{pname} -v %{version}-%{rel} --rpm_safe_upgrade --all || :
b51b81d5 160
b51b81d5 161%if %{with dkms}
7cf02690 162%files -n dkms-%{pname}
b51b81d5 163%defattr(644,root,root,755)
7cf02690 164%{_usrsrc}/%{pname}-%{version}-%{rel}
b51b81d5 165%endif
This page took 0.868505 seconds and 4 git commands to generate.