1 # Spec file for Open vSwitch kernel modules on Red Hat Enterprise
4 # Copyright (C) 2011, 2012 Nicira, Inc.
6 # Copying and distribution of this file, with or without modification,
7 # are permitted in any medium without royalty provided the copyright
8 # notice and this notice are preserved. This file is offered as-is,
9 # without warranty of any kind.
11 %define oname openvswitch
16 Summary: Open vSwitch kernel module
20 URL: http://openvswitch.org/
21 Source0: %{oname}-%{version}.tar.gz
22 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
23 BuildRequires: %kernel_module_package_buildreqs
25 # Without this we get an empty openvswitch-debuginfo package (whose name
26 # conflicts with the openvswitch-debuginfo package for OVS userspace).
27 %undefine _enable_debug_packages
29 # Use -D 'kversion 2.6.32-131.6.1.el6.x86_64' to build package
30 # for specified kernel version.
31 %{?kversion:%define kernel_version %kversion}
33 # Use -D 'kflavors default debug kdump' to build packages for
34 # specified kernel variants.
35 %{!?kflavors:%define kflavors default}
37 %kernel_module_package -n %{oname} %kflavors
40 Open vSwitch Linux kernel module.
44 %setup -n %{oname}-%{version}
47 for flavor in %flavors_to_build; do
49 (cd _$flavor && ../configure --with-linux="%{kernel_source $flavor}")
50 %{__make} -C _$flavor/datapath/linux %{?_smp_mflags}
54 export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
55 export INSTALL_MOD_DIR=extra/%{oname}
56 for flavor in %flavors_to_build ; do
57 make -C %{kernel_source $flavor} modules_install \
58 M="`pwd`"/_$flavor/datapath/linux
62 rm -rf $RPM_BUILD_ROOT