1 |
slords |
1.23 |
# $Id: slip-kmod.spec,v 1.22 2009/05/02 10:09:04 bytegw Exp $ |
2 |
|
|
|
3 |
|
|
# Define the kmod package name here. |
4 |
|
|
%define kmod_name slip |
5 |
slords |
1.10 |
|
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 |
slords |
1.23 |
%{!?kversion: %define kversion 2.6.9-78.0.22.EL} |
9 |
slords |
1.1 |
|
10 |
slords |
1.23 |
Name: %{kmod_name}-kmod |
11 |
|
|
Version: 1.0 |
12 |
|
|
Release: 4%{?dist} |
13 |
|
|
Group: System Environment/Kernel |
14 |
|
|
License: GPL |
15 |
|
|
Summary: %{kmod_name} kernel modules |
16 |
|
|
|
17 |
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
18 |
|
|
ExclusiveArch: i586 i686 x86_64 |
19 |
|
|
|
20 |
|
|
# Sources. |
21 |
|
|
Source0: %{kmod_name}-%{version}-src.tgz |
22 |
|
|
Source10: kmodtool-%{kmod_name} |
23 |
slords |
1.1 |
|
24 |
slords |
1.23 |
# Define the variants for each architecture. |
25 |
slords |
1.1 |
%define upvar "" |
26 |
slords |
1.23 |
%define smpvar smp |
27 |
slords |
1.1 |
%ifarch i686 |
28 |
|
|
%define hugememvar hugemem |
29 |
|
|
%define xenvar xenU |
30 |
|
|
%endif |
31 |
|
|
%ifarch x86_64 |
32 |
|
|
%define largesmpvar largesmp |
33 |
|
|
%define xenvar xenU |
34 |
|
|
%endif |
35 |
slords |
1.23 |
|
36 |
|
|
# If kvariants isn't defined on the rpmbuild line, build all variants for this architecture. |
37 |
|
|
%{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?xenvar} %{?hugememvar} %{?largesmpvar}} |
38 |
|
|
|
39 |
|
|
# Magic hidden here. |
40 |
|
|
%define kmodtool sh %{SOURCE10} |
41 |
|
|
%{expand:%(%{kmodtool} rpmtemplate_kmp %{kmod_name} %{kversion} %{kvariants} 2>/dev/null)} |
42 |
slords |
1.1 |
|
43 |
|
|
%description |
44 |
|
|
%{summary}. |
45 |
|
|
|
46 |
|
|
%prep |
47 |
|
|
%setup -q -c |
48 |
|
|
echo 'obj-m += slip.o' > %{kmod_name}/Makefile |
49 |
|
|
for kvariant in %{kvariants} ; do |
50 |
|
|
cp -a %{kmod_name} _kmod_build_$kvariant |
51 |
|
|
done |
52 |
|
|
|
53 |
|
|
%build |
54 |
|
|
for kvariant in %{kvariants} ; do |
55 |
slords |
1.23 |
# ksrc=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu} |
56 |
|
|
# pushd _kmod_build_$kvariant |
57 |
|
|
# make -C "${ksrc}" modules M=$PWD |
58 |
|
|
# popd |
59 |
|
|
ksrc=/lib/modules/"%{kversion}${kvariant:+$kvariant}"/build |
60 |
|
|
cd _kmod_build_$kvariant |
61 |
|
|
# make TOPDIR=${ksrc} modules %{?_smp_mflags} |
62 |
|
|
make -C "${ksrc}" SUBDIRS=${PWD} modules %{?_smp_mflags} |
63 |
|
|
cd .. |
64 |
|
|
done |
65 |
|
|
|
66 |
|
|
%install |
67 |
|
|
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT |
68 |
|
|
export INSTALL_MOD_DIR=extra/%{kmod_name} |
69 |
|
|
for kvariant in %{kvariants} ; do |
70 |
|
|
# ksrc=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu} |
71 |
|
|
# pushd _kmod_build_$kvariant |
72 |
|
|
# make -C "${ksrc}" modules_install M=$PWD |
73 |
|
|
# install -d ${INSTALL_MOD_PATH}/usr/lib/debug |
74 |
|
|
# popd |
75 |
|
|
ksrc=/lib/modules/"%{kversion}${kvariant:+$kvariant}"/build |
76 |
|
|
cd _kmod_build_$kvariant |
77 |
|
|
make -C ${ksrc} SUBDIRS=`pwd` INSTALL_MOD_PATH=$RPM_BUILD_ROOT modinst_dir='$(MODLIB)/extra/'%{kmod_name} modules_install |
78 |
|
|
# make TOPDIR=${ksrc} INSTALL_MOD_PATH=$RPM_BUILD_ROOT INSTALL_MOD_DIR=extra/%{kmod_name}/ modules_install %{?_smp_mflags} |
79 |
|
|
cd .. |
80 |
slords |
1.1 |
done |
81 |
slords |
1.23 |
|
82 |
|
|
# Strip the module(s). |
83 |
|
|
find ${INSTALL_MOD_PATH} -type f -name \*.ko -exec strip --strip-debug \{\} \; |
84 |
|
|
# |
85 |
slords |
1.1 |
|
86 |
|
|
%clean |
87 |
|
|
rm -rf $RPM_BUILD_ROOT |
88 |
|
|
|
89 |
|
|
%changelog |
90 |
slords |
1.23 |
* Tue May 26 2009 Shad L. Lords <slords@mail.com> 1.0-4.sme |
91 |
|
|
- Initial build of the kABI-tracking version from 1.0. |
92 |
|
|
- Modified spec and kmodtool(-slip) |
93 |
|
|
- Note: weak-modules became available as of CentOS-4.7 |
94 |
|
|
- Strip the module(s) added |
95 |
|
|
|
96 |
snetram |
1.20 |
* Thu Feb 5 2009 Shad L. Lords <slords@mail.com> |
97 |
|
|
- Fix post scripts [SME: 4864] |
98 |
|
|
|
99 |
slords |
1.1 |
* Mon May 7 2007 Shad L. Lords <slords@mail.com> |
100 |
|
|
- Update to use kmodtool |
101 |
|
|
|
102 |
|
|
* Fri Dec 01 2006 Shad L. Lords <slords@mail.com> |
103 |
|
|
- Initial package. |