From c639387071ba004e8dfc3a35f7135243c24d3907 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 10 Jul 2024 11:46:53 +0200 Subject: [PATCH 1/5] contrib/rpm: remove ldconfig scriptlets The file triggers replaced this aeons ago. RHEL 8 definitely has them: [root@el8 ~]# rpm -q --filetriggers glibc-common transfiletriggerin scriptlet (using /bin/sh) -- /lib, /lib64, /usr/lib, /usr/lib64 /sbin/ldconfig transfiletriggerpostun scriptlet (using /bin/sh) -- /lib, /lib64, /usr/lib, /usr/lib64 /sbin/ldconfig [root@el8 ~]# --- contrib/fedora/rpm/NetworkManager.spec | 6 ------ 1 file changed, 6 deletions(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index ee67a05d3e..d3616aa7c5 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -1091,12 +1091,6 @@ fi %systemd_postun %{systemd_units} -%if (0%{?fedora} && 0%{?fedora} < 28) || 0%{?rhel} -%post libnm -p /sbin/ldconfig -%postun libnm -p /sbin/ldconfig -%endif - - %if %{with nm_cloud_setup} %postun cloud-setup %systemd_postun %{systemd_units_cloud_setup} From 811ef6952d03327acddfc9f9fe07cb601ab770dc Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 9 Jul 2024 17:55:25 +0200 Subject: [PATCH 2/5] contrib/rpm: remove extra 0%{?rhel} from some conditionals "0%{?rhel} && 0%{?rhel} >= 8" just says 0%{?rhel} twice, redundantly. Let's not do that. --- contrib/fedora/rpm/NetworkManager.spec | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index d3616aa7c5..be0f335f89 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -96,7 +96,7 @@ %else %bcond_with connectivity_fedora %endif -%if 0%{?rhel} && 0%{?rhel} >= 8 +%if 0%{?rhel} >= 8 %bcond_without connectivity_redhat %else %bcond_with connectivity_redhat @@ -129,7 +129,7 @@ # Older libndp versions use select() (rh#1933041). On well known distros, # choose a version that has the necessary fix. -%if 0%{?rhel} && 0%{?rhel} == 8 +%if 0%{?rhel} == 8 %global libndp_version 1.7-4 %else %global libndp_version %{nil} @@ -246,7 +246,7 @@ Requires: libndp >= %{libndp_version} Obsoletes: NetworkManager < %{obsoletes_device_plugins} Obsoletes: NetworkManager < %{obsoletes_ppp_plugin} Obsoletes: NetworkManager-wimax < 1:1.2 -%if 0%{?rhel} && 0%{?rhel} == 8 +%if 0%{?rhel} == 8 Suggests: NetworkManager-initscripts-updown %endif Obsoletes: NetworkManager < %{obsoletes_initscripts_updown} @@ -259,7 +259,7 @@ Obsoletes: NetworkManager < %{obsoletes_ifcfg_rh} Requires: wpa_supplicant >= 1:1.1 %endif -%if 0%{?rhel} && 0%{?rhel} >= 10 +%if 0%{?rhel} >= 10 %if 0%{without team} Obsoletes: NetworkManager-team < 1:1.47.5-3 %endif @@ -272,7 +272,7 @@ Conflicts: NetworkManager-openvpn < 1:0.7.0.99-1 Conflicts: NetworkManager-pptp < 1:0.7.0.99-1 Conflicts: NetworkManager-openconnect < 0:0.7.0.99-1 Conflicts: kde-plasma-networkmanagement < 1:0.9-0.49.20110527git.nm09 -%if 0%{?rhel} && 0%{?rhel} >= 10 +%if 0%{?rhel} >= 10 %if 0%{without team} Conflicts: NetworkManager-team <= 1:1.47.5-3 %endif @@ -393,7 +393,7 @@ Summary: Bluetooth device plugin for NetworkManager Group: System Environment/Base Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} Requires: NetworkManager-wwan = %{epoch}:%{version}-%{release} -%if 0%{?rhel} && 0%{?rhel} <= 7 +%if 0%{?rhel} <= 7 # No Requires:bluez to prevent it being installed when updating # to the split NM package %else @@ -459,7 +459,7 @@ This package contains NetworkManager support for Wifi and OLPC devices. Summary: Mobile broadband device plugin for NetworkManager Group: System Environment/Base Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} -%if 0%{?rhel} && 0%{?rhel} <= 7 +%if 0%{?rhel} <= 7 # No Requires:ModemManager to prevent it being installed when updating # to the split NM package %else From 954e8c8d6470ee60c194a74b073f946b87bbb691 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 9 Jul 2024 17:42:21 +0200 Subject: [PATCH 3/5] contrib/rpm: stop conditionalizing default DHCP client It's the same on all systems we care about. --- contrib/fedora/rpm/NetworkManager.spec | 8 -------- 1 file changed, 8 deletions(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index be0f335f89..d7f5957430 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -141,12 +141,6 @@ %global with_modem_manager_1 0 %endif -%if 0%{?fedora} >= 31 || 0%{?rhel} >= 8 -%global dhcp_default internal -%else -%global dhcp_default dhclient -%endif - %if 0%{?fedora} || 0%{?rhel} >= 8 %global logging_backend_default journal %if 0%{?fedora} || 0%{?rhel} >= 9 @@ -658,7 +652,6 @@ Preferably use nmcli instead. -Ddhclient=%{_sbindir}/dhclient \ -Ddhcpcanon=no \ -Ddhcpcd=no \ - -Dconfig_dhcp_default=%{dhcp_default} \ %if %{with crypto_gnutls} -Dcrypto=gnutls \ %else @@ -800,7 +793,6 @@ autoreconf --install --force --with-dhclient=%{_sbindir}/dhclient \ --with-dhcpcd=no \ --with-dhcpcanon=no \ - --with-config-dhcp-default=%{dhcp_default} \ %if %{with crypto_gnutls} --with-crypto=gnutls \ %else From 1ccc1e00410d01028cc62eda60fcea681ea26203 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 9 Jul 2024 17:42:21 +0200 Subject: [PATCH 4/5] contrib/rpm: install firewall zone unconditionally It's the same on all systems we care about. --- contrib/fedora/rpm/NetworkManager.spec | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index d7f5957430..24a6e3e175 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -111,11 +111,6 @@ %else %bcond_without iwd %endif -%if 0%{?fedora} >= 32 || 0%{?rhel} >= 8 -%bcond_without firewalld_zone -%else -%bcond_with firewalld_zone -%endif ############################################################################### @@ -338,9 +333,7 @@ BuildRequires: libasan BuildRequires: libubsan %endif %endif -%if %{with firewalld_zone} BuildRequires: firewalld-filesystem -%endif BuildRequires: iproute %if 0%{?fedora} || 0%{?rhel} >= 8 BuildRequires: iproute-tc @@ -758,11 +751,6 @@ Preferably use nmcli instead. -Dpppd_plugin_dir="%{_libdir}/pppd/%{ppp_version}" \ %else -Dppp=false \ -%endif -%if %{with firewalld_zone} - -Dfirewalld_zone=true \ -%else - -Dfirewalld_zone=false \ %endif -Ddist_version=%{version}-%{release} \ %if %{?config_plugins_default_ifcfg_rh} @@ -910,11 +898,7 @@ autoreconf --install --force %else --enable-ppp=no \ %endif -%if %{with firewalld_zone} --enable-firewalld-zone=yes \ -%else - --enable-firewalld-zone=no \ -%endif --with-dist-version=%{version}-%{release} \ %if %{?config_plugins_default_ifcfg_rh} --with-config-plugins-default=ifcfg-rh \ @@ -1023,9 +1007,7 @@ if [ -S /run/udev/control ]; then /usr/bin/udevadm control --reload-rules || : /usr/bin/udevadm trigger --subsystem-match=net || : fi -%if %{with firewalld_zone} %firewalld_reload -%endif %systemd_post %{systemd_units} @@ -1076,9 +1058,7 @@ fi %postun /usr/bin/udevadm control --reload-rules || : /usr/bin/udevadm trigger --subsystem-match=net || : -%if %{with firewalld_zone} %firewalld_reload -%endif %systemd_postun %{systemd_units} @@ -1150,9 +1130,7 @@ fi %{_datadir}/dbus-1/system-services/org.freedesktop.nm_priv_helper.service %{_datadir}/polkit-1/actions/*.policy %{_prefix}/lib/udev/rules.d/*.rules -%if %{with firewalld_zone} %{_prefix}/lib/firewalld/zones/nm-shared.xml -%endif # systemd stuff %{_unitdir}/NetworkManager.service %{_unitdir}/NetworkManager-wait-online.service From 037450df45acb3c22c92f76e9b63045c941ccc3f Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 9 Jul 2024 17:58:34 +0200 Subject: [PATCH 5/5] contrib/rpm: remove conditionals for RHEL 7 and older There's just too much clutter in the SPEC file. Drop some totally obsolete stuff. --- contrib/fedora/rpm/NetworkManager.spec | 86 ++++---------------------- 1 file changed, 12 insertions(+), 74 deletions(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index 24a6e3e175..8621db76cd 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -1,5 +1,5 @@ # SPEC file to build NetworkManager for testing. It aims for a similar -# configuration as rhel-7.0 and Fedora rawhide +# configuration as RHEL and Fedora Rawhide # # This spec file is not used as is to create official packages for RHEL, Fedora or any # other distribution. @@ -78,7 +78,7 @@ %bcond_with test %endif %if "%{?bcond_default_lto}" == "" -%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 +%if 0%{?fedora} || 0%{?rhel} >= 9 %bcond_without lto %else %bcond_with lto @@ -96,16 +96,11 @@ %else %bcond_with connectivity_fedora %endif -%if 0%{?rhel} >= 8 +%if 0%{?rhel} %bcond_without connectivity_redhat %else %bcond_with connectivity_redhat %endif -%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8 -%bcond_without crypto_gnutls -%else -%bcond_with crypto_gnutls -%endif %if 0%{?rhel} %bcond_with iwd %else @@ -114,21 +109,8 @@ ############################################################################### -%if 0%{?fedora} || 0%{?rhel} >= 8 %global dbus_version 1.9.18 %global dbus_sys_dir %{_datadir}/dbus-1/system.d -%else -%global dbus_version 1.1 -%global dbus_sys_dir %{_sysconfdir}/dbus-1/system.d -%endif - -# Older libndp versions use select() (rh#1933041). On well known distros, -# choose a version that has the necessary fix. -%if 0%{?rhel} == 8 -%global libndp_version 1.7-4 -%else -%global libndp_version %{nil} -%endif %if %{with bluetooth} || %{with wwan} %global with_modem_manager_1 1 @@ -136,17 +118,11 @@ %global with_modem_manager_1 0 %endif -%if 0%{?fedora} || 0%{?rhel} >= 8 -%global logging_backend_default journal %if 0%{?fedora} || 0%{?rhel} >= 9 %global dns_rc_manager_default auto %else %global dns_rc_manager_default symlink %endif -%else -%global logging_backend_default syslog -%global dns_rc_manager_default file -%endif %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 %global config_plugins_default_ifcfg_rh 0 @@ -218,9 +194,7 @@ Source9: readme-ifcfg-rh-migrated.txt #Patch1: 0001-some.patch Requires(post): systemd -%if 0%{?fedora} || 0%{?rhel} >= 8 Requires(post): systemd-udev -%endif Requires(post): /usr/sbin/update-alternatives Requires(preun): systemd Requires(preun): /usr/sbin/update-alternatives @@ -229,9 +203,13 @@ Requires(postun): systemd Requires: dbus >= %{dbus_version} Requires: glib2 >= %{glib2_version} Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release} -%if "%{libndp_version}" != "" -Requires: libndp >= %{libndp_version} + +%if 0%{?rhel} == 8 +# Older libndp versions use select() (rh#1933041). On well known distros, +# choose a version that has the necessary fix. +Requires: libndp >= 1.7-4 %endif + Obsoletes: NetworkManager < %{obsoletes_device_plugins} Obsoletes: NetworkManager < %{obsoletes_ppp_plugin} Obsoletes: NetworkManager-wimax < 1:1.2 @@ -243,11 +221,6 @@ Obsoletes: NetworkManager < %{obsoletes_initscripts_updown} Obsoletes: NetworkManager < %{obsoletes_ifcfg_rh} %endif -%if 0%{?rhel} && 0%{?rhel} <= 7 -# Kept for RHEL to ensure that wired 802.1x works out of the box -Requires: wpa_supplicant >= 1:1.1 -%endif - %if 0%{?rhel} >= 10 %if 0%{without team} Obsoletes: NetworkManager-team < 1:1.47.5-3 @@ -287,11 +260,7 @@ BuildRequires: gobject-introspection-devel >= 0.10.3 %if %{with ppp} BuildRequires: ppp-devel >= 2.4.5 %endif -%if %{with crypto_gnutls} BuildRequires: gnutls-devel >= 2.12 -%else -BuildRequires: nss-devel >= 3.11.7 -%endif BuildRequires: readline-devel BuildRequires: audit-libs-devel %if %{with regen_docs} @@ -329,15 +298,11 @@ BuildRequires: polkit-devel BuildRequires: jansson-devel %if %{with sanitizer} BuildRequires: libasan -%if 0%{?fedora} || 0%{?rhel} >= 8 BuildRequires: libubsan %endif -%endif BuildRequires: firewalld-filesystem BuildRequires: iproute -%if 0%{?fedora} || 0%{?rhel} >= 8 BuildRequires: iproute-tc -%endif Provides: %{name}-dispatcher%{?_isa} = %{epoch}:%{version}-%{release} @@ -380,12 +345,7 @@ Summary: Bluetooth device plugin for NetworkManager Group: System Environment/Base Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} Requires: NetworkManager-wwan = %{epoch}:%{version}-%{release} -%if 0%{?rhel} <= 7 -# No Requires:bluez to prevent it being installed when updating -# to the split NM package -%else Requires: bluez >= 4.101-5 -%endif Obsoletes: NetworkManager < %{obsoletes_device_plugins} %description bluetooth @@ -400,12 +360,10 @@ Group: System Environment/Base BuildRequires: teamd-devel Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} Obsoletes: NetworkManager < %{obsoletes_device_plugins} -%if 0%{?fedora} || 0%{?rhel} >= 8 # Team was split from main NM binary between 0.9.10 and 1.0 # We need this Obsoletes in addition to the one above # (git:3aede801521ef7bff039e6e3f1b3c7b566b4338d). Obsoletes: NetworkManager < 1:1.0.0 -%endif %description team This package contains NetworkManager support for team devices. @@ -424,13 +382,10 @@ Requires: wireless-regdb Requires: crda %endif -%if %{with iwd} && (0%{?fedora} >= 25 || 0%{?rhel} >= 8) +%if %{with iwd} Requires: (wpa_supplicant >= %{wpa_supplicant_version} or iwd) Suggests: wpa_supplicant %else -# Just require wpa_supplicant on platforms that don't support boolean -# dependencies even though the plugin supports both supplicant and -# iwd backend. Requires: wpa_supplicant >= %{wpa_supplicant_version} %endif @@ -446,12 +401,7 @@ This package contains NetworkManager support for Wifi and OLPC devices. Summary: Mobile broadband device plugin for NetworkManager Group: System Environment/Base Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} -%if 0%{?rhel} <= 7 -# No Requires:ModemManager to prevent it being installed when updating -# to the split NM package -%else Requires: ModemManager -%endif Obsoletes: NetworkManager < %{obsoletes_device_plugins} %description wwan @@ -645,11 +595,7 @@ Preferably use nmcli instead. -Ddhclient=%{_sbindir}/dhclient \ -Ddhcpcanon=no \ -Ddhcpcd=no \ -%if %{with crypto_gnutls} -Dcrypto=gnutls \ -%else - -Dcrypto=nss \ -%endif %if %{with debug} -Dmore_logging=true \ -Dmore_asserts=10000 \ @@ -762,7 +708,7 @@ Preferably use nmcli instead. -Dresolvconf=no \ -Dnetconfig=no \ -Dconfig_dns_rc_manager_default=%{dns_rc_manager_default} \ - -Dconfig_logging_backend_default=%{logging_backend_default} + -Dconfig_logging_backend_default=journal %meson_build @@ -781,18 +727,10 @@ autoreconf --install --force --with-dhclient=%{_sbindir}/dhclient \ --with-dhcpcd=no \ --with-dhcpcanon=no \ -%if %{with crypto_gnutls} --with-crypto=gnutls \ -%else - --with-crypto=nss \ -%endif %if %{with sanitizer} --with-address-sanitizer=exec \ -%if 0%{?fedora} || 0%{?rhel} >= 8 --enable-undefined-sanitizer=yes \ -%else - --enable-undefined-sanitizer=no \ -%endif %else --with-address-sanitizer=no \ --enable-undefined-sanitizer=no \ @@ -909,7 +847,7 @@ autoreconf --install --force --with-resolvconf=no \ --with-netconfig=no \ --with-config-dns-rc-manager-default=%{dns_rc_manager_default} \ - --with-config-logging-backend-default=%{logging_backend_default} \ + --with-config-logging-backend-default=journal \ --disable-autotools-deprecation %make_build