diff --git a/NetworkManager.spec b/NetworkManager.spec index 0d8bd5d..d38f907 100644 --- a/NetworkManager.spec +++ b/NetworkManager.spec @@ -34,6 +34,8 @@ %global real_version_major %(echo '%{real_version}' | sed -n 's/^\\([1-9][0-9]*\\.[0-9][0-9]*\\)\\.[0-9][0-9]*$/\\1/p') +%global systemd_units NetworkManager.service NetworkManager-wait-online.service NetworkManager-dispatcher.service + ############################################################################### %bcond_with meson @@ -51,11 +53,6 @@ %bcond_with test %bcond_with lto %bcond_with sanitizer -%if 0%{?fedora} > 28 || 0%{?rhel} > 7 -%bcond_with libnm_glib -%else -%bcond_without libnm_glib -%endif %if 0%{?fedora} %bcond_without connectivity_fedora %else @@ -88,10 +85,37 @@ %global with_modem_manager_1 0 %endif -%if 0%{?fedora} || 0%{?rhel} <= 7 -%global dhcp_default dhclient -%else +%if 0%{?fedora} >= 31 || 0%{?rhel} > 7 %global dhcp_default internal +%else +%global dhcp_default dhclient +%endif + +%if 0%{?fedora} || 0%{?rhel} > 7 +%global logging_backend_default journal +%global dns_rc_manager_default symlink +%else +%global logging_backend_default syslog +%global dns_rc_manager_default file +%endif + +%if 0%{?rhel} +%global config_plugins_default ifcfg-rh,ibft +%global ibft_enabled yes +%else +%global config_plugins_default ifcfg-rh +%global ibft_enabled no +%endif + +%if 0%{?fedora} +# Altough eBPF would be available on Fedora's kernel, it seems +# we often get SELinux denials (rh#1651654). But even aside them, +# bpf(BPF_MAP_CREATE, ...) randomly fails with EPERM. That might +# be related to `ulimit -l`. Anyway, this is not usable at the +# moment. +%global ebpf_enabled no +%else +%global ebpf_enabled no %endif ############################################################################### @@ -146,7 +170,6 @@ BuildRequires: intltool BuildRequires: gettext-devel BuildRequires: dbus-devel >= %{dbus_version} -BuildRequires: dbus-glib-devel >= %{dbus_glib_version} %if 0%{?fedora} BuildRequires: wireless-tools-devel >= %{wireless_tools_version} %endif @@ -334,37 +357,6 @@ This package contains NetworkManager support for PPP. %endif -%package glib -Summary: Libraries for adding NetworkManager support to applications (old API). -Group: Development/Libraries -Requires: dbus >= %{dbus_version} -Requires: dbus-glib >= %{dbus_glib_version} -Conflicts: NetworkManager-libnm < %{epoch}:%{version}-%{release} - -%description glib -This package contains the libraries that make it easier to use some -NetworkManager functionality from applications that use glib. This is -the older NetworkManager API. See also NetworkManager-libnm. - - -%package glib-devel -Summary: Header files for adding NetworkManager support to applications (old API). -Group: Development/Libraries -Requires: %{name}-glib%{?_isa} = %{epoch}:%{version}-%{release} -Requires: glib2-devel -Requires: pkgconfig -Requires: dbus-glib-devel >= %{dbus_glib_version} -Provides: %{name}-devel = %{epoch}:%{version}-%{release} -Provides: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release} -Obsoletes: %{name}-devel < %{epoch}:%{version}-%{release} - -%description glib-devel -This package contains the header and pkg-config files for development -applications using NetworkManager functionality from applications that -use glib. -This is the older NetworkManager API. See also NetworkManager-libnm-devel. - - %package libnm Summary: Libraries for adding NetworkManager support to applications (new API). Group: Development/Libraries @@ -465,6 +457,7 @@ by nm-connection-editor and nm-applet in a non-graphical environment. %build %if %{with meson} %meson \ + -Db_ndebug=false \ --warnlevel 2 \ %if %{with test} --werror \ @@ -535,10 +528,13 @@ by nm-connection-editor and nm-applet in a non-graphical environment. -Dconcheck=true \ %if 0%{?fedora} -Dlibpsl=true \ - -Debpf=true \ %else -Dlibpsl=false \ +%endif +%if %{ebpf_enabled} != yes -Debpf=false \ +%else + -Debpf=true \ %endif -Dsession_tracking=systemd \ -Dsuspend_resume=systemd \ @@ -548,20 +544,21 @@ by nm-connection-editor and nm-applet in a non-graphical environment. -Dtests=yes \ -Dvalgrind=no \ -Difcfg_rh=true \ +%if %{ibft_enabled} != yes + -Dibft=false \ +%else + -Dibft=true \ +%endif + -Difupdown=false \ %if %{with ppp} -Dpppd_plugin_dir=%{_libdir}/pppd/%{ppp_version} \ -Dppp=true \ %endif -Ddist_version=%{version}-%{release} \ - -Dconfig_plugins_default='ifcfg-rh' \ - -Dconfig_dns_rc_manager_default=symlink \ - -Dconfig_logging_backend_default=journal \ - -Djson_validation=true \ -%if %{with libnm_glib} - -Dlibnm_glib=true -%else - -Dlibnm_glib=false -%endif + -Dconfig_plugins_default=%{config_plugins_default} \ + -Dconfig_dns_rc_manager_default=%{dns_rc_manager_default} \ + -Dconfig_logging_backend_default=%{logging_backend_default} \ + -Djson_validation=true %meson_build @@ -651,11 +648,10 @@ intltoolize --automake --copy --force --enable-concheck \ %if 0%{?fedora} --with-libpsl \ - --with-ebpf \ %else --without-libpsl \ - --without-ebpf \ %endif + --with-ebpf=%{ebpf_enabled} \ --with-session-tracking=systemd \ --with-suspend-resume=systemd \ --with-systemdsystemunitdir=%{systemd_dir} \ @@ -669,20 +665,17 @@ intltoolize --automake --copy --force %endif --with-valgrind=no \ --enable-ifcfg-rh=yes \ + --enable-config-plugin-ibft=%{ibft_enabled} \ + --enable-ifupdown=no \ %if %{with ppp} --with-pppd-plugin-dir=%{_libdir}/pppd/%{ppp_version} \ --enable-ppp=yes \ %endif --with-dist-version=%{version}-%{release} \ - --with-config-plugins-default='ifcfg-rh' \ - --with-config-dns-rc-manager-default=symlink \ - --with-config-logging-backend-default=journal \ - --enable-json-validation \ -%if %{with libnm_glib} - --with-libnm-glib -%else - --without-libnm-glib -%endif + --with-config-plugins-default=%{config_plugins_default} \ + --with-config-dns-rc-manager-default=%{dns_rc_manager_default} \ + --with-config-logging-backend-default=%{logging_backend_default} \ + --enable-json-validation make %{?_smp_mflags} @@ -759,7 +752,7 @@ fi /usr/bin/udevadm control --reload-rules || : /usr/bin/udevadm trigger --subsystem-match=net || : -%systemd_post NetworkManager.service NetworkManager-wait-online.service NetworkManager-dispatcher.service +%systemd_post %{systemd_units} %triggerin -- initscripts if [ -f %{_sbindir}/ifup -a ! -L %{_sbindir}/ifup ]; then @@ -788,13 +781,10 @@ fi /usr/bin/udevadm control --reload-rules || : /usr/bin/udevadm trigger --subsystem-match=net || : -%systemd_postun +%systemd_postun %{systemd_units} -%if 0%{?fedora} < 28 -%post glib -p /sbin/ldconfig -%postun glib -p /sbin/ldconfig - +%if (0%{?fedora} && 0%{?fedora} < 28) || 0%{?rhel} %post libnm -p /sbin/ldconfig %postun libnm -p /sbin/ldconfig %endif @@ -903,47 +893,6 @@ fi %endif -%if %{with libnm_glib} -%files glib -f %{name}.lang -%{_libdir}/libnm-glib.so.* -%{_libdir}/libnm-glib-vpn.so.* -%{_libdir}/libnm-util.so.* -%{_libdir}/girepository-1.0/NetworkManager-1.0.typelib -%{_libdir}/girepository-1.0/NMClient-1.0.typelib -%endif - - -%if %{with libnm_glib} -%files glib-devel -%dir %{_includedir}/libnm-glib -%dir %{_includedir}/%{name} -%{_includedir}/libnm-glib/*.h -%{_includedir}/%{name}/%{name}.h -%{_includedir}/%{name}/NetworkManagerVPN.h -%{_includedir}/%{name}/nm-setting*.h -%{_includedir}/%{name}/nm-connection.h -%{_includedir}/%{name}/nm-utils-enum-types.h -%{_includedir}/%{name}/nm-utils.h -%{_includedir}/%{name}/nm-version.h -%{_includedir}/%{name}/nm-version-macros.h -%{_libdir}/pkgconfig/libnm-glib.pc -%{_libdir}/pkgconfig/libnm-glib-vpn.pc -%{_libdir}/pkgconfig/libnm-util.pc -%{_libdir}/pkgconfig/%{name}.pc -%{_libdir}/libnm-glib.so -%{_libdir}/libnm-glib-vpn.so -%{_libdir}/libnm-util.so -%{_datadir}/gir-1.0/NetworkManager-1.0.gir -%{_datadir}/gir-1.0/NMClient-1.0.gir -%dir %{_datadir}/gtk-doc/html/libnm-glib -%{_datadir}/gtk-doc/html/libnm-glib/* -%dir %{_datadir}/gtk-doc/html/libnm-util -%{_datadir}/gtk-doc/html/libnm-util/* -%{_datadir}/vala/vapi/libnm-*.deps -%{_datadir}/vala/vapi/libnm-*.vapi -%endif - - %files libnm -f %{name}.lang %{_libdir}/libnm.so.* %{_libdir}/girepository-1.0/NM-1.0.typelib