]>
Commit | Line | Data |
---|---|---|
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 | ||
13 | Name: %{oname}-kmod | |
c434706a BP |
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/ | |
1821f032 | 21 | Source0: %{oname}-%{version}.tar.gz |
9c12d2ec | 22 | Source1: %{oname}-kmod.files |
c434706a BP |
23 | BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) |
24 | BuildRequires: %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 | |
41 | Open vSwitch Linux kernel module. | |
42 | ||
43 | %prep | |
44 | ||
1821f032 | 45 | %setup -n %{oname}-%{version} |
9c12d2ec GS |
46 | cat > %{oname}.conf << EOF |
47 | override %{oname} * extra/%{oname} | |
48 | override %{oname} * weak-updates/%{oname} | |
49 | EOF | |
c434706a BP |
50 | |
51 | %build | |
52 | for 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 |
56 | done |
57 | ||
58 | %install | |
59 | export INSTALL_MOD_PATH=$RPM_BUILD_ROOT | |
1821f032 | 60 | export INSTALL_MOD_DIR=extra/%{oname} |
c434706a BP |
61 | for 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 | 67 | done |
9c12d2ec GS |
68 | install -d %{buildroot}%{_sysconfdir}/depmod.d/ |
69 | install -m 644 %{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/ | |
c434706a BP |
70 | |
71 | %clean | |
72 | rm -rf $RPM_BUILD_ROOT |