- prepared for kernel >= 2.6.13: link Module.symvers
[packages/e1000.git] / e1000.spec
CommitLineData
5672dc74
JB
1#
2# Conditional build:
69dc5a49 3%bcond_without dist_kernel # allow non-distribution kernel
c259e077 4%bcond_without smp # don't build SMP module
69dc5a49 5%bcond_with verbose # verbose build (V=1)
5672dc74 6#
6b39b5a2
PG
7Summary: Intel(R) PRO/1000 driver for Linux
8Summary(pl): Sterownik do karty Intel(R) PRO/1000
69dc5a49 9Name: kernel-net-e1000
65d4a64e 10Version: 6.0.60
69dc5a49 11%define _rel 1
24e60443 12Release: %{_rel}@%{_kernel_ver_str}
69dc5a49 13License: GPL v2
6b39b5a2
PG
14Vendor: Intel Corporation
15Group: Base/Kernel
69dc5a49 16Source0: ftp://aiedownload.intel.com/df-support/2897/eng/e1000-%{version}.tar.gz
65d4a64e 17# Source0-md5: 3787ae0bebc305e84356185492312e8a
3c4d4ad2 18URL: http://support.intel.com/support/network/adapter/index.htm#PRO/1000
69dc5a49
PS
19%{?with_dist_kernel:BuildRequires: kernel-module-build >= 2.6.7}
20BuildRequires: rpmbuild(macros) >= 1.211
5672dc74 21Requires(post,postun): /sbin/depmod
69dc5a49
PS
22%if %{with dist_kernel}
23%requires_releq_kernel_up
24Requires(postun): %releq_kernel_up
25%endif
5672dc74 26Provides: kernel(e1000)
6b39b5a2
PG
27Obsoletes: e1000
28Obsoletes: linux-net-e1000
6b39b5a2
PG
29BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31%description
fbba5257
PG
32This package contains the Linux driver for the Intel(R) PRO/1000
33family of 10/100/1000 Ethernet network adapters.
6b39b5a2
PG
34
35%description -l pl
fbba5257
PG
36Ten pakiet zawiera sterownik dla Linuksa do kart sieciowych
3710/100/1000Mbit z rodziny Intel(R) PRO/1000.
6b39b5a2 38
69dc5a49 39%package -n kernel-smp-net-e1000
6b39b5a2
PG
40Summary: Intel(R) PRO/1000 driver for Linux SMP
41Summary(pl): Sterownik do karty Intel(R) PRO/1000
42Release: %{_rel}@%{_kernel_ver_str}
43Group: Base/Kernel
5672dc74 44Requires(post,postun): /sbin/depmod
69dc5a49
PS
45%if %{with dist_kernel}
46%requires_releq_kernel_smp
47Requires(postun): %releq_kernel_smp
48%endif
5672dc74 49Provides: kernel(e1000)
6b39b5a2
PG
50Obsoletes: e1000
51Obsoletes: linux-net-e1000
6b39b5a2 52
69dc5a49 53%description -n kernel-smp-net-e1000
6b39b5a2
PG
54This package contains the Linux SMP driver for the Intel(R) PRO/1000
55family of 10/100/1000 Ethernet network adapters.
56
69dc5a49 57%description -n kernel-smp-net-e1000 -l pl
6b39b5a2
PG
58Ten pakiet zawiera sterownik dla Linuksa SMP do kart sieciowych
5910/100/1000Mbit z rodziny Intel(R) PRO/1000.
60
61%prep
69dc5a49 62%setup -q -n e1000-%{version}
6b39b5a2
PG
63
64%build
76f1612f 65cd src
66for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
69dc5a49
PS
67 if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
68 exit 1
69 fi
70 rm -rf include
71 install -d include/{linux,config}
72 ln -sf %{_kernelsrcdir}/config-$cfg .config
73 ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
74 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
5fa3076b 75 ln -sf %{_kernelsrcdir}/Module.symvers-$cfg Module.symvers
69dc5a49
PS
76 touch include/config/MARKER
77
78cat >Makefile <<EOF
79obj-m := e1000i.o
80e1000i-objs := e1000_main.o e1000_hw.o e1000_param.o e1000_ethtool.o kcompat.o
81EOF
82
83 %{__make} -C %{_kernelsrcdir} clean \
84 RCS_FIND_IGNORE="-name '*.ko' -o" \
85 M=$PWD O=$PWD \
86 %{?with_verbose:V=1}
87 %{__make} -C %{_kernelsrcdir} modules \
88 EXTRA_CFLAGS='-DE1000_NAPI' \
89 CC="%{__cc}" CPP="%{__cpp}" \
90 M=$PWD O=$PWD \
91 %{?with_verbose:V=1}
92
93 mv e1000i{,-$cfg}.ko
76f1612f 94done
3d27cef4 95
6b39b5a2
PG
96%install
97rm -rf $RPM_BUILD_ROOT
3d27cef4 98
69dc5a49
PS
99install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/kernel/drivers/net
100cd src
101install e1000i-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
102 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/net/e1000i.ko
3d27cef4 103%if %{with smp} && %{with dist_kernel}
69dc5a49
PS
104install e1000i-smp.ko \
105 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/e1000i.ko
3d27cef4 106%endif
69dc5a49 107cd ..
6b39b5a2 108
fbba5257 109%clean
6b39b5a2
PG
110rm -rf $RPM_BUILD_ROOT
111
112%post
5f5a9fa5 113%depmod %{_kernel_ver}
6b39b5a2
PG
114
115%postun
5f5a9fa5 116%depmod %{_kernel_ver}
6b39b5a2 117
69dc5a49 118%post -n kernel-smp-net-e1000
5f5a9fa5 119%depmod %{_kernel_ver}smp
6b39b5a2 120
69dc5a49 121%postun -n kernel-smp-net-e1000
5f5a9fa5 122%depmod %{_kernel_ver}smp
6b39b5a2
PG
123
124%files
125%defattr(644,root,root,755)
69dc5a49
PS
126%doc e1000.7 README ldistrib.txt
127/lib/modules/%{_kernel_ver}/kernel/drivers/net/*
6b39b5a2 128
3a91d8ce 129%if %{with smp} && %{with dist_kernel}
69dc5a49 130%files -n kernel-smp-net-e1000
6b39b5a2 131%defattr(644,root,root,755)
69dc5a49
PS
132%doc e1000.7 README ldistrib.txt
133/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/*
3a91d8ce 134%endif
This page took 0.060813 seconds and 4 git commands to generate.