- no more sparc->sparc64
[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
48c0c2ff 10Version: 6.2.15
01be4042 11%define _rel 1
24e60443 12Release: %{_rel}@%{_kernel_ver_str}
69dc5a49 13License: GPL v2
6b39b5a2
PG
14Vendor: Intel Corporation
15Group: Base/Kernel
48c0c2ff
SP
16Source0: ftp://aiedownload.intel.com/df-support/9180/eng/e1000-%{version}.tar.gz
17# Source0-md5: 83f16b6b3f255730e0649f23cfc01509
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
01be4042
SP
74%ifarch ppc
75 if [ -d "%{_kernelsrcdir}/include/asm-powerpc" ]; then
76 install -d include/asm
77 cp -a %{_kernelsrcdir}/include/asm-%{_target_base_arch}/* include/asm
78 cp -a %{_kernelsrcdir}/include/asm-powerpc/* include/asm
79 else
80 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
81 fi
82%else
69dc5a49 83 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
01be4042 84%endif
5fa3076b 85 ln -sf %{_kernelsrcdir}/Module.symvers-$cfg Module.symvers
69dc5a49
PS
86 touch include/config/MARKER
87
88cat >Makefile <<EOF
89obj-m := e1000i.o
90e1000i-objs := e1000_main.o e1000_hw.o e1000_param.o e1000_ethtool.o kcompat.o
91EOF
92
93 %{__make} -C %{_kernelsrcdir} clean \
94 RCS_FIND_IGNORE="-name '*.ko' -o" \
95 M=$PWD O=$PWD \
96 %{?with_verbose:V=1}
97 %{__make} -C %{_kernelsrcdir} modules \
01be4042
SP
98%if "%{_target_base_arch}" != "%{_arch}"
99 ARCH=%{_target_base_arch} \
100 CROSS_COMPILE=%{_target_cpu}-pld-linux- \
101%endif
102 HOSTCC="%{__cc}" \
69dc5a49 103 EXTRA_CFLAGS='-DE1000_NAPI' \
69dc5a49
PS
104 M=$PWD O=$PWD \
105 %{?with_verbose:V=1}
106
107 mv e1000i{,-$cfg}.ko
76f1612f 108done
3d27cef4 109
6b39b5a2
PG
110%install
111rm -rf $RPM_BUILD_ROOT
3d27cef4 112
69dc5a49
PS
113install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/kernel/drivers/net
114cd src
115install e1000i-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
116 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/net/e1000i.ko
3d27cef4 117%if %{with smp} && %{with dist_kernel}
69dc5a49
PS
118install e1000i-smp.ko \
119 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/e1000i.ko
3d27cef4 120%endif
69dc5a49 121cd ..
6b39b5a2 122
fbba5257 123%clean
6b39b5a2
PG
124rm -rf $RPM_BUILD_ROOT
125
126%post
5f5a9fa5 127%depmod %{_kernel_ver}
6b39b5a2
PG
128
129%postun
5f5a9fa5 130%depmod %{_kernel_ver}
6b39b5a2 131
69dc5a49 132%post -n kernel-smp-net-e1000
5f5a9fa5 133%depmod %{_kernel_ver}smp
6b39b5a2 134
69dc5a49 135%postun -n kernel-smp-net-e1000
5f5a9fa5 136%depmod %{_kernel_ver}smp
6b39b5a2
PG
137
138%files
139%defattr(644,root,root,755)
69dc5a49
PS
140%doc e1000.7 README ldistrib.txt
141/lib/modules/%{_kernel_ver}/kernel/drivers/net/*
6b39b5a2 142
3a91d8ce 143%if %{with smp} && %{with dist_kernel}
69dc5a49 144%files -n kernel-smp-net-e1000
6b39b5a2 145%defattr(644,root,root,755)
69dc5a49
PS
146%doc e1000.7 README ldistrib.txt
147/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/*
3a91d8ce 148%endif
This page took 0.056648 seconds and 4 git commands to generate.