contrib/rpm: turn %with_ifcfg_rh into a bcond

This commit is contained in:
Lubomir Rintel
2024-05-29 15:09:00 +02:00
parent e4660336e7
commit 2066e1743e

View File

@@ -166,13 +166,13 @@
%endif
%if 0%{?rhel} >= 10
%global with_ifcfg_rh 0
%bcond_with ifcfg_rh
%global split_ifcfg_rh 0
%elif 0%{?fedora} >= 36
%global with_ifcfg_rh 1
%bcond_without ifcfg_rh
%global split_ifcfg_rh 1
%else
%global with_ifcfg_rh 1
%bcond_without ifcfg_rh
%global split_ifcfg_rh 0
%endif
@@ -567,7 +567,7 @@ This package is intended to be installed by default for server
deployments.
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%package dispatcher-routing-rules
Summary: NetworkManager dispatcher file for advanced routing rules
Group: System Environment/Base
@@ -626,7 +626,7 @@ like Aliyun, Azure, EC2, GCP are supported.
%endif
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%package initscripts-updown
Summary: Legacy ifup/ifdown scripts for NetworkManager that replace initscripts (network-scripts)
Group: System Environment/Base
@@ -753,7 +753,7 @@ Preferably use nmcli instead.
-Ddbus_conf_dir=%{dbus_sys_dir} \
-Dtests=yes \
-Dvalgrind=no \
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
-Difcfg_rh=true \
%else
-Difcfg_rh=false \
@@ -905,7 +905,7 @@ autoreconf --install --force
--enable-more-warnings=yes \
%endif
--with-valgrind=no \
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
--enable-ifcfg-rh=yes \
%else
--enable-ifcfg-rh=no \
@@ -972,7 +972,7 @@ cp %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts
cp %{SOURCE9} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt
%endif
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
cp examples/dispatcher/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/
ln -s ../no-wait.d/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/pre-up.d/
ln -s ../10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/no-wait.d/
@@ -992,7 +992,7 @@ mkdir -p %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
cp valgrind.suppressions %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
%endif
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
touch %{buildroot}%{_sbindir}/ifup
touch %{buildroot}%{_sbindir}/ifdown
%endif
@@ -1038,7 +1038,7 @@ fi
%systemd_post %{systemd_units}
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%post initscripts-updown
if [ -f %{_sbindir}/ifup -a ! -L %{_sbindir}/ifup ]; then
# initscripts package too old, won't let us set an alternative
@@ -1067,7 +1067,7 @@ fi
%systemd_preun NetworkManager-wait-online.service NetworkManager-dispatcher.service nm-priv-helper.service
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%preun initscripts-updown
if [ $1 -eq 0 ]; then
/usr/sbin/update-alternatives --remove ifup %{_libexecdir}/nm-ifup >/dev/null 2>&1 || :
@@ -1107,7 +1107,7 @@ fi
%{dbus_sys_dir}/org.freedesktop.NetworkManager.conf
%{dbus_sys_dir}/nm-dispatcher.conf
%{dbus_sys_dir}/nm-priv-helper.conf
%if %{?with_ifcfg_rh} && 0%{?split_ifcfg_rh} == 0
%if %{with ifcfg_rh} && 0%{?split_ifcfg_rh} == 0
%{dbus_sys_dir}/nm-ifcfg-rh.conf
%endif
%{_sbindir}/%{name}
@@ -1135,7 +1135,7 @@ fi
%{_libexecdir}/nm-priv-helper
%dir %{_libdir}/%{name}
%dir %{nmplugindir}
%if %{?with_ifcfg_rh} && 0%{?split_ifcfg_rh} == 0
%if %{with ifcfg_rh} && 0%{?split_ifcfg_rh} == 0
%{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so
%endif
%if %{with nmtui}
@@ -1157,7 +1157,7 @@ fi
%{_mandir}/man8/NetworkManager-dispatcher.8*
%{_mandir}/man8/NetworkManager-wait-online.service.8*
%dir %{_localstatedir}/lib/NetworkManager
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%dir %{_sysconfdir}/sysconfig/network-scripts
%endif
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service
@@ -1274,7 +1274,7 @@ fi
%{nmlibdir}/conf.d/00-server.conf
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%files dispatcher-routing-rules
%{nmlibdir}/dispatcher.d/10-ifcfg-rh-routes.sh
%{nmlibdir}/dispatcher.d/no-wait.d/10-ifcfg-rh-routes.sh
@@ -1310,7 +1310,7 @@ fi
%endif
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%files initscripts-updown
%{_libexecdir}/nm-ifup
%ghost %attr(755, root, root) %{_sbindir}/ifup