[ovs-dev] [PATCH 2/3] rhel: add ability to build kmod packages for arbitrary kernel version/variant(s)

Alexey I. Froloff raorn at altlinux.org
Thu Sep 1 14:01:12 UTC 2011


Usage:

rpmbuild --rebuild \
  -D 'kversion KERNEL_VERSION' \
  -D 'kflavors FLAVORS TO BUILD' \
  openvswitch-kmod-VERSION-RELEASE.src.rpm

Signed-off-by: Alexey I. Froloff <raorn at altlinux.org>
---
 rhel/openvswitch-kmod-rhel6.spec.in |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/rhel/openvswitch-kmod-rhel6.spec.in b/rhel/openvswitch-kmod-rhel6.spec.in
index e495c4b..9a03964 100644
--- a/rhel/openvswitch-kmod-rhel6.spec.in
+++ b/rhel/openvswitch-kmod-rhel6.spec.in
@@ -26,11 +26,17 @@ BuildRequires:  %kernel_module_package_buildreqs
 # conflicts with the openvswitch-debuginfo package for OVS userspace).
 %undefine _enable_debug_packages
 
-# Uncomment to build "debug" packages
-#kernel_module_package default debug
+# Use -D 'kversion 2.6.32-131.6.1.el6.x86_64' to build package
+# for specified kernel version.
+%{!?kversion:%define kversion %(uname -r)}
 
-# Build only for standard kernel variant(s)
-%kernel_module_package -n %{oname} default
+# Use -D 'kflavors default debug kdump' to build packages for
+# specified kernel variants.
+%{!?kflavors:%define kflavors default}
+
+%define kernel_version %kversion
+
+%kernel_module_package -n %{oname} %kflavors
 
 %description
 Open vSwitch Linux kernel module.
-- 
1.7.3.4




More information about the dev mailing list