1 |
# $Id: ppp-kmod.spec,v 1.20 2009/04/13 14:43:10 snetram Exp $ |
# $Id: ppp-kmod.spec,v 1.26 2010/04/21 16:05:33 slords Exp $ |
2 |
|
|
3 |
|
# Define the kmod package name here. |
4 |
|
%define kmod_name ppp |
5 |
|
|
|
Source10: kmodtool2 |
|
|
%define kmodtool bash %{SOURCE10} |
|
|
%{!?kversion: %define kversion 2.6.9-78.0.17.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.20.EL} |
9 |
|
|
10 |
%define kmod_name ppp |
Name: %{kmod_name}-kmod |
11 |
%define kverrel %(%{kmodtool} verrel %{?kversion} 2>/dev/null) |
Version: 1.0.2 |
12 |
|
Release: 8%{?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: kernel_ppp_mppe-%{version}-src.tgz |
22 |
|
Source10: kmodtool-%{kmod_name} |
23 |
|
|
24 |
|
# Patches. |
25 |
|
Patch1: ppp-725ad2a8f1358bff885414f5e91d253c99921ddc.patch |
26 |
|
Patch2: ppp-44315cc76567e2d911d56091665637e305af182d.patch |
27 |
|
Patch3: ppp-kmod-1.0.2-padfix.patch |
28 |
|
|
29 |
|
# Define the variants for each architecture. |
30 |
%define upvar "" |
%define upvar "" |
31 |
%ifarch i586 i686 x86_64 |
%define smpvar smp |
|
%define smpvar smp |
|
|
%endif |
|
32 |
%ifarch i686 |
%ifarch i686 |
33 |
%define hugememvar hugemem |
%define hugememvar hugemem |
34 |
%define xenvar xenU |
%define xenvar xenU |
37 |
%define largesmpvar largesmp |
%define largesmpvar largesmp |
38 |
%define xenvar xenU |
%define xenvar xenU |
39 |
%endif |
%endif |
40 |
%{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?hugememvar} %{?largesmpvar} %{?xenvar}} |
|
41 |
# 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. |
42 |
# --define 'kvariant "" smp' |
%{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?xenvar} %{?hugememvar} %{?largesmpvar}} |
43 |
|
|
44 |
Name: %{kmod_name}-kmod |
# Magic hidden here. |
45 |
Version: 1.0.2 |
%define kmodtool sh %{SOURCE10} |
46 |
Release: 3.%(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: kernel_ppp_mppe-%{version}-src.tgz |
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
|
|
ExclusiveArch: i586 i686 x86_64 |
|
47 |
|
|
48 |
%description |
%description |
49 |
%{summary}. |
%{summary}. |
50 |
|
|
|
%{expand:%(%{kmodtool} rpmtemplate %{kmod_name} %{kverrel} %{kvariants} 2>/dev/null)} |
|
|
|
|
51 |
%prep |
%prep |
52 |
%setup -q -c |
%setup -q -c |
53 |
cd kernel_ppp_mppe-%{version} |
pushd kernel_ppp_mppe-%{version} |
54 |
./pre_build.sh %{_usrsrc}/kernels/%{kverrel}-%{_target_cpu} . . %{kverrel} |
./pre_build.sh lib/modules/"%{kversion}${kvariant:+$kvariant}"/build . . %{kversion}${kvariant:+$kvariant} |
55 |
|
%patch1 -p3 |
56 |
|
%patch2 -p3 |
57 |
|
%patch3 |
58 |
patch -p1 < patches/linux-2.6.2-pad.patch |
patch -p1 < patches/linux-2.6.2-pad.patch |
59 |
patch -p1 < patches/02-ppp_generic.c.patch |
patch -p1 < patches/02-ppp_generic.c.patch |
60 |
patch -p1 < patches/03-ppp_mppe_compress.c.patch |
patch -p1 < patches/03-ppp_mppe_compress.c.patch |
61 |
patch -p1 < patches/04-ppp_mppe_compress.c_license.patch |
patch -p1 < patches/04-ppp_mppe_compress.c_license.patch |
62 |
cd .. |
popd |
63 |
for kvariant in %{kvariants} ; do |
for kvariant in %{kvariants} ; do |
64 |
cp -a kernel_ppp_mppe-%{version} _kmod_build_$kvariant |
cp -a kernel_ppp_mppe-%{version} _kmod_build_$kvariant |
65 |
done |
done |
66 |
|
|
67 |
%build |
%build |
|
rm -rf $RPM_BUILD_ROOT |
|
68 |
for kvariant in %{kvariants} ; do |
for kvariant in %{kvariants} ; do |
69 |
ks=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} |
# ksrc=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu} |
70 |
make -C $ks SUBDIRS=${PWD}/_kmod_build_$kvariant modules |
# pushd _kmod_build_$kvariant |
71 |
make -C $ks SUBDIRS=${PWD}/_kmod_build_$kvariant modules_install \ |
# make -C "${ksrc}" modules M=$PWD |
72 |
INSTALL_MOD_PATH=$RPM_BUILD_ROOT modinst_dir='$(MODLIB)/updates/'%{kmod_name} |
# popd |
73 |
|
ksrc=/lib/modules/"%{kversion}${kvariant:+$kvariant}"/build |
74 |
|
cd _kmod_build_$kvariant |
75 |
|
# make TOPDIR=${ksrc} modules %{?_smp_mflags} |
76 |
|
make -C "${ksrc}" SUBDIRS=${PWD} modules %{?_smp_mflags} |
77 |
|
cd .. |
78 |
done |
done |
79 |
chmod +x $RPM_BUILD_ROOT/lib/modules/*/updates/%{kmod_name}/*.ko |
|
80 |
|
%install |
81 |
|
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT |
82 |
|
export INSTALL_MOD_DIR=extra/%{kmod_name} |
83 |
|
for kvariant in %{kvariants} ; do |
84 |
|
# ksrc=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu} |
85 |
|
# pushd _kmod_build_$kvariant |
86 |
|
# make -C "${ksrc}" modules_install M=$PWD |
87 |
|
# install -d ${INSTALL_MOD_PATH}/usr/lib/debug |
88 |
|
# popd |
89 |
|
ksrc=/lib/modules/"%{kversion}${kvariant:+$kvariant}"/build |
90 |
|
cd _kmod_build_$kvariant |
91 |
|
make -C ${ksrc} SUBDIRS=`pwd` INSTALL_MOD_PATH=$RPM_BUILD_ROOT modinst_dir='$(MODLIB)/extra/'%{kmod_name} modules_install |
92 |
|
# make TOPDIR=${ksrc} INSTALL_MOD_PATH=$RPM_BUILD_ROOT INSTALL_MOD_DIR=extra/%{kmod_name}/ modules_install %{?_smp_mflags} |
93 |
|
cd .. |
94 |
|
|
95 |
|
mkdir -p ${INSTALL_MOD_PATH}/usr/share/doc/kmod-%{kmod_name}/%{kversion}/ |
96 |
|
find ${INSTALL_MOD_PATH}/lib/modules/"%{kversion}${kvariant:+$kvariant}"/ -type f -name \*.ko | sed "s,${INSTALL_MOD_PATH},," \ |
97 |
|
> ${INSTALL_MOD_PATH}/usr/share/doc/kmod-%{kmod_name}/%{kversion}/"modules${kvariant:+-$kvariant}" |
98 |
|
done |
99 |
|
|
100 |
|
# Strip the module(s). |
101 |
|
find ${INSTALL_MOD_PATH} -type f -name \*.ko -exec strip --strip-debug \{\} \; |
102 |
|
|
103 |
|
# Override where module comes from. |
104 |
|
mkdir -p ${INSTALL_MOD_PATH}/etc/depmod.d/ |
105 |
|
find ${INSTALL_MOD_PATH}/lib/modules/ -type f -name \*.ko -printf '%f\n' \ |
106 |
|
| sed 's,\.ko,,' | sort -u | xargs -ri echo "override {} * weak-updates/%{kmod_name}" \ |
107 |
|
>> ${INSTALL_MOD_PATH}/etc/depmod.d/%{kmod_name}.conf |
108 |
|
|
109 |
%clean |
%clean |
110 |
rm -rf $RPM_BUILD_ROOT |
rm -rf $RPM_BUILD_ROOT |
111 |
|
|
112 |
%changelog |
%changelog |
113 |
|
* Tue Jun 01 2010 Shad L. Lords <slords@mail.com> 1.0.2-8.sme |
114 |
|
- Make weak-updates default for pulling module [SME: 5982] |
115 |
|
- Fix previous script to not error on uninstall [SME: 5448] |
116 |
|
|
117 |
|
* Wed Apr 21 2010 Shad L. Lords <slords@mail.com> 1.0.2-7.sme |
118 |
|
- Update scriptlets to not call rpm [SME: 5448] |
119 |
|
|
120 |
|
* Tue Dec 1 2009 Shad L. Lords <slords@mail.com> 1.0.2-6.sme |
121 |
|
- Update kmod to fix buffer too small errors [SME: 5628] |
122 |
|
|
123 |
|
* Tue Oct 26 2009 Shad L. Lords <slords@mail.com> 1.0.2-5.sme |
124 |
|
- Make preuninstall script not fail on upgrade |
125 |
|
|
126 |
|
* Tue May 26 2009 Shad L. Lords <slords@mail.com> 1.0.2-4.sme |
127 |
|
- Initial build of the kABI-tracking version from 1.0.4. |
128 |
|
- Modified spec and kmodtool(-ppp) |
129 |
|
- Note: weak-modules became available as of CentOS-4.7 |
130 |
|
- Strip the module(s) added |
131 |
|
|
132 |
* Thu Feb 5 2009 Shad L. Lords <slords@mail.com> |
* Thu Feb 5 2009 Shad L. Lords <slords@mail.com> |
133 |
- Fix post scripts [SME: 4864] |
- Fix post scripts [SME: 4864] |
134 |
|
|
137 |
|
|
138 |
* Fri Dec 01 2006 Shad L. Lords <slords@mail.com> |
* Fri Dec 01 2006 Shad L. Lords <slords@mail.com> |
139 |
- Initial package. |
- Initial package. |
|
|
|