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