]> git.proxmox.com Git - mirror_ovs.git/commitdiff
rhel: use _datadir as path prefix for ovs-kmod-manage.sh, fedora
authorMartin Xu <martinxu9.ovs@gmail.com>
Thu, 20 Sep 2018 19:19:29 +0000 (12:19 -0700)
committerBen Pfaff <blp@ovn.org>
Tue, 25 Sep 2018 22:21:47 +0000 (15:21 -0700)
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 <martinxu9.ovs@gmail.com>
CC: Greg Rose <gvrose8192@gmail.com>
CC: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
rhel/openvswitch-kmod-fedora.spec.in

index 521c11af26fe796b8e1477153557242cc7346640..464d53722783fe8dbd73a7b549e4415b504ac7a0 100644 (file)
@@ -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 <kmestery@cisco.com>