- mass atack: -j1 for make scripts
[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%{_alt_kernel}-net-e1000
11 Version:        7.2.7
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:  c2f12bd55839988addd5925873b99320
17 URL:            http://support.intel.com/support/network/adapter/index.htm#PRO/1000
18 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.7}
19 BuildRequires:  rpmbuild(macros) >= 1.308
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%{_alt_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%{_alt_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%{_alt_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 o/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 >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} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
92         %{__make} -C %{_kernelsrcdir} clean \
93                 RCS_FIND_IGNORE="-name '*.ko' -o" \
94                 SYSSRC=%{_kernelsrcdir} \
95                 SYSOUT=$PWD/o \
96                 M=$PWD O=$PWD/o \
97                 %{?with_verbose:V=1}
98         %{__make} -C %{_kernelsrcdir} modules \
99 %if "%{_target_base_arch}" != "%{_arch}"
100                 ARCH=%{_target_base_arch} \
101                 CROSS_COMPILE=%{_target_cpu}-pld-linux- \
102 %endif
103                 HOSTCC="%{__cc}" \
104                 EXTRA_CFLAGS='-DE1000_NAPI' \
105                 SYSSRC=%{_kernelsrcdir} \
106                 SYSOUT=$PWD/o \
107                 M=$PWD O=$PWD/o \
108                 %{?with_verbose:V=1}
109
110         mv e1000i{,-$cfg}.ko
111 done
112
113 %install
114 rm -rf $RPM_BUILD_ROOT
115
116 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/kernel/drivers/net
117 cd src
118 install e1000i-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
119         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/net/e1000i.ko
120 %if %{with smp} && %{with dist_kernel}
121 install e1000i-smp.ko \
122         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/e1000i.ko
123 %endif
124 cd ..
125
126 %clean
127 rm -rf $RPM_BUILD_ROOT
128
129 %post
130 %depmod %{_kernel_ver}
131
132 %postun
133 %depmod %{_kernel_ver}
134
135 %post   -n kernel%{_alt_kernel}-smp-net-e1000
136 %depmod %{_kernel_ver}smp
137
138 %postun -n kernel%{_alt_kernel}-smp-net-e1000
139 %depmod %{_kernel_ver}smp
140
141 %files
142 %defattr(644,root,root,755)
143 %doc e1000.7 README ldistrib.txt
144 /lib/modules/%{_kernel_ver}/kernel/drivers/net/*
145
146 %if %{with smp} && %{with dist_kernel}
147 %files -n kernel%{_alt_kernel}-smp-net-e1000
148 %defattr(644,root,root,755)
149 %doc e1000.7 README ldistrib.txt
150 /lib/modules/%{_kernel_ver}smp/kernel/drivers/net/*
151 %endif
This page took 0.055847 seconds and 3 git commands to generate.