This patch fixes the path for ovs-kmod-manage.sh script in the
openvswitch-kmod RPM in fedora spec file. Currently the path prefix is
hard coded to /usr/share. Use %{_datadir} instead.

Fixes 22c33c303932 (rhel: support kmod build against mulitple kernel
versions, fedora)

Signed-off-by: Martin Xu <[email protected]>
CC: Greg Rose <[email protected]>
CC: Flavio Leitner <[email protected]>
---
 rhel/openvswitch-kmod-fedora.spec.in | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/rhel/openvswitch-kmod-fedora.spec.in 
b/rhel/openvswitch-kmod-fedora.spec.in
index 521c11a..464d537 100644
--- a/rhel/openvswitch-kmod-fedora.spec.in
+++ b/rhel/openvswitch-kmod-fedora.spec.in
@@ -74,7 +74,7 @@ for kv in %{kversion}; do
 done
 install -d -m 0755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
 install -p -m 0755 rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh \
-    $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/ovs-kmod-manage.sh
+    $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -88,15 +88,15 @@ IFS='.\|-' read mainline_major mainline_minor 
mainline_patch major_rev \
 if [ "$mainline_major" = "3" ] && [ "$mainline_minor" = "10" ]; then
     if [ "$installed_major" = "327" ] || [ "$installed_major" = "693" ]; then
         # For RHEL 7.2 and 7.4
-        if [ -x "/usr/share/openvswitch/scripts/ovs-kmod-manage.sh" ]; then
-            /usr/share/openvswitch/scripts/ovs-kmod-manage.sh
+        if [ -x "%{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh" ]; then
+            %{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh
         fi
     fi
 elif [ "$mainline_major" = "4" ] && [ "$mainline_minor" = "4" ] && \
      [ "$mainline_patch" -ge "73" ]; then
      # For SLES 12 SP3
-     if [ -x "/usr/share/openvswitch/scripts/ovs-kmod-manage.sh" ]; then
-         /usr/share/openvswitch/scripts/ovs-kmod-manage.sh
+     if [ -x "%{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh" ]; then
+         %{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh
      fi
 else
     # Ensure that modprobe will find our modules.
@@ -125,7 +125,7 @@ fi
 /lib/modules/*/extra/openvswitch/*.ko
 /etc/depmod.d/kmod-openvswitch.conf
 %exclude /lib/modules/*/modules.*
-%attr(755,root,root) /usr/share/openvswitch/scripts/ovs-kmod-manage.sh
+%attr(755,root,root) %{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh
 
 %changelog
 * Wed Sep 21 2011 Kyle Mestery <[email protected]>
-- 
1.8.3.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to