1 |
Source10: kmodtool2 |
2 |
%define kmodtool bash %{SOURCE10} |
3 |
%{!?kversion: %define kversion 2.6.9-67.0.4.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 appletalk |
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 |
for kvariant in %{kvariants} ; do |
45 |
cp -a %{kmod_name} _kmod_build_$kvariant |
46 |
if [ "$kvariant" == "xenU" ]; then |
47 |
echo 'obj-$(CONFIG_ATALK) += psnap.o llc.o' >> _kmod_build_$kvariant/Makefile |
48 |
echo 'llc-y := llc_core.o llc_input.o llc_output.o' >> _kmod_build_$kvariant/Makefile |
49 |
fi |
50 |
done |
51 |
|
52 |
%build |
53 |
rm -rf $RPM_BUILD_ROOT |
54 |
for kvariant in %{kvariants} ; do |
55 |
ks=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} |
56 |
make -C $ks SUBDIRS=${PWD}/_kmod_build_$kvariant modules \ |
57 |
CONFIG_ATALK=m CONFIG_PROC_FS=y CONFIG_SYSCTL=y |
58 |
make -C $ks SUBDIRS=${PWD}/_kmod_build_$kvariant modules_install \ |
59 |
INSTALL_MOD_PATH=$RPM_BUILD_ROOT modinst_dir='$(MODLIB)/updates/'%{kmod_name} |
60 |
done |
61 |
chmod +x $RPM_BUILD_ROOT/lib/modules/*/updates/%{kmod_name}/*.ko |
62 |
|
63 |
%clean |
64 |
rm -rf $RPM_BUILD_ROOT |
65 |
|
66 |
%changelog |
67 |
* Mon May 7 2007 Shad L. Lords <slords@mail.com> |
68 |
- Update to use kmodtool |
69 |
|
70 |
* Fri Dec 01 2006 Shad L. Lords <slords@mail.com> |
71 |
- Initial package. |