]> git.proxmox.com Git - mirror_frr.git/commitdiff
redhat: fix upgrade script (%postun), remove invalid mpls package selection (it's...
authorMartin Winter <mwinter@opensourcerouting.org>
Tue, 18 Apr 2017 01:34:32 +0000 (18:34 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 6 Jun 2017 18:39:26 +0000 (14:39 -0400)
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
redhat/frr.spec.in

index 4c6875aaf5b10060bd359959625d73dbf7a32b13..46cdb9e1343ef3644e3d4245de0b01510af7ff02 100644 (file)
@@ -16,7 +16,6 @@
 %{!?with_ospfapi:       %global  with_ospfapi       1 }
 %{!?with_irdp:          %global  with_irdp          1 }
 %{!?with_rtadv:         %global  with_rtadv         1 }
-%{!?with_mpls:          %global  with_mpls          0 }
 %{!?with_ldpd:          %global  with_ldpd          0 }
 %{!?with_nhrpd:         %global  with_nhrpd         1 }
 %{!?with_shared:        %global  with_shared        1 }
@@ -217,9 +216,9 @@ developing OSPF-API and frr applications.
 %endif
     --enable-vtysh \
 %if %{with_ospfclient}
-    --enable-ospfclient=yes \
+    --enable-ospfclient \
 %else
-    --enable-ospfclient=no\
+    --disable-ospfclient\
 %endif
 %if %{with_ospfapi}
     --enable-ospfapi=yes \
@@ -236,11 +235,6 @@ developing OSPF-API and frr applications.
 %else
     --enable-rtadv=no \
 %endif
-%if %{with_mpls}
-    --enable-mpls=yes \
-%else
-    --disable-mpls \
-%endif
 %if %{with_ldpd}
     --enable-ldpd \
 %else
@@ -436,85 +430,19 @@ fi
 
 %postun
 if [ "$1" -ge 1 ]; then
-    # Find out which daemons need to be restarted.
-    for daemon in %all_daemons ; do
-        if [ x"${daemon}" != x"" ] ; then
-            if [ -f /var/lock/subsys/${daemon} ]; then
-                eval restart_${daemon}=yes
-            else
-                eval restart_${daemon}=no
-            fi
-        fi
-    done
-    # Rename restart flags for daemons handled specially.
-    running_zebra="$restart_zebra"
-    restart_zebra=no
-    %if %{with_watchfrr}
-        running_watchfrr="$restart_watchfrr"
-        restart_watchfrr=no
-    %endif
-    
+    #
+    # Upgrade from older version
+    #
     %if "%{initsystem}" == "systemd"
         ##
         ## Systemd Version
         ##
-        # No watchfrr for systemd version
-        #
-        # Stop all daemons other than zebra.
-        for daemon in %all_daemons ; do
-            if [ x"${daemon}" != x"" ] ; then
-                eval restart=\$restart_${daemon}
-                [ "$restart" = yes ] && \
-                    %systemd_postun ${daemon}.service
-                :
-            fi
-        done
-        # Restart zebra.
-        [ "$running_zebra" = yes ] && \
-            %systemd_postun_with_restart $daemon.service
-        # Start all daemons other than zebra.
-        for daemon in %all_daemons ; do
-            if [ x"${daemon}" != x"" ] ; then
-                eval restart=\$restart_${daemon}
-                [ "$restart" = yes ] && \
-                    %systemd_post ${daemon}.service
-                :
-            fi
-        done
+        %systemd_postun frr.service
     %else
         ##
         ## init.d Version
         ##
-        %if %{with_watchfrr}
-            # Stop watchfrr first.
-            [ "$running_watchfrr" = yes ] && \
-                /etc/rc.d/init.d/watchfrr stop >/dev/null 2>&1
-        %endif
-        # Stop all daemons other than zebra and watchfrr.
-        for daemon in %all_daemons ; do
-            if [ x"${daemon}" != x"" ] ; then
-                eval restart=\$restart_${daemon}
-                [ "$restart" = yes ] && \
-                    /etc/rc.d/init.d/${daemon} stop >/dev/null 2>&1
-            fi
-        done
-        # Restart zebra.
-        [ "$running_zebra" = yes ] && \
-            /etc/rc.d/init.d/zebra restart >/dev/null 2>&1
-        # Start all daemons other than zebra and watchfrr.
-        for daemon in %all_daemons ; do
-            if [ x"${daemon}" != x"" ] ; then
-                eval restart=\$restart_${daemon}
-                [ "$restart" = yes ] && \
-                    /etc/rc.d/init.d/${daemon} start >/dev/null 2>&1
-            fi
-        done
-        %if %{with_watchfrr}
-            # Start watchfrr last.
-            # Avoid postun scriptlet error if watchfrr is not running.
-            [ "$running_watchfrr" = yes ] && \
-                /etc/rc.d/init.d/watchfrr start >/dev/null 2>&1 || :
-        %endif
+        /etc/rc.d/init.d/frr restart >/dev/null 2>&1
     %endif
 fi
 
@@ -526,7 +454,7 @@ fi
     if [ "$1" = "0" ]; then
         for daemon in %all_daemons ; do
             if [ x"${daemon}" != x"" ] ; then
-                %systemd_preun ${daemon}.service
+                %systemd_preun frr.service
             fi
         done
     fi