- fixed building process.
[packages/e1000.git] / e1000.spec
1 #
2 # Conditional build:
3 # _without_dist_kernel          without distribution kernel
4 #
5 %bcond_without  dist_kernel
6 %bcond_without  smp
7
8 %define         _orig_name      e1000
9
10 %{!?_without_dist_kernel:%define        _mod_name %{_orig_name}_intel }
11 %{?_without_dist_kernel:%define         _mod_name %{_orig_name} }
12
13 Summary:        Intel(R) PRO/1000 driver for Linux
14 Summary(pl):    Sterownik do karty Intel(R) PRO/1000
15 Name:           kernel-net-%{_orig_name}
16 Version:        5.5.4
17 %define _rel    1
18 Release:        %{_rel}@%{_kernel_ver_str}
19 License:        BSD
20 Vendor:         Intel Corporation
21 Group:          Base/Kernel
22 Source0:        ftp://aiedownload.intel.com/df-support/2897/eng/%{_orig_name}-%{version}.tar.gz
23 # Source0-md5:  f6e55d5f3a112dca04397e62d720ef84
24 %{!?_without_dist_kernel:BuildRequires: kernel-headers >= 2.4.20 }
25 BuildRequires:  %{kgcc_package}
26 BuildRequires:  rpmbuild(macros) >= 1.118
27 URL:            http://support.intel.com/support/network/adapter/pro100/
28 %{!?_without_dist_kernel:%requires_releq_kernel_up}
29 Requires(post,postun):  /sbin/depmod
30 Provides:       kernel(e1000)
31 Obsoletes:      e1000
32 Obsoletes:      linux-net-e1000
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %description
36 This package contains the Linux driver for the Intel(R) PRO/1000
37 family of 10/100/1000 Ethernet network adapters.
38
39 %description -l pl
40 Ten pakiet zawiera sterownik dla Linuksa do kart sieciowych
41 10/100/1000Mbit z rodziny Intel(R) PRO/1000.
42
43 %package -n kernel-smp-net-%{_orig_name}
44 Summary:        Intel(R) PRO/1000 driver for Linux SMP
45 Summary(pl):    Sterownik do karty Intel(R) PRO/1000
46 Release:        %{_rel}@%{_kernel_ver_str}
47 Group:          Base/Kernel
48 %{!?_without_dist_kernel:%requires_releq_kernel_smp}
49 Requires(post,postun):  /sbin/depmod
50 Provides:       kernel(e1000)
51 Obsoletes:      e1000
52 Obsoletes:      linux-net-e1000
53
54 %description -n kernel-smp-net-%{_orig_name}
55 This package contains the Linux SMP driver for the Intel(R) PRO/1000
56 family of 10/100/1000 Ethernet network adapters.
57
58 %description -n kernel-smp-net-%{_orig_name} -l pl
59 Ten pakiet zawiera sterownik dla Linuksa SMP do kart sieciowych
60 10/100/1000Mbit z rodziny Intel(R) PRO/1000.
61
62 %prep
63 %setup -q -n %{_orig_name}-%{version}
64
65 %build
66 cd src
67 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
68     if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
69         exit 1
70     fi
71     rm -rf include
72     install -d include/{linux,config}
73     ln -sf %{_kernelsrcdir}/config-$cfg .config
74     ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
75     ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
76     touch include/config/MARKER
77     %{__make} -C %{_kernelsrcdir} clean modules \
78         EXTRA_CFLAGS="-I../include -DFUSE_VERSION='1.1'" \
79         RCS_FIND_IGNORE="-name '*.ko' -o" \
80         M=$PWD O=$PWD \
81         %{?with_verbose:V=1}
82     mv e1000.ko e1000.ko-$cfg
83 done
84                                                                 
85 %install
86 rm -rf $RPM_BUILD_ROOT
87 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/misc
88 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/net/misc
89 install src/%{_orig_name}.ko-smp $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/misc/%{_mod_name}.ko
90 install src/%{_orig_name}.ko-up $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/net/misc/%{_mod_name}.ko
91
92 %clean
93 rm -rf $RPM_BUILD_ROOT
94
95 %post
96 %depmod %{_kernel_ver}
97
98 %postun
99 %depmod %{_kernel_ver}
100
101 %post   -n kernel-smp-net-%{_orig_name}
102 %depmod %{_kernel_ver}smp
103
104 %postun -n kernel-smp-net-%{_orig_name}
105 %depmod %{_kernel_ver}smp
106
107 %files
108 %defattr(644,root,root,755)
109 %doc %{_orig_name}.7 README ldistrib.txt
110 /lib/modules/%{_kernel_ver}/kernel/drivers/net/misc/*
111
112 %files -n kernel-smp-net-%{_orig_name}
113 %defattr(644,root,root,755)
114 %doc %{_orig_name}.7 README ldistrib.txt
115 /lib/modules/%{_kernel_ver}smp/kernel/drivers/net/misc/*
This page took 0.29696 seconds and 3 git commands to generate.