I've updated and synced macros with SuSE/Novell.

This commit is contained in:
Jon Masters 2006-10-18 18:22:04 +00:00
parent 141cba90d8
commit 0508811c5f
3 changed files with 78 additions and 85 deletions

View File

@ -103,9 +103,13 @@ EOF
Requires: ${kmod_name}-kmod-common >= %{?epoch:%{epoch}:}%{version}
Requires(post): /sbin/depmod
Requires(postun): /sbin/depmod
BuildRequires: kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}
EOF
if [ "no" != "$kmp_nobuildreqs" ]
then
echo "BuildRequires: kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}"
fi
if [ "" != "$kmp_override_preamble" ]
then
cat "$kmp_override_preamble"

View File

@ -1,86 +1,71 @@
diff -urN redhat-rpm-config-8.0.45_orig/macros redhat-rpm-config-8.0.45/macros
--- redhat-rpm-config-8.0.45_orig/macros 2005-08-16 20:27:33.000000000 -0400
+++ redhat-rpm-config-8.0.45/macros 2006-10-17 20:15:08.000000000 -0400
@@ -156,3 +157,82 @@
diff -urN redhat-rpm-config-8.0.45/macros redhat-rpm-config-8.0.45_orig/macros
--- redhat-rpm-config-8.0.45/macros 2006-10-18 14:11:55.000000000 -0400
+++ redhat-rpm-config-8.0.45_orig/macros 2005-08-16 20:27:33.000000000 -0400
@@ -157,67 +156,3 @@
# Disable lookups
%_hkp_keyserver %{nil}
+
+%ktest() %{expand:%( \
+ echo "%1" \
+)}
+
+# kernel_source kversion kflavor
+%old_kernel_source() %{expand:%( \
+ if [ "default" == "%2" ] \
+ then \
+ echo "/usr/src/kernels/%1-%{_target_cpu}" \
+ else \
+ echo "/usr/src/kernels/%1-%2-%{_target_cpu}" \
+ fi \
+)}
+
+# Use these macros to differentiate between RH and other KMP implementation(s).
+redhat_kernel_module_package 1
+kernel_module_package_release 1
+
+# kernel_module_package [ -n name ] [ -v version ] [ -r release ] [ -s script ]
+ [ -f filelist] [ -x ] [ -p preamble ] flavor flavor ...
+
+%kernel_module_script kernel_source() { \
+ if [ "default" == "$1" ]; then \
+ echo "/usr/src/kernels/%kverrel-%{_target_cpu}" ; \
+ else \
+ echo "/usr/src/kernels/%kverrel-$1-%{_target_cpu}" ; \
+ fi }
+
+%kernel_module_package(n:v:r:s:f:xp:) %{expand:%( \
+ %global __spec_prep_pre %{__spec_prep_pre};%{kernel_module_script}
+ %global __spec_build_pre %{__spec_build_pre};%{kernel_module_script}
+ %global __spec_install_pre %{__spec_install_pre};%{kernel_module_script}
+ %define kmodtool %{-s*}%{!-s:/usr/lib/rpm/redhat/kmodtool} \
+ %define kmp_version %{-v*}%{!-v:%{version}} \
+ %define kmp_release %{-r*}%{!-r:%{release}} \
+ machine=`uname -m` \
+ %{!?kversion: %{expand: %%global kversion %(uname -r)}} \
+ %global kverrel %(%{kmodtool} verrel %{?kversion} 2>/dev/null) \
+ flavors="default" \
+ if [ "i686" == "$machine" ] \
+ then
+ flavors="$flavors smp" \
+ fi
+ if [ "i686" == "$machine" ] || [ "x86_64" == "$machine" ] \
+ then \
+ xenver=$(rpm -q kernel-xen-devel-%{kverrel}|head -n 1)\
+ kdver=$(rpm -q kernel-kdump-devel-%{kverrel}|head -n 1)\
+ if [ "kernel-xen-devel-%{kverrel}" == "$xenver" ] \
+ then \
+ flavors="$flavors xen" \
+ fi \
+ if [ "kernel-kdump-devel-%{kverrel}" == "$kdver" ] \
+ then \
+ flavors="$flavors kdump" \
+ fi \
+ fi \
+ if [ -z "%*" ]; then \
+ flavors_to_build=$flavors \
+ elif [ -z "%{-x}" ]; then \
+ flavors_to_build="%*" \
+ else \
+ flavors_to_build=$flavors \
+ for i in %* \
+ do \
+ flavors_to_build=${flavors_to_build//$i/} \
+ done \
+ fi \
+ echo "%%global flavors_to_build ${flavors_to_build:-%%nil}" \
+ if [ ! -z "%{-f*}" ] \
+ then \
+ filelist="%{-f*}" \
+ fi \
+ if [ ! -z "%{-p*}" ] \
+ then \
+ preamble="%{-p*}" \
+ fi \
+ kmp_override_filelist="$filelist" kmp_override_preamble="$preamble" %{kmodtool} rpmtemplate_kmp %{-n*}%{!-n:%name} %{kverrel} $flavors_to_build 2>/dev/null \
+)}
-
-# Use these macros to differentiate between RH and other KMP implementation(s).
-redhat_kernel_module_package 1
-kernel_module_package_release 1
-
-#kernel_module_package [ -n name ] [ -v version ] [ -r release ] [ -s script ]
-# [ -f filelist] [ -x ] [ -p preamble ] flavor flavor ...
-
-%kernel_module_package_buildreqs %global kmodtool_generate_buildreqs 1 \
- kernel-devel
-
-%kernel_module_package(n:v:r:s:f:xp:) %{expand:%( \
- %define kmodtool %{-s*}%{!-s:/usr/lib/rpm/redhat/kmodtool} \
- %define kmp_version %{-v*}%{!-v:%{version}} \
- %define kmp_release %{-r*}%{!-r:%{release}} \
- %define latest_kernel %(rpm -q --qf '%{VERSION}-%{RELEASE}\\\\n' `rpm -q kernel-devel | /usr/lib/rpm/redhat/rpmsort -r | head -n 1` | head -n 1) \
- %{!?kernel_version:%{expand:%%global kernel_version %{latest_kernel}}} \
- %global kverrel %(%{kmodtool} verrel %{?kernel_version} 2>/dev/null) \
- flavors="default" \
- if [ "i686" == "%{_target_cpu}" ] \
- then
- flavors="$flavors smp" \
- fi
- if [ "i686" == "%{_target_cpu}" ] || [ "x86_64" == "%{_target_cpu}" ] \
- then \
- xenver=$(rpm -q kernel-xen-devel-%{kverrel}|head -n 1)\
- kdver=$(rpm -q kernel-kdump-devel-%{kverrel}|head -n 1)\
- if [ "kernel-xen-devel-%{kverrel}" == "$xenver" ] \
- then \
- flavors="$flavors xen" \
- fi \
- if [ "kernel-kdump-devel-%{kverrel}" == "$kdver" ] \
- then \
- flavors="$flavors kdump" \
- fi \
- fi \
- if [ -z "%*" ]; then \
- flavors_to_build=$flavors \
- elif [ -z "%{-x}" ]; then \
- flavors_to_build="%*" \
- else \
- flavors_to_build=" $flavors "\
- echo "[$flavors_to_build]" >/tmp/tmp.txt
- for i in %* \
- do \
- flavors_to_build=${flavors_to_build//$i /}
- done \
- fi \
- echo "%%global flavors_to_build ${flavors_to_build:-%%nil}" \
- echo "%%global kernel_source() /usr/src/kernels/%kverrel-\\\$([ %%%%{1} = default ] || echo "%%%%{1}-")%_target_cpu" \
- if [ ! -z "%{-f*}" ] \
- then \
- filelist="%{-f*}" \
- fi \
- if [ ! -z "%{-p*}" ] \
- then \
- preamble="%{-p*}" \
- fi \
- if [ -z "%{kmodtool_generate_buildreqs}" ] \
- then \
- nobuildreqs="yes" \
- fi \
- kmp_override_filelist="$filelist" kmp_override_preamble="$preamble" kmp_nobuildreqs="$buildreqs" %{kmodtool} rpmtemplate_kmp %{-n*}%{!-n:%name} %{kverrel} $flavors_to_build 2>/dev/null \
-)}

View File

@ -1,7 +1,7 @@
Summary: Red Hat specific rpm configuration files.
Name: redhat-rpm-config
Version: 8.0.45
Release: 10%{dist}
Release: 11%{dist}
License: GPL
Group: Development/System
Source: redhat-rpm-config-%{version}.tar.gz
@ -46,6 +46,10 @@ rm -rf ${RPM_BUILD_ROOT}
%{_prefix}/lib/rpm/redhat
%changelog
* Wed Oct 18 2006 Jon Masters <jcm@redhat.com> 8.0.45-11
- Synced kernel_module_package semantics with SuSE.
- Updated kmodtool.
* Tue Oct 17 2006 Jon Masters <jcm@redhat.com> 8.0.45-10
- Updated kernel_module_package.