1 |
Source10: kmodtool2 |
2 |
%define kmodtool bash %{SOURCE10} |
3 |
%{!?kversion: %define kversion 2.6.9-55.EL} |
4 |
# hint: this can he overridden with "--define kversion foo" on the rpmbuild command line, e.g. |
5 |
# --define "kversion 2.6.16-1.2096_FC5" |
6 |
|
7 |
%define kmod_name slip |
8 |
%define kverrel %(%{kmodtool} verrel %{?kversion} 2>/dev/null) |
9 |
|
10 |
%define upvar "" |
11 |
%ifarch i586 i686 x86_64 |
12 |
%define smpvar smp |
13 |
%endif |
14 |
%ifarch i686 |
15 |
%define hugememvar hugemem |
16 |
%define xenvar xenU |
17 |
%endif |
18 |
%ifarch x86_64 |
19 |
%define largesmpvar largesmp |
20 |
%define xenvar xenU |
21 |
%endif |
22 |
%{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?hugememvar} %{?largesmpvar} %{?xenvar}} |
23 |
# hint: this can he overridden with "--define kvariant foo bar" on the rpmbuild command line, e.g. |
24 |
# --define 'kvariant "" smp' |
25 |
|
26 |
Name: %{kmod_name}-kmod |
27 |
Version: 1.0 |
28 |
Release: 2.%(echo %{kverrel} | tr - _) |
29 |
Summary: %{kmod_name} kernel modules |
30 |
|
31 |
Group: System Environment/Kernel |
32 |
License: GPL |
33 |
Source0: %{kmod_name}-%{version}-src.tgz |
34 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
35 |
ExclusiveArch: i586 i686 x86_64 |
36 |
|
37 |
%description |
38 |
%{summary}. |
39 |
|
40 |
%{expand:%(%{kmodtool} rpmtemplate %{kmod_name} %{kverrel} %{kvariants} 2>/dev/null)} |
41 |
|
42 |
%prep |
43 |
%setup -q -c |
44 |
echo 'obj-m += slip.o' > %{kmod_name}/Makefile |
45 |
for kvariant in %{kvariants} ; do |
46 |
cp -a %{kmod_name} _kmod_build_$kvariant |
47 |
done |
48 |
|
49 |
%build |
50 |
rm -rf $RPM_BUILD_ROOT |
51 |
for kvariant in %{kvariants} ; do |
52 |
ks=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} |
53 |
make -C $ks SUBDIRS=${PWD}/_kmod_build_$kvariant modules |
54 |
make -C $ks SUBDIRS=${PWD}/_kmod_build_$kvariant modules_install \ |
55 |
INSTALL_MOD_PATH=$RPM_BUILD_ROOT modinst_dir='$(MODLIB)/updates/'%{kmod_name} |
56 |
done |
57 |
chmod +x $RPM_BUILD_ROOT/lib/modules/*/updates/%{kmod_name}/*.ko |
58 |
|
59 |
%clean |
60 |
rm -rf $RPM_BUILD_ROOT |
61 |
|
62 |
%changelog |
63 |
* Mon May 7 2007 Shad L. Lords <slords@mail.com> |
64 |
- Update to use kmodtool |
65 |
|
66 |
* Fri Dec 01 2006 Shad L. Lords <slords@mail.com> |
67 |
- Initial package. |