Global replace of Nicira Networks.
[sliver-openvswitch.git] / rhel / openvswitch-kmod-rhel6.spec.in
1 # Spec file for Open vSwitch kernel modules on Red Hat Enterprise
2 # Linux 6.
3
4 # Copyright (C) 2011, 2012 Nicira, Inc.
5 #
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.
10
11 %define oname openvswitch
12
13 Name:           %{oname}-kmod
14 Version:        @VERSION@
15 Release:        1%{?dist}
16 Summary:        Open vSwitch kernel module
17
18 Group:          System/Kernel
19 License:        GPLv2
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
24
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
28
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}
32
33 # Use -D 'kflavors default debug kdump' to build packages for
34 # specified kernel variants.
35 %{!?kflavors:%define kflavors default}
36
37 %kernel_module_package -n %{oname} %kflavors
38
39 %description
40 Open vSwitch Linux kernel module.
41
42 %prep
43
44 %setup -n %{oname}-%{version}
45
46 %build
47 for flavor in %flavors_to_build; do
48         mkdir _$flavor
49         (cd _$flavor && ../configure --with-linux="%{kernel_source $flavor}")
50         %{__make} -C _$flavor/datapath/linux %{?_smp_mflags}
51 done
52
53 %install
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
59 done
60
61 %clean
62 rm -rf $RPM_BUILD_ROOT