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