summaryrefslogtreecommitdiff
path: root/rhel
diff options
context:
space:
mode:
authorRussell Bryant <russell@ovn.org>2016-01-28 15:23:00 -0500
committerRussell Bryant <russell@ovn.org>2016-01-29 16:25:23 -0500
commit8c7c9dd2a9a76c61e73c39226177d58ea9490d32 (patch)
tree786d3dd169ff37347759dd2d20852ce77f1f7e0d /rhel
parentbf1f0d35ceb9ab8112b8ce3e4fa436f92bdb6410 (diff)
downloadopenvswitch-8c7c9dd2a9a76c61e73c39226177d58ea9490d32.tar.gz
rhel: Make openvswitch-kmod-fedora.spec build.
I tried building this package on Fedora 23 and it failed for a couple of different reasons. This package tried to install modules without specifying the rpm build root as an install prefix. The result was just attempting to install the modules on the system, which luckily failed since I wasn't running rpmbuild as root. The package also then tried to manually install the modules into the rpm build root, which is unnecessary once modules_install is pointed to the right place. Finally, the package build failed with a completely unhelpful error which turned out to be because it didn't know how to generate a debuginfo pacakge. I turned off the debug package for now. At least it builds now, which is an improvement. Signed-off-by: Russell Bryant <russell@ovn.org> Suggested-by: Flavio Leitner <fbl@redhat.com> Acked-by: Flavio Leitner <fbl@redhat.com> Acked-by: Gurucharan Shetty <guru@ovn.org>
Diffstat (limited to 'rhel')
-rw-r--r--rhel/openvswitch-kmod-fedora.spec.in24
1 files changed, 15 insertions, 9 deletions
diff --git a/rhel/openvswitch-kmod-fedora.spec.in b/rhel/openvswitch-kmod-fedora.spec.in
index ecea16c8b..ea89d15c8 100644
--- a/rhel/openvswitch-kmod-fedora.spec.in
+++ b/rhel/openvswitch-kmod-fedora.spec.in
@@ -7,6 +7,8 @@
# notice and this notice are preserved. This file is offered as-is,
# without warranty of any kind.
+%global debug_package %{nil}
+
#%define kernel 3.1.5-1.fc16.x86_64
#define kernel %{kernel_source}
%{?kversion:%define kernel %kversion}
@@ -34,28 +36,32 @@ traffic. This package contains the kernel modules.
%setup -q -n openvswitch-%{version}
%build
-./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --with-linux=/lib/modules/%{kernel}/build --enable-ssl
+%configure --with-linux=/lib/modules/%{kernel}/build --enable-ssl
make %{_smp_mflags} -C datapath/linux
%install
rm -rf $RPM_BUILD_ROOT
-make -C datapath/linux modules_install
-
-install -d -m 755 $RPM_BUILD_ROOT/lib/modules/%{kernel}/kernel/extra/openvswitch
-find datapath/linux -name *.ko -exec install -m 755 \{\} $RPM_BUILD_ROOT/lib/modules/%{kernel}/kernel/extra/openvswitch \;
+make INSTALL_MOD_PATH=$RPM_BUILD_ROOT -C datapath/linux modules_install
+mkdir -p $RPM_BUILD_ROOT/etc/depmod.d
+for module in $RPM_BUILD_ROOT/lib/modules/%{kernel}/extra/*.ko
+do
+ modname="$(basename ${module})"
+ echo "override ${modname%.ko} * extra" >> \
+ $RPM_BUILD_ROOT/etc/depmod.d/kmod-openvswitch.conf
+done
%clean
rm -rf $RPM_BUILD_ROOT
-%preun
-
%post
# Ensure that modprobe will find our modules.
depmod %{kernel}
%files
-%defattr(-,root,root)
-/lib/modules/%{kernel}/kernel/extra/openvswitch/*.ko
+%defattr(0644,root,root)
+/lib/modules/%{kernel}/extra/*.ko
+/etc/depmod.d/kmod-openvswitch.conf
+%exclude /lib/modules/%{kernel}/modules.*
%changelog
* Wed Sep 21 2011 Kyle Mestery <kmestery@cisco.com>