Lubomir Rintel
2024-07-11 12:23:12 +02:00

View File

@@ -160,32 +160,32 @@
%endif %endif
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
%global config_plugins_default_ifcfg_rh 0 %bcond_with default_ifcfg_rh
%else %else
%global config_plugins_default_ifcfg_rh 1 %bcond_without default_ifcfg_rh
%endif %endif
%if 0%{?rhel} >= 10 %if 0%{?rhel} >= 10
%global with_ifcfg_rh 0 %bcond_with ifcfg_rh
%global split_ifcfg_rh 0 %bcond_with split_ifcfg_rh
%elif 0%{?fedora} >= 36 %elif 0%{?fedora} >= 36
%global with_ifcfg_rh 1 %bcond_without ifcfg_rh
%global split_ifcfg_rh 1 %bcond_without split_ifcfg_rh
%else %else
%global with_ifcfg_rh 1 %bcond_without ifcfg_rh
%global split_ifcfg_rh 0 %bcond_with split_ifcfg_rh
%endif %endif
%if (0%{?fedora} >= 36 && 0%{?fedora} < 39) || 0%{?rhel} == 9 %if (0%{?fedora} >= 36 && 0%{?fedora} < 39) || 0%{?rhel} == 9
%global ifcfg_warning 1 %bcond_without ifcfg_warning
%else %else
%global ifcfg_warning 0 %bcond_with ifcfg_warning
%endif %endif
%if 0%{?fedora} >= 39 %if 0%{?fedora} >= 39
%global ifcfg_migrate 1 %bcond_without ifcfg_migrate
%else %else
%global ifcfg_migrate 0 %bcond_with ifcfg_migrate
%endif %endif
%if 0%{?fedora} %if 0%{?fedora}
@@ -250,7 +250,7 @@ Obsoletes: NetworkManager-wimax < 1:1.2
Suggests: NetworkManager-initscripts-updown Suggests: NetworkManager-initscripts-updown
%endif %endif
Obsoletes: NetworkManager < %{obsoletes_initscripts_updown} Obsoletes: NetworkManager < %{obsoletes_initscripts_updown}
%if 0%{?split_ifcfg_rh} %if %{with split_ifcfg_rh}
Obsoletes: NetworkManager < %{obsoletes_ifcfg_rh} Obsoletes: NetworkManager < %{obsoletes_ifcfg_rh}
%endif %endif
@@ -567,11 +567,11 @@ This package is intended to be installed by default for server
deployments. deployments.
%if %{?with_ifcfg_rh} %if %{with ifcfg_rh}
%package dispatcher-routing-rules %package dispatcher-routing-rules
Summary: NetworkManager dispatcher file for advanced routing rules Summary: NetworkManager dispatcher file for advanced routing rules
Group: System Environment/Base Group: System Environment/Base
%if 0%{?split_ifcfg_rh} %if %{with split_ifcfg_rh}
Requires: %{name}-initscripts-ifcfg-rh Requires: %{name}-initscripts-ifcfg-rh
%endif %endif
BuildArch: noarch BuildArch: noarch
@@ -599,7 +599,7 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
%endif %endif
%if 0%{?split_ifcfg_rh} %if %{with split_ifcfg_rh}
%package initscripts-ifcfg-rh %package initscripts-ifcfg-rh
Summary: NetworkManager plugin for reading and writing connections in ifcfg-rh format Summary: NetworkManager plugin for reading and writing connections in ifcfg-rh format
Group: System Environment/Base Group: System Environment/Base
@@ -626,7 +626,7 @@ like Aliyun, Azure, EC2, GCP are supported.
%endif %endif
%if %{?with_ifcfg_rh} %if %{with ifcfg_rh}
%package initscripts-updown %package initscripts-updown
Summary: Legacy ifup/ifdown scripts for NetworkManager that replace initscripts (network-scripts) Summary: Legacy ifup/ifdown scripts for NetworkManager that replace initscripts (network-scripts)
Group: System Environment/Base Group: System Environment/Base
@@ -641,6 +641,7 @@ This is only for backward compatibility with initscripts (network-scripts).
Preferably use nmcli instead. Preferably use nmcli instead.
%endif %endif
%prep %prep
%autosetup -p1 -n NetworkManager-%{real_version} %autosetup -p1 -n NetworkManager-%{real_version}
@@ -753,7 +754,7 @@ Preferably use nmcli instead.
-Ddbus_conf_dir=%{dbus_sys_dir} \ -Ddbus_conf_dir=%{dbus_sys_dir} \
-Dtests=yes \ -Dtests=yes \
-Dvalgrind=no \ -Dvalgrind=no \
%if %{?with_ifcfg_rh} %if %{with ifcfg_rh}
-Difcfg_rh=true \ -Difcfg_rh=true \
%else %else
-Difcfg_rh=false \ -Difcfg_rh=false \
@@ -772,10 +773,10 @@ Preferably use nmcli instead.
-Dfirewalld_zone=false \ -Dfirewalld_zone=false \
%endif %endif
-Ddist_version=%{version}-%{release} \ -Ddist_version=%{version}-%{release} \
%if %{?config_plugins_default_ifcfg_rh} %if %{with default_ifcfg_rh}
-Dconfig_plugins_default=ifcfg-rh \ -Dconfig_plugins_default=ifcfg-rh \
%endif %endif
%if %{?ifcfg_migrate} %if %{with ifcfg_migrate}
-Dconfig_migrate_ifcfg_rh_default=true \ -Dconfig_migrate_ifcfg_rh_default=true \
%endif %endif
-Dresolvconf=no \ -Dresolvconf=no \
@@ -905,10 +906,10 @@ autoreconf --install --force
--enable-more-warnings=yes \ --enable-more-warnings=yes \
%endif %endif
--with-valgrind=no \ --with-valgrind=no \
%if %{?with_ifcfg_rh} %if %{with ifcfg_rh}
--enable-ifcfg-rh=yes \ --enable-ifcfg-rh=yes \
%else %else
--enable-ifcfg-rh=no \ --enable-ifcfg-rh=no \
%endif %endif
--enable-ifupdown=no \ --enable-ifupdown=no \
%if %{with ppp} %if %{with ppp}
@@ -924,10 +925,10 @@ autoreconf --install --force
--enable-firewalld-zone=no \ --enable-firewalld-zone=no \
%endif %endif
--with-dist-version=%{version}-%{release} \ --with-dist-version=%{version}-%{release} \
%if %{?config_plugins_default_ifcfg_rh} %if %{with default_ifcfg_rh}
--with-config-plugins-default=ifcfg-rh \ --with-config-plugins-default=ifcfg-rh \
%endif %endif
%if %{?ifcfg_migrate} %if %{with ifcfg_migrate}
--with-config-migrate-ifcfg-rh-default=yes \ --with-config-migrate-ifcfg-rh-default=yes \
%endif %endif
--with-resolvconf=no \ --with-resolvconf=no \
@@ -965,14 +966,14 @@ cp %{SOURCE7} %{buildroot}%{_sysctldir}
cp %{SOURCE6} %{buildroot}%{nmlibdir}/conf.d/ cp %{SOURCE6} %{buildroot}%{nmlibdir}/conf.d/
%endif %endif
%if 0%{?ifcfg_warning} %if %{with ifcfg_warning}
cp %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts cp %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts
%endif %endif
%if 0%{?ifcfg_migrate} %if %{with ifcfg_migrate}
cp %{SOURCE9} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt cp %{SOURCE9} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt
%endif %endif
%if %{?with_ifcfg_rh} %if %{with ifcfg_rh}
cp examples/dispatcher/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/ 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 ../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/ ln -s ../10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/no-wait.d/
@@ -992,11 +993,12 @@ mkdir -p %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
cp valgrind.suppressions %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version} cp valgrind.suppressions %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
%endif %endif
%if %{?with_ifcfg_rh} %if %{with ifcfg_rh}
touch %{buildroot}%{_sbindir}/ifup touch %{buildroot}%{_sbindir}/ifup
touch %{buildroot}%{_sbindir}/ifdown touch %{buildroot}%{_sbindir}/ifdown
%endif %endif
%check %check
%if %{with meson} %if %{with meson}
%if %{with test} %if %{with test}
@@ -1038,7 +1040,7 @@ fi
%systemd_post %{systemd_units} %systemd_post %{systemd_units}
%if %{?with_ifcfg_rh} %if %{with ifcfg_rh}
%post initscripts-updown %post initscripts-updown
if [ -f %{_sbindir}/ifup -a ! -L %{_sbindir}/ifup ]; then if [ -f %{_sbindir}/ifup -a ! -L %{_sbindir}/ifup ]; then
# initscripts package too old, won't let us set an alternative # initscripts package too old, won't let us set an alternative
@@ -1067,7 +1069,7 @@ fi
%systemd_preun NetworkManager-wait-online.service NetworkManager-dispatcher.service nm-priv-helper.service %systemd_preun NetworkManager-wait-online.service NetworkManager-dispatcher.service nm-priv-helper.service
%if %{?with_ifcfg_rh} %if %{with ifcfg_rh}
%preun initscripts-updown %preun initscripts-updown
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
/usr/sbin/update-alternatives --remove ifup %{_libexecdir}/nm-ifup >/dev/null 2>&1 || : /usr/sbin/update-alternatives --remove ifup %{_libexecdir}/nm-ifup >/dev/null 2>&1 || :
@@ -1107,7 +1109,7 @@ fi
%{dbus_sys_dir}/org.freedesktop.NetworkManager.conf %{dbus_sys_dir}/org.freedesktop.NetworkManager.conf
%{dbus_sys_dir}/nm-dispatcher.conf %{dbus_sys_dir}/nm-dispatcher.conf
%{dbus_sys_dir}/nm-priv-helper.conf %{dbus_sys_dir}/nm-priv-helper.conf
%if %{?with_ifcfg_rh} && 0%{?split_ifcfg_rh} == 0 %if %{with ifcfg_rh} && %{without split_ifcfg_rh}
%{dbus_sys_dir}/nm-ifcfg-rh.conf %{dbus_sys_dir}/nm-ifcfg-rh.conf
%endif %endif
%{_sbindir}/%{name} %{_sbindir}/%{name}
@@ -1135,7 +1137,7 @@ fi
%{_libexecdir}/nm-priv-helper %{_libexecdir}/nm-priv-helper
%dir %{_libdir}/%{name} %dir %{_libdir}/%{name}
%dir %{nmplugindir} %dir %{nmplugindir}
%if %{?with_ifcfg_rh} && 0%{?split_ifcfg_rh} == 0 %if %{with ifcfg_rh} && %{without split_ifcfg_rh}
%{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so %{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so
%endif %endif
%if %{with nmtui} %if %{with nmtui}
@@ -1157,7 +1159,7 @@ fi
%{_mandir}/man8/NetworkManager-dispatcher.8* %{_mandir}/man8/NetworkManager-dispatcher.8*
%{_mandir}/man8/NetworkManager-wait-online.service.8* %{_mandir}/man8/NetworkManager-wait-online.service.8*
%dir %{_localstatedir}/lib/NetworkManager %dir %{_localstatedir}/lib/NetworkManager
%if %{?with_ifcfg_rh} %if %{with ifcfg_rh}
%dir %{_sysconfdir}/sysconfig/network-scripts %dir %{_sysconfdir}/sysconfig/network-scripts
%endif %endif
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service %{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service
@@ -1174,7 +1176,7 @@ fi
%{_unitdir}/nm-priv-helper.service %{_unitdir}/nm-priv-helper.service
%dir %{_datadir}/doc/NetworkManager/examples %dir %{_datadir}/doc/NetworkManager/examples
%{_datadir}/doc/NetworkManager/examples/server.conf %{_datadir}/doc/NetworkManager/examples/server.conf
%if 0%{?ifcfg_warning} || 0%{?ifcfg_migrate} %if %{with ifcfg_warning} || %{with ifcfg_migrate}
%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt %{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt
%endif %endif
%doc NEWS AUTHORS README.md CONTRIBUTING.md %doc NEWS AUTHORS README.md CONTRIBUTING.md
@@ -1274,13 +1276,14 @@ fi
%{nmlibdir}/conf.d/00-server.conf %{nmlibdir}/conf.d/00-server.conf
%if %{?with_ifcfg_rh} %if %{with ifcfg_rh}
%files dispatcher-routing-rules %files dispatcher-routing-rules
%{nmlibdir}/dispatcher.d/10-ifcfg-rh-routes.sh %{nmlibdir}/dispatcher.d/10-ifcfg-rh-routes.sh
%{nmlibdir}/dispatcher.d/no-wait.d/10-ifcfg-rh-routes.sh %{nmlibdir}/dispatcher.d/no-wait.d/10-ifcfg-rh-routes.sh
%{nmlibdir}/dispatcher.d/pre-up.d/10-ifcfg-rh-routes.sh %{nmlibdir}/dispatcher.d/pre-up.d/10-ifcfg-rh-routes.sh
%endif %endif
%if %{with nmtui} %if %{with nmtui}
%files tui %files tui
%{_bindir}/nmtui %{_bindir}/nmtui
@@ -1291,7 +1294,7 @@ fi
%endif %endif
%if 0%{?split_ifcfg_rh} %if %{with split_ifcfg_rh}
%files initscripts-ifcfg-rh %files initscripts-ifcfg-rh
%{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so %{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so
%{dbus_sys_dir}/nm-ifcfg-rh.conf %{dbus_sys_dir}/nm-ifcfg-rh.conf
@@ -1310,7 +1313,7 @@ fi
%endif %endif
%if %{?with_ifcfg_rh} %if %{with ifcfg_rh}
%files initscripts-updown %files initscripts-updown
%{_libexecdir}/nm-ifup %{_libexecdir}/nm-ifup
%ghost %attr(755, root, root) %{_sbindir}/ifup %ghost %attr(755, root, root) %{_sbindir}/ifup