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