- no more sparc->sparc64
[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.2.15
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/9180/eng/e1000-%{version}.tar.gz
17 # Source0-md5:  83f16b6b3f255730e0649f23cfc01509
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 %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
83         ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
84 %endif
85         ln -sf %{_kernelsrcdir}/Module.symvers-$cfg Module.symvers
86         touch include/config/MARKER
87
88 cat >Makefile <<EOF
89 obj-m := e1000i.o
90 e1000i-objs := e1000_main.o e1000_hw.o e1000_param.o e1000_ethtool.o kcompat.o
91 EOF
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 \
98 %if "%{_target_base_arch}" != "%{_arch}"
99                 ARCH=%{_target_base_arch} \
100                 CROSS_COMPILE=%{_target_cpu}-pld-linux- \
101 %endif
102                 HOSTCC="%{__cc}" \
103                 EXTRA_CFLAGS='-DE1000_NAPI' \
104                 M=$PWD O=$PWD \
105                 %{?with_verbose:V=1}
106
107         mv e1000i{,-$cfg}.ko
108 done
109
110 %install
111 rm -rf $RPM_BUILD_ROOT
112
113 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/kernel/drivers/net
114 cd src
115 install e1000i-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
116         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/net/e1000i.ko
117 %if %{with smp} && %{with dist_kernel}
118 install e1000i-smp.ko \
119         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/e1000i.ko
120 %endif
121 cd ..
122
123 %clean
124 rm -rf $RPM_BUILD_ROOT
125
126 %post
127 %depmod %{_kernel_ver}
128
129 %postun
130 %depmod %{_kernel_ver}
131
132 %post   -n kernel-smp-net-e1000
133 %depmod %{_kernel_ver}smp
134
135 %postun -n kernel-smp-net-e1000
136 %depmod %{_kernel_ver}smp
137
138 %files
139 %defattr(644,root,root,755)
140 %doc e1000.7 README ldistrib.txt
141 /lib/modules/%{_kernel_ver}/kernel/drivers/net/*
142
143 %if %{with smp} && %{with dist_kernel}
144 %files -n kernel-smp-net-e1000
145 %defattr(644,root,root,755)
146 %doc e1000.7 README ldistrib.txt
147 /lib/modules/%{_kernel_ver}smp/kernel/drivers/net/*
148 %endif
This page took 0.053334 seconds and 3 git commands to generate.