rhel: rename RHEL6 kmod source package
[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 Nicira Networks, 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 # Uncomment to build "debug" packages
30 #kernel_module_package default debug
31
32 # Build only for standard kernel variant(s)
33 %kernel_module_package -n %{oname} default
34
35 %description
36 Open vSwitch Linux kernel module.
37
38 %prep
39
40 %setup -n %{oname}-%{version}
41
42 %build
43 for flavor in %flavors_to_build; do
44         mkdir _$flavor
45         (cd _$flavor && ../configure --with-linux="%{kernel_source $flavor}")
46         %{__make} -C _$flavor/datapath/linux %{?_smp_mflags}
47 done
48
49 %install
50 export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
51 export INSTALL_MOD_DIR=extra/%{oname}
52 for flavor in %flavors_to_build ; do
53          make -C %{kernel_source $flavor} modules_install \
54                  M=$PWD/_$flavor/datapath/linux
55 done
56
57 %clean
58 rm -rf $RPM_BUILD_ROOT