X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=rhel%2Fopenvswitch-kmod-rhel6.spec.in;h=6dbb3771ae6f6bdc2fc9803a1452100d42ea5bac;hb=HEAD;hp=1d1955d6d7539148503708dbaa8246d58f73b9fc;hpb=22bcc0e70becd88bf895c44885d63704affe4284;p=sliver-openvswitch.git diff --git a/rhel/openvswitch-kmod-rhel6.spec.in b/rhel/openvswitch-kmod-rhel6.spec.in index 1d1955d6d..6dbb3771a 100644 --- a/rhel/openvswitch-kmod-rhel6.spec.in +++ b/rhel/openvswitch-kmod-rhel6.spec.in @@ -1,14 +1,16 @@ # Spec file for Open vSwitch kernel modules on Red Hat Enterprise # Linux 6. -# Copyright (C) 2011 Nicira Networks, Inc. +# Copyright (C) 2011, 2012 Nicira, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. This file is offered as-is, # without warranty of any kind. -Name: openvswitch +%define oname openvswitch + +Name: %{oname}-kmod Version: @VERSION@ Release: 1%{?dist} Summary: Open vSwitch kernel module @@ -16,7 +18,8 @@ Summary: Open vSwitch kernel module Group: System/Kernel License: GPLv2 URL: http://openvswitch.org/ -Source0: %{name}-%{version}.tar.gz +Source0: %{oname}-%{version}.tar.gz +Source1: %{oname}-kmod.files BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: %kernel_module_package_buildreqs @@ -24,18 +27,26 @@ BuildRequires: %kernel_module_package_buildreqs # conflicts with the openvswitch-debuginfo package for OVS userspace). %undefine _enable_debug_packages -# Uncomment to build "debug" packages -#kernel_module_package default debug +# Use -D 'kversion 2.6.32-131.6.1.el6.x86_64' to build package +# for specified kernel version. +%{?kversion:%define kernel_version %kversion} + +# Use -D 'kflavors default debug kdump' to build packages for +# specified kernel variants. +%{!?kflavors:%define kflavors default} -# Build only for standard kernel variant(s) -%kernel_module_package default +%kernel_module_package -n %{oname} -f %{SOURCE1} %kflavors %description Open vSwitch Linux kernel module. %prep -%setup +%setup -n %{oname}-%{version} +cat > %{oname}.conf << EOF +override %{oname} * extra/%{oname} +override %{oname} * weak-updates/%{oname} +EOF %build for flavor in %flavors_to_build; do @@ -46,11 +57,13 @@ done %install export INSTALL_MOD_PATH=$RPM_BUILD_ROOT -export INSTALL_MOD_DIR=extra/%{name} +export INSTALL_MOD_DIR=extra/%{oname} for flavor in %flavors_to_build ; do make -C %{kernel_source $flavor} modules_install \ - M=$PWD/_$flavor/datapath/linux + M="`pwd`"/_$flavor/datapath/linux done +install -d %{buildroot}%{_sysconfdir}/depmod.d/ +install -m 644 %{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/ %clean rm -rf $RPM_BUILD_ROOT