]> git.proxmox.com Git - mirror_frr.git/blobdiff - redhat/frr.spec.in
Merge remote-tracking branch 'origin/stable/2.0'
[mirror_frr.git] / redhat / frr.spec.in
index bf4a362972af26e6ea8cdf90d809ba36c2aabbe2..674ccb2d6fed6048e3f88ad9f48c3ba5c7f7d571 100644 (file)
 %{expand: %%global rpmversion %(echo '@VERSION@' | tr [:blank:]- _ )}
 %define         frrversion   @VERSION@
 
-#### Check version of texi2html 
-# Old versions don't support "--number-footnotes" option.
-%{expand: %%global texi2htmlversion %(if [[ -f /usr/bin/texi2html ]]; then /usr/bin/texi2html --version | cut -d. -f1; else echo 0; fi)}
-
 #### Check for systemd or init.d (upstart)
 # Check for init.d (upstart) as used in CentOS 6 or systemd (ie CentOS 7)
-%{expand: %%global initsystem %(if [[ `/sbin/init --version 2> /dev/null` =~ upstart ]]; then echo upstart; elif [[ `file /sbin/init` =~ "symbolic link to \`../lib/systemd/systemd'" ]]; then echo systemd; elif [[ `systemctl` =~ -\.mount ]]; then echo systemd; fi)}
+%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1210
+    %global initsystem systemd
+%else
+%if (0%{?fedora} && 0%{?fedora} < 15) || (0%{?rhel} && 0%{?rhel} < 7)
+    %global initsystem upstart
+%else
+    %{expand: %%global initsystem %(if [[ `/sbin/init --version 2> /dev/null` =~ upstart ]]; then echo upstart; elif [[ `readlink -f /sbin/init` = /usr/lib/systemd/systemd ]]; then echo systemd; elif [[ `systemctl` =~ -\.mount ]]; then echo systemd; fi)}
+%endif
+%endif
 #
 # If init system is systemd, then always disable watchfrr
 #
 
 #### Check for RedHat 6.x or CentOS 6.x - they are too old to support PIM. 
 ####   Always disable it on these old systems unconditionally
-%{expand: %%global redhat6 %(if [[ `cat /etc/redhat-release 2> /dev/null` =~ release\ 6\. ]]; then echo 6; else echo 0; fi)}
 #
-# if CentOS 6 / RedHat 6, then disable PIMd
-%if "%{redhat6}" == "6"
+# if CentOS / RedHat and version < 7, then disable PIMd (too old, won't work)
+%if 0%{?rhel} && 0%{?rhel} < 7
     %global  with_pimd  0
 %endif
 
@@ -304,7 +307,6 @@ developing OSPF-API and frr applications.
 %else
     --disable-bgp-vnc \
 %endif
-    --enable-gcc-rdynamic \
     --enable-isisd=yes \
 %if "%{initsystem}" == "systemd"
     --enable-systemd=yes \
@@ -314,11 +316,11 @@ developing OSPF-API and frr applications.
 make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
 
 pushd doc
-%if %{texi2htmlversion} < 5
+if [ $(texi2html --version | cut -d. -f1) -lt 5 ]; then
 texi2html --number-sections frr.texi
-%else
+else
 texi2html --number-footnotes  --number-sections frr.texi
-%endif
+fi
 popd
 
 %install