Lubomir Rintel
2024-07-11 12:29:26 +02:00

View File

@@ -1,5 +1,5 @@
# SPEC file to build NetworkManager for testing. It aims for a similar # 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 # This spec file is not used as is to create official packages for RHEL, Fedora or any
# other distribution. # other distribution.
@@ -78,7 +78,7 @@
%bcond_with test %bcond_with test
%endif %endif
%if "%{?bcond_default_lto}" == "" %if "%{?bcond_default_lto}" == ""
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 %if 0%{?fedora} || 0%{?rhel} >= 9
%bcond_without lto %bcond_without lto
%else %else
%bcond_with lto %bcond_with lto
@@ -96,44 +96,21 @@
%else %else
%bcond_with connectivity_fedora %bcond_with connectivity_fedora
%endif %endif
%if 0%{?rhel} && 0%{?rhel} >= 8 %if 0%{?rhel}
%bcond_without connectivity_redhat %bcond_without connectivity_redhat
%else %else
%bcond_with connectivity_redhat %bcond_with connectivity_redhat
%endif %endif
%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
%bcond_without crypto_gnutls
%else
%bcond_with crypto_gnutls
%endif
%if 0%{?rhel} %if 0%{?rhel}
%bcond_with iwd %bcond_with iwd
%else %else
%bcond_without iwd %bcond_without iwd
%endif %endif
%if 0%{?fedora} >= 32 || 0%{?rhel} >= 8
%bcond_without firewalld_zone
%else
%bcond_with firewalld_zone
%endif
############################################################################### ###############################################################################
%if 0%{?fedora} || 0%{?rhel} >= 8
%global dbus_version 1.9.18 %global dbus_version 1.9.18
%global dbus_sys_dir %{_datadir}/dbus-1/system.d %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} && 0%{?rhel} == 8
%global libndp_version 1.7-4
%else
%global libndp_version %{nil}
%endif
%if %{with bluetooth} || %{with wwan} %if %{with bluetooth} || %{with wwan}
%global with_modem_manager_1 1 %global with_modem_manager_1 1
@@ -141,23 +118,11 @@
%global with_modem_manager_1 0 %global with_modem_manager_1 0
%endif %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 %if 0%{?fedora} || 0%{?rhel} >= 9
%global dns_rc_manager_default auto %global dns_rc_manager_default auto
%else %else
%global dns_rc_manager_default symlink %global dns_rc_manager_default symlink
%endif %endif
%else
%global logging_backend_default syslog
%global dns_rc_manager_default file
%endif
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
%bcond_with default_ifcfg_rh %bcond_with default_ifcfg_rh
@@ -229,9 +194,7 @@ Source9: readme-ifcfg-rh-migrated.txt
#Patch1: 0001-some.patch #Patch1: 0001-some.patch
Requires(post): systemd Requires(post): systemd
%if 0%{?fedora} || 0%{?rhel} >= 8
Requires(post): systemd-udev Requires(post): systemd-udev
%endif
Requires(post): /usr/sbin/update-alternatives Requires(post): /usr/sbin/update-alternatives
Requires(preun): systemd Requires(preun): systemd
Requires(preun): /usr/sbin/update-alternatives Requires(preun): /usr/sbin/update-alternatives
@@ -240,13 +203,17 @@ Requires(postun): systemd
Requires: dbus >= %{dbus_version} Requires: dbus >= %{dbus_version}
Requires: glib2 >= %{glib2_version} Requires: glib2 >= %{glib2_version}
Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release} 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 %endif
Obsoletes: NetworkManager < %{obsoletes_device_plugins} Obsoletes: NetworkManager < %{obsoletes_device_plugins}
Obsoletes: NetworkManager < %{obsoletes_ppp_plugin} Obsoletes: NetworkManager < %{obsoletes_ppp_plugin}
Obsoletes: NetworkManager-wimax < 1:1.2 Obsoletes: NetworkManager-wimax < 1:1.2
%if 0%{?rhel} && 0%{?rhel} == 8 %if 0%{?rhel} == 8
Suggests: NetworkManager-initscripts-updown Suggests: NetworkManager-initscripts-updown
%endif %endif
Obsoletes: NetworkManager < %{obsoletes_initscripts_updown} Obsoletes: NetworkManager < %{obsoletes_initscripts_updown}
@@ -254,12 +221,7 @@ Obsoletes: NetworkManager < %{obsoletes_initscripts_updown}
Obsoletes: NetworkManager < %{obsoletes_ifcfg_rh} Obsoletes: NetworkManager < %{obsoletes_ifcfg_rh}
%endif %endif
%if 0%{?rhel} && 0%{?rhel} <= 7 %if 0%{?rhel} >= 10
# Kept for RHEL to ensure that wired 802.1x works out of the box
Requires: wpa_supplicant >= 1:1.1
%endif
%if 0%{?rhel} && 0%{?rhel} >= 10
%if 0%{without team} %if 0%{without team}
Obsoletes: NetworkManager-team < 1:1.47.5-3 Obsoletes: NetworkManager-team < 1:1.47.5-3
%endif %endif
@@ -272,7 +234,7 @@ Conflicts: NetworkManager-openvpn < 1:0.7.0.99-1
Conflicts: NetworkManager-pptp < 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: NetworkManager-openconnect < 0:0.7.0.99-1
Conflicts: kde-plasma-networkmanagement < 1:0.9-0.49.20110527git.nm09 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} %if 0%{without team}
Conflicts: NetworkManager-team <= 1:1.47.5-3 Conflicts: NetworkManager-team <= 1:1.47.5-3
%endif %endif
@@ -298,11 +260,7 @@ BuildRequires: gobject-introspection-devel >= 0.10.3
%if %{with ppp} %if %{with ppp}
BuildRequires: ppp-devel >= 2.4.5 BuildRequires: ppp-devel >= 2.4.5
%endif %endif
%if %{with crypto_gnutls}
BuildRequires: gnutls-devel >= 2.12 BuildRequires: gnutls-devel >= 2.12
%else
BuildRequires: nss-devel >= 3.11.7
%endif
BuildRequires: readline-devel BuildRequires: readline-devel
BuildRequires: audit-libs-devel BuildRequires: audit-libs-devel
%if %{with regen_docs} %if %{with regen_docs}
@@ -340,17 +298,11 @@ BuildRequires: polkit-devel
BuildRequires: jansson-devel BuildRequires: jansson-devel
%if %{with sanitizer} %if %{with sanitizer}
BuildRequires: libasan BuildRequires: libasan
%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: libubsan BuildRequires: libubsan
%endif %endif
%endif
%if %{with firewalld_zone}
BuildRequires: firewalld-filesystem BuildRequires: firewalld-filesystem
%endif
BuildRequires: iproute BuildRequires: iproute
%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: iproute-tc BuildRequires: iproute-tc
%endif
Provides: %{name}-dispatcher%{?_isa} = %{epoch}:%{version}-%{release} Provides: %{name}-dispatcher%{?_isa} = %{epoch}:%{version}-%{release}
@@ -393,12 +345,7 @@ Summary: Bluetooth device plugin for NetworkManager
Group: System Environment/Base Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
Requires: NetworkManager-wwan = %{epoch}:%{version}-%{release} Requires: NetworkManager-wwan = %{epoch}:%{version}-%{release}
%if 0%{?rhel} && 0%{?rhel} <= 7
# No Requires:bluez to prevent it being installed when updating
# to the split NM package
%else
Requires: bluez >= 4.101-5 Requires: bluez >= 4.101-5
%endif
Obsoletes: NetworkManager < %{obsoletes_device_plugins} Obsoletes: NetworkManager < %{obsoletes_device_plugins}
%description bluetooth %description bluetooth
@@ -413,12 +360,10 @@ Group: System Environment/Base
BuildRequires: teamd-devel BuildRequires: teamd-devel
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
Obsoletes: NetworkManager < %{obsoletes_device_plugins} 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 # Team was split from main NM binary between 0.9.10 and 1.0
# We need this Obsoletes in addition to the one above # We need this Obsoletes in addition to the one above
# (git:3aede801521ef7bff039e6e3f1b3c7b566b4338d). # (git:3aede801521ef7bff039e6e3f1b3c7b566b4338d).
Obsoletes: NetworkManager < 1:1.0.0 Obsoletes: NetworkManager < 1:1.0.0
%endif
%description team %description team
This package contains NetworkManager support for team devices. This package contains NetworkManager support for team devices.
@@ -437,13 +382,10 @@ Requires: wireless-regdb
Requires: crda Requires: crda
%endif %endif
%if %{with iwd} && (0%{?fedora} >= 25 || 0%{?rhel} >= 8) %if %{with iwd}
Requires: (wpa_supplicant >= %{wpa_supplicant_version} or iwd) Requires: (wpa_supplicant >= %{wpa_supplicant_version} or iwd)
Suggests: wpa_supplicant Suggests: wpa_supplicant
%else %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} Requires: wpa_supplicant >= %{wpa_supplicant_version}
%endif %endif
@@ -459,12 +401,7 @@ This package contains NetworkManager support for Wifi and OLPC devices.
Summary: Mobile broadband device plugin for NetworkManager Summary: Mobile broadband device plugin for NetworkManager
Group: System Environment/Base Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%if 0%{?rhel} && 0%{?rhel} <= 7
# No Requires:ModemManager to prevent it being installed when updating
# to the split NM package
%else
Requires: ModemManager Requires: ModemManager
%endif
Obsoletes: NetworkManager < %{obsoletes_device_plugins} Obsoletes: NetworkManager < %{obsoletes_device_plugins}
%description wwan %description wwan
@@ -659,12 +596,7 @@ Preferably use nmcli instead.
-Ddhclient=%{_sbindir}/dhclient \ -Ddhclient=%{_sbindir}/dhclient \
-Ddhcpcanon=no \ -Ddhcpcanon=no \
-Ddhcpcd=no \ -Ddhcpcd=no \
-Dconfig_dhcp_default=%{dhcp_default} \
%if %{with crypto_gnutls}
-Dcrypto=gnutls \ -Dcrypto=gnutls \
%else
-Dcrypto=nss \
%endif
%if %{with debug} %if %{with debug}
-Dmore_logging=true \ -Dmore_logging=true \
-Dmore_asserts=10000 \ -Dmore_asserts=10000 \
@@ -766,11 +698,6 @@ Preferably use nmcli instead.
-Dpppd_plugin_dir="%{_libdir}/pppd/%{ppp_version}" \ -Dpppd_plugin_dir="%{_libdir}/pppd/%{ppp_version}" \
%else %else
-Dppp=false \ -Dppp=false \
%endif
%if %{with firewalld_zone}
-Dfirewalld_zone=true \
%else
-Dfirewalld_zone=false \
%endif %endif
-Ddist_version=%{version}-%{release} \ -Ddist_version=%{version}-%{release} \
%if %{with default_ifcfg_rh} %if %{with default_ifcfg_rh}
@@ -782,7 +709,7 @@ Preferably use nmcli instead.
-Dresolvconf=no \ -Dresolvconf=no \
-Dnetconfig=no \ -Dnetconfig=no \
-Dconfig_dns_rc_manager_default=%{dns_rc_manager_default} \ -Dconfig_dns_rc_manager_default=%{dns_rc_manager_default} \
-Dconfig_logging_backend_default=%{logging_backend_default} -Dconfig_logging_backend_default=journal
%meson_build %meson_build
@@ -801,19 +728,10 @@ autoreconf --install --force
--with-dhclient=%{_sbindir}/dhclient \ --with-dhclient=%{_sbindir}/dhclient \
--with-dhcpcd=no \ --with-dhcpcd=no \
--with-dhcpcanon=no \ --with-dhcpcanon=no \
--with-config-dhcp-default=%{dhcp_default} \
%if %{with crypto_gnutls}
--with-crypto=gnutls \ --with-crypto=gnutls \
%else
--with-crypto=nss \
%endif
%if %{with sanitizer} %if %{with sanitizer}
--with-address-sanitizer=exec \ --with-address-sanitizer=exec \
%if 0%{?fedora} || 0%{?rhel} >= 8
--enable-undefined-sanitizer=yes \ --enable-undefined-sanitizer=yes \
%else
--enable-undefined-sanitizer=no \
%endif
%else %else
--with-address-sanitizer=no \ --with-address-sanitizer=no \
--enable-undefined-sanitizer=no \ --enable-undefined-sanitizer=no \
@@ -919,11 +837,7 @@ autoreconf --install --force
%else %else
--enable-ppp=no \ --enable-ppp=no \
%endif %endif
%if %{with firewalld_zone}
--enable-firewalld-zone=yes \ --enable-firewalld-zone=yes \
%else
--enable-firewalld-zone=no \
%endif
--with-dist-version=%{version}-%{release} \ --with-dist-version=%{version}-%{release} \
%if %{with default_ifcfg_rh} %if %{with default_ifcfg_rh}
--with-config-plugins-default=ifcfg-rh \ --with-config-plugins-default=ifcfg-rh \
@@ -934,7 +848,7 @@ autoreconf --install --force
--with-resolvconf=no \ --with-resolvconf=no \
--with-netconfig=no \ --with-netconfig=no \
--with-config-dns-rc-manager-default=%{dns_rc_manager_default} \ --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 --disable-autotools-deprecation
%make_build %make_build
@@ -1033,9 +947,7 @@ if [ -S /run/udev/control ]; then
/usr/bin/udevadm control --reload-rules || : /usr/bin/udevadm control --reload-rules || :
/usr/bin/udevadm trigger --subsystem-match=net || : /usr/bin/udevadm trigger --subsystem-match=net || :
fi fi
%if %{with firewalld_zone}
%firewalld_reload %firewalld_reload
%endif
%systemd_post %{systemd_units} %systemd_post %{systemd_units}
@@ -1086,19 +998,11 @@ fi
%postun %postun
/usr/bin/udevadm control --reload-rules || : /usr/bin/udevadm control --reload-rules || :
/usr/bin/udevadm trigger --subsystem-match=net || : /usr/bin/udevadm trigger --subsystem-match=net || :
%if %{with firewalld_zone}
%firewalld_reload %firewalld_reload
%endif
%systemd_postun %{systemd_units} %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} %if %{with nm_cloud_setup}
%postun cloud-setup %postun cloud-setup
%systemd_postun %{systemd_units_cloud_setup} %systemd_postun %{systemd_units_cloud_setup}
@@ -1166,9 +1070,7 @@ fi
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_priv_helper.service %{_datadir}/dbus-1/system-services/org.freedesktop.nm_priv_helper.service
%{_datadir}/polkit-1/actions/*.policy %{_datadir}/polkit-1/actions/*.policy
%{_prefix}/lib/udev/rules.d/*.rules %{_prefix}/lib/udev/rules.d/*.rules
%if %{with firewalld_zone}
%{_prefix}/lib/firewalld/zones/nm-shared.xml %{_prefix}/lib/firewalld/zones/nm-shared.xml
%endif
# systemd stuff # systemd stuff
%{_unitdir}/NetworkManager.service %{_unitdir}/NetworkManager.service
%{_unitdir}/NetworkManager-wait-online.service %{_unitdir}/NetworkManager-wait-online.service