]> git.proxmox.com Git - mirror_ovs.git/blame - rhel/openvswitch-kmod-rhel6.spec.in
ovn-nbctl: Fix leak of ovsdb_idl_txn.
[mirror_ovs.git] / rhel / openvswitch-kmod-rhel6.spec.in
CommitLineData
c434706a
BP
1# Spec file for Open vSwitch kernel modules on Red Hat Enterprise
2# Linux 6.
3
e0edde6f 4# Copyright (C) 2011, 2012 Nicira, Inc.
c434706a
BP
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
1821f032
AF
11%define oname openvswitch
12
13Name: %{oname}-kmod
c434706a
BP
14Version: @VERSION@
15Release: 1%{?dist}
16Summary: Open vSwitch kernel module
17
18Group: System/Kernel
19License: GPLv2
20URL: http://openvswitch.org/
1821f032 21Source0: %{oname}-%{version}.tar.gz
9c12d2ec 22Source1: %{oname}-kmod.files
c434706a
BP
23BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
24BuildRequires: %kernel_module_package_buildreqs
25
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
29
6c9b8ee4
AF
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}
c434706a 33
6c9b8ee4
AF
34# Use -D 'kflavors default debug kdump' to build packages for
35# specified kernel variants.
36%{!?kflavors:%define kflavors default}
37
9c12d2ec 38%kernel_module_package -n %{oname} -f %{SOURCE1} %kflavors
c434706a
BP
39
40%description
41Open vSwitch Linux kernel module.
42
43%prep
44
1821f032 45%setup -n %{oname}-%{version}
9c12d2ec
GS
46cat > %{oname}.conf << EOF
47override %{oname} * extra/%{oname}
48override %{oname} * weak-updates/%{oname}
49EOF
c434706a
BP
50
51%build
52for flavor in %flavors_to_build; do
53 mkdir _$flavor
8a2d6596 54 (cd _$flavor && ../configure --with-linux="%{kernel_source $flavor}")
22bcc0e7 55 %{__make} -C _$flavor/datapath/linux %{?_smp_mflags}
c434706a
BP
56done
57
58%install
59export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
1821f032 60export INSTALL_MOD_DIR=extra/%{oname}
c434706a
BP
61for flavor in %flavors_to_build ; do
62 make -C %{kernel_source $flavor} modules_install \
37d03458 63 M="`pwd`"/_$flavor/datapath/linux
ba119c13
AW
64
65 # Cleanup unnecessary kernel-generated module dependency files.
66 find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
c434706a 67done
9c12d2ec
GS
68install -d %{buildroot}%{_sysconfdir}/depmod.d/
69install -m 644 %{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/
c434706a
BP
70
71%clean
72rm -rf $RPM_BUILD_ROOT