1 |
# $Id: appletalk-kmod.spec,v 1.12 2008/05/22 13:42:26 slords Exp $ |
# $Id: appletalk-kmod.spec,v 1.23 2009/05/26 17:12:40 slords Exp $ |
2 |
|
|
3 |
|
# Define the kmod package name here. |
4 |
|
%define kmod_name appletalk |
5 |
|
|
|
Source10: kmodtool2 |
|
|
%define kmodtool bash %{SOURCE10} |
|
|
%{!?kversion: %define kversion 2.6.9-67.0.20.EL} |
|
6 |
# hint: this can he overridden with "--define kversion foo" on the rpmbuild command line, e.g. |
# 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" |
# --define "kversion 2.6.16-1.2096_FC5" |
8 |
|
%{!?kversion: %define kversion 2.6.9-89.0.15.EL} |
9 |
|
|
10 |
%define kmod_name appletalk |
Name: %{kmod_name}-kmod |
11 |
%define kverrel %(%{kmodtool} verrel %{?kversion} 2>/dev/null) |
Version: 1.0 |
12 |
|
Release: 5%{?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 |
|
|
24 |
|
# Define the variants for each architecture. |
25 |
%define upvar "" |
%define upvar "" |
26 |
%ifarch i586 i686 x86_64 |
%define smpvar smp |
|
%define smpvar smp |
|
|
%endif |
|
27 |
%ifarch i686 |
%ifarch i686 |
28 |
%define hugememvar hugemem |
%define hugememvar hugemem |
29 |
%define xenvar xenU |
%define xenvar xenU |
32 |
%define largesmpvar largesmp |
%define largesmpvar largesmp |
33 |
%define xenvar xenU |
%define xenvar xenU |
34 |
%endif |
%endif |
35 |
%{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?hugememvar} %{?largesmpvar} %{?xenvar}} |
|
36 |
# hint: this can he overridden with "--define kvariant foo bar" on the rpmbuild command line, e.g. |
# If kvariants isn't defined on the rpmbuild line, build all variants for this architecture. |
37 |
# --define 'kvariant "" smp' |
%{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?xenvar} %{?hugememvar} %{?largesmpvar}} |
38 |
|
|
39 |
Name: %{kmod_name}-kmod |
# Magic hidden here. |
40 |
Version: 1.0 |
%define kmodtool sh %{SOURCE10} |
41 |
Release: 2.%(echo %{kverrel} | tr - _) |
%{expand:%(%{kmodtool} rpmtemplate_kmp %{kmod_name} %{kversion} %{kvariants} 2>/dev/null)} |
|
Summary: %{kmod_name} kernel modules |
|
|
|
|
|
Group: System Environment/Kernel |
|
|
License: GPL |
|
|
Source0: %{kmod_name}-%{version}-src.tgz |
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
|
|
ExclusiveArch: i586 i686 x86_64 |
|
42 |
|
|
43 |
%description |
%description |
44 |
%{summary}. |
%{summary}. |
45 |
|
|
|
%{expand:%(%{kmodtool} rpmtemplate %{kmod_name} %{kverrel} %{kvariants} 2>/dev/null)} |
|
|
|
|
46 |
%prep |
%prep |
47 |
%setup -q -c |
%setup -q -c |
48 |
for kvariant in %{kvariants} ; do |
for kvariant in %{kvariants} ; do |
54 |
done |
done |
55 |
|
|
56 |
%build |
%build |
|
rm -rf $RPM_BUILD_ROOT |
|
57 |
for kvariant in %{kvariants} ; do |
for kvariant in %{kvariants} ; do |
58 |
ks=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} |
# ksrc=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu} |
59 |
make -C $ks SUBDIRS=${PWD}/_kmod_build_$kvariant modules \ |
# pushd _kmod_build_$kvariant |
60 |
CONFIG_ATALK=m CONFIG_PROC_FS=y CONFIG_SYSCTL=y |
# make -C "${ksrc}" modules M=$PWD |
61 |
make -C $ks SUBDIRS=${PWD}/_kmod_build_$kvariant modules_install \ |
# popd |
62 |
INSTALL_MOD_PATH=$RPM_BUILD_ROOT modinst_dir='$(MODLIB)/updates/'%{kmod_name} |
ksrc=/lib/modules/"%{kversion}${kvariant:+$kvariant}"/build |
63 |
|
cd _kmod_build_$kvariant |
64 |
|
# make TOPDIR=${ksrc} modules %{?_smp_mflags} |
65 |
|
make -C "${ksrc}" SUBDIRS=${PWD} CONFIG_ATALK=m CONFIG_PROC_FS=y CONFIG_SYSCTL=y modules %{?_smp_mflags} |
66 |
|
cd .. |
67 |
done |
done |
68 |
chmod +x $RPM_BUILD_ROOT/lib/modules/*/updates/%{kmod_name}/*.ko |
|
69 |
|
%install |
70 |
|
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT |
71 |
|
export INSTALL_MOD_DIR=extra/%{kmod_name} |
72 |
|
for kvariant in %{kvariants} ; do |
73 |
|
# ksrc=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu} |
74 |
|
# pushd _kmod_build_$kvariant |
75 |
|
# make -C "${ksrc}" modules_install M=$PWD |
76 |
|
# install -d ${INSTALL_MOD_PATH}/usr/lib/debug |
77 |
|
# popd |
78 |
|
ksrc=/lib/modules/"%{kversion}${kvariant:+$kvariant}"/build |
79 |
|
cd _kmod_build_$kvariant |
80 |
|
make -C ${ksrc} SUBDIRS=`pwd` INSTALL_MOD_PATH=$RPM_BUILD_ROOT modinst_dir='$(MODLIB)/extra/'%{kmod_name} modules_install |
81 |
|
# make TOPDIR=${ksrc} INSTALL_MOD_PATH=$RPM_BUILD_ROOT INSTALL_MOD_DIR=extra/%{kmod_name}/ modules_install %{?_smp_mflags} |
82 |
|
cd .. |
83 |
|
done |
84 |
|
|
85 |
|
# Strip the module(s). |
86 |
|
find ${INSTALL_MOD_PATH} -type f -name \*.ko -exec strip --strip-debug \{\} \; |
87 |
|
# |
88 |
|
|
89 |
%clean |
%clean |
90 |
rm -rf $RPM_BUILD_ROOT |
rm -rf $RPM_BUILD_ROOT |
91 |
|
|
92 |
%changelog |
%changelog |
93 |
|
* Tue Oct 26 2009 Shad L. Lords <slords@mail.com> 1.0-5.sme |
94 |
|
- Make preuninstall script not fail on upgrade |
95 |
|
|
96 |
|
* Tue May 26 2009 Shad L. Lords <slords@mail.com> 1.0-4.sme |
97 |
|
- Initial build of the kABI-tracking version from 1.0. |
98 |
|
- Modified spec and kmodtool(-appletalk) |
99 |
|
- Note: weak-modules became available as of CentOS-4.7 |
100 |
|
- Strip the module(s) added |
101 |
|
|
102 |
|
* Thu Feb 5 2009 Shad L. Lords <slords@mail.com> |
103 |
|
- Fix post scripts [SME: 4864] |
104 |
|
|
105 |
* Mon May 7 2007 Shad L. Lords <slords@mail.com> |
* Mon May 7 2007 Shad L. Lords <slords@mail.com> |
106 |
- Update to use kmodtool |
- Update to use kmodtool |
107 |
|
|