From: Russell Bryant Date: Thu, 28 Jan 2016 20:23:00 +0000 (-0500) Subject: rhel: Make openvswitch-kmod-fedora.spec build. X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=8c7c9dd2a9a76c61e73c39226177d58ea9490d32 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 Suggested-by: Flavio Leitner Acked-by: Flavio Leitner Acked-by: Gurucharan Shetty --- 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