- mass atack: -j1 for make scripts
[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#
fc821d83 7%define _rel 1
6b39b5a2
PG
8Summary: Intel(R) PRO/1000 driver for Linux
9Summary(pl): Sterownik do karty Intel(R) PRO/1000
949b6f8d 10Name: kernel%{_alt_kernel}-net-e1000
2452ea66 11Version: 7.2.7
24e60443 12Release: %{_rel}@%{_kernel_ver_str}
69dc5a49 13License: GPL v2
6b39b5a2 14Group: Base/Kernel
48c0c2ff 15Source0: ftp://aiedownload.intel.com/df-support/9180/eng/e1000-%{version}.tar.gz
2452ea66 16# Source0-md5: c2f12bd55839988addd5925873b99320
3c4d4ad2 17URL: http://support.intel.com/support/network/adapter/index.htm#PRO/1000
949b6f8d
AG
18%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.7}
19BuildRequires: rpmbuild(macros) >= 1.308
5672dc74 20Requires(post,postun): /sbin/depmod
69dc5a49
PS
21%if %{with dist_kernel}
22%requires_releq_kernel_up
23Requires(postun): %releq_kernel_up
24%endif
5672dc74 25Provides: kernel(e1000)
6b39b5a2
PG
26Obsoletes: e1000
27Obsoletes: linux-net-e1000
6b39b5a2
PG
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30%description
fbba5257
PG
31This package contains the Linux driver for the Intel(R) PRO/1000
32family of 10/100/1000 Ethernet network adapters.
6b39b5a2
PG
33
34%description -l pl
fbba5257
PG
35Ten pakiet zawiera sterownik dla Linuksa do kart sieciowych
3610/100/1000Mbit z rodziny Intel(R) PRO/1000.
6b39b5a2 37
949b6f8d 38%package -n kernel%{_alt_kernel}-smp-net-e1000
6b39b5a2
PG
39Summary: Intel(R) PRO/1000 driver for Linux SMP
40Summary(pl): Sterownik do karty Intel(R) PRO/1000
41Release: %{_rel}@%{_kernel_ver_str}
42Group: Base/Kernel
5672dc74 43Requires(post,postun): /sbin/depmod
69dc5a49
PS
44%if %{with dist_kernel}
45%requires_releq_kernel_smp
46Requires(postun): %releq_kernel_smp
47%endif
5672dc74 48Provides: kernel(e1000)
6b39b5a2
PG
49Obsoletes: e1000
50Obsoletes: linux-net-e1000
6b39b5a2 51
949b6f8d 52%description -n kernel%{_alt_kernel}-smp-net-e1000
6b39b5a2
PG
53This package contains the Linux SMP driver for the Intel(R) PRO/1000
54family of 10/100/1000 Ethernet network adapters.
55
949b6f8d 56%description -n kernel%{_alt_kernel}-smp-net-e1000 -l pl
6b39b5a2
PG
57Ten pakiet zawiera sterownik dla Linuksa SMP do kart sieciowych
5810/100/1000Mbit z rodziny Intel(R) PRO/1000.
59
60%prep
69dc5a49 61%setup -q -n e1000-%{version}
6b39b5a2
PG
62
63%build
76f1612f 64cd src
65for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
69dc5a49
PS
66 if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
67 exit 1
68 fi
6611b76c
AG
69 rm -rf o
70 install -d o/include/{linux,config}
71 ln -sf %{_kernelsrcdir}/config-$cfg o/.config
72 ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
73 ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
01be4042
SP
74%ifarch ppc
75 if [ -d "%{_kernelsrcdir}/include/asm-powerpc" ]; then
01b0675f 76 install -d o/include/asm
6611b76c
AG
77 cp -a %{_kernelsrcdir}/include/asm-%{_target_base_arch}/* o/include/asm
78 cp -a %{_kernelsrcdir}/include/asm-powerpc/* o/include/asm
01be4042 79 else
6611b76c 80 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} o/include/asm
01be4042
SP
81 fi
82%else
6611b76c 83 ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} o/include/asm
01be4042 84%endif
69dc5a49 85
9246bdfb 86cat >Makefile <<EOF
69dc5a49
PS
87obj-m := e1000i.o
88e1000i-objs := e1000_main.o e1000_hw.o e1000_param.o e1000_ethtool.o kcompat.o
89EOF
90
0010d597 91 %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
69dc5a49
PS
92 %{__make} -C %{_kernelsrcdir} clean \
93 RCS_FIND_IGNORE="-name '*.ko' -o" \
9246bdfb 94 SYSSRC=%{_kernelsrcdir} \
95 SYSOUT=$PWD/o \
6611b76c 96 M=$PWD O=$PWD/o \
69dc5a49
PS
97 %{?with_verbose:V=1}
98 %{__make} -C %{_kernelsrcdir} modules \
01be4042 99%if "%{_target_base_arch}" != "%{_arch}"
fc821d83
ER
100 ARCH=%{_target_base_arch} \
101 CROSS_COMPILE=%{_target_cpu}-pld-linux- \
01be4042 102%endif
fc821d83 103 HOSTCC="%{__cc}" \
69dc5a49 104 EXTRA_CFLAGS='-DE1000_NAPI' \
9246bdfb 105 SYSSRC=%{_kernelsrcdir} \
106 SYSOUT=$PWD/o \
6611b76c 107 M=$PWD O=$PWD/o \
69dc5a49
PS
108 %{?with_verbose:V=1}
109
9246bdfb 110 mv e1000i{,-$cfg}.ko
76f1612f 111done
3d27cef4 112
6b39b5a2
PG
113%install
114rm -rf $RPM_BUILD_ROOT
3d27cef4 115
69dc5a49
PS
116install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/kernel/drivers/net
117cd src
118install e1000i-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
119 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/net/e1000i.ko
3d27cef4 120%if %{with smp} && %{with dist_kernel}
69dc5a49
PS
121install e1000i-smp.ko \
122 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/e1000i.ko
3d27cef4 123%endif
69dc5a49 124cd ..
6b39b5a2 125
fbba5257 126%clean
6b39b5a2
PG
127rm -rf $RPM_BUILD_ROOT
128
129%post
5f5a9fa5 130%depmod %{_kernel_ver}
6b39b5a2
PG
131
132%postun
5f5a9fa5 133%depmod %{_kernel_ver}
6b39b5a2 134
949b6f8d 135%post -n kernel%{_alt_kernel}-smp-net-e1000
5f5a9fa5 136%depmod %{_kernel_ver}smp
6b39b5a2 137
949b6f8d 138%postun -n kernel%{_alt_kernel}-smp-net-e1000
5f5a9fa5 139%depmod %{_kernel_ver}smp
6b39b5a2
PG
140
141%files
142%defattr(644,root,root,755)
69dc5a49
PS
143%doc e1000.7 README ldistrib.txt
144/lib/modules/%{_kernel_ver}/kernel/drivers/net/*
6b39b5a2 145
3a91d8ce 146%if %{with smp} && %{with dist_kernel}
949b6f8d 147%files -n kernel%{_alt_kernel}-smp-net-e1000
6b39b5a2 148%defattr(644,root,root,755)
69dc5a49
PS
149%doc e1000.7 README ldistrib.txt
150/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/*
3a91d8ce 151%endif
This page took 0.088966 seconds and 4 git commands to generate.