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 Source1: %{oname}-kmod.files
23 BuildRoot: %
(mktemp
-ud
%{_tmppath}/%{name}-%{version}-%{release}-XXXXXX
)
24 BuildRequires
: %kernel_module_package_buildreqs
26 # Without this we get an empty openvswitch-debuginfo package (whose name
27 # conflicts with the openvswitch-debuginfo package for OVS userspace).
28 %undefine _enable_debug_packages
30 # Use -D 'kversion 2.6.32-131.6.1.el6.x86_64' to build package
31 # for specified kernel version.
32 %{?kversion:%define kernel_version %kversion}
34 # Use -D 'kflavors default debug kdump' to build packages for
35 # specified kernel variants.
36 %{!?kflavors:%define kflavors default}
38 %kernel_module_package -n
%{oname} -f %{SOURCE1} %kflavors
41 Open vSwitch Linux kernel module.
45 %setup -n
%{oname}-%{version}
46 cat
> %{oname}.conf
<< EOF
47 override
%{oname} * extra/%{oname}
48 override
%{oname} * weak-updates/%{oname}
52 for flavor
in %flavors_to_build; do
54 (cd _$flavor
&& ..
/configure
--with
-linux
="
%{kernel_source $flavor}"
)
55 %{__make} -C _$flavor/datapath/linux %{?_smp_mflags}
59 export INSTALL_MOD_PATH
=$RPM_BUILD_ROOT
60 export INSTALL_MOD_DIR
=extra
/%{oname}
61 for flavor
in %flavors_to_build ; do
62 make -C
%{kernel_source $flavor} modules_install \
63 M
="`
pwd`"
/_$flavor
/datapath
/linux
65 # Cleanup unnecessary kernel-generated module dependency files.
66 find $INSTALL_MOD_PATH
/lib
/modules
-iname 'modules.
*'
-exec rm {} \
;
68 install -d
%{buildroot}%{_sysconfdir}/depmod.d
/
69 install -m
644 %{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d
/
72 rm -rf $RPM_BUILD_ROOT