diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2018-09-21 22:49:20 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2018-09-28 17:25:46 +0200 |
commit | 295b9d5b81946ca0bd249dc08aeb613c530c4734 (patch) | |
tree | c2fcd438e6a0bb453b32c4d7601209fd19ea8a72 /contrib | |
parent | 1f18783404cc97e795c7d1e89a4d1baabb3af643 (diff) | |
download | NetworkManager-295b9d5b81946ca0bd249dc08aeb613c530c4734.tar.gz |
contrib/rpm: support building with meson
Add support for building with meson, enabled by '--with meson' so that
we can regularly test the whole build+test+install procedure with
meson. I compared the RPM contents of NM, NM-libnm, NM-libnm-devel
packages and they match the autotools ones. It's also faster:
$ time contrib/fedora/rpm/build_clean.sh -g -Q -f
real 3m54.239s
user 11m15.000s
sys 1m28.456s
$ time contrib/fedora/rpm/build_clean.sh -g -Q -f -w meson
real 3m9.938s
user 9m5.225s
sys 1m4.392s
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/fedora/rpm/NetworkManager.spec | 113 |
1 files changed, 112 insertions, 1 deletions
diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index b32255090a..e9aa69ee3d 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -45,6 +45,7 @@ ############################################################################### +%bcond_with meson %bcond_without adsl %bcond_without bluetooth %bcond_without wwan @@ -144,8 +145,12 @@ Conflicts: kde-plasma-networkmanagement < 1:0.9-0.49.20110527git.nm09 BuildRequires: gcc BuildRequires: libtool BuildRequires: pkgconfig +%if %{with meson} +BuildRequires: meson +%else BuildRequires: automake BuildRequires: autoconf +%endif BuildRequires: intltool BuildRequires: gettext-devel @@ -453,6 +458,99 @@ by nm-connection-editor and nm-applet in a non-graphical environment. %build +%if %{with meson} +%meson \ + -Ddhcpcanon=no \ + -Ddhcpcd=no \ + -Dconfig_dhcp_default=%{dhcp_default} \ +%if %{with crypto_gnutls} + -Dcrypto=gnutls \ +%else + -Dcrypto=nss \ +%endif +%if %{with debug} + -Dmore_logging=true \ + -Dmore_asserts=10000 \ +%else + -Dmore_logging=false \ + -Dmore_asserts=0 \ +%endif + -Dld_gc=true \ + -Dlibaudit=yes-disabled-by-default \ +%if 0%{?with_modem_manager_1} + -Dmodem_manager=true \ +%else + -Dmodem_manager=false \ +%endif +%if %{with wifi} + -Dwifi=true \ +%if 0%{?fedora} + -Dwext=true \ +%else + -Dwext=false \ +%endif +%else + -Dwifi=false \ +%endif +%if %{with iwd} + -Diwd=true \ +%else + -Diwd=false \ +%endif + -Dvapi=true \ + -Dintrospection=true \ +%if %{with regen_docs} + -Ddocs=true \ +%else + -Ddocs=false \ +%endif +%if %{with team} + -Dteamdctl=true \ +%else + -Dteamdctl=false \ +%endif +%if %{with ovs} + -Dovs=true \ +%else + -Dovs=false \ +%endif + -Dselinux=true \ + -Dpolkit=yes \ + -Dpolkit_agent=true \ + -Dmodify_system=true \ + -Dconcheck=true \ +%if 0%{?fedora} + -Dlibpsl=true \ +%else + -Dlibpsl=false \ +%endif + -Dsession_tracking=systemd \ + -Dsuspend_resume=systemd \ + -Dsystemdsystemunitdir=%{systemd_dir} \ + -Dsystem_ca_path=/etc/pki/tls/cert.pem \ + -Ddbus_conf_dir=%{dbus_sys_dir} \ + -Dtests=yes \ + -Dvalgrind=no \ + -Difcfg_rh=true \ +%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 + +%meson_build + +%else +# autotools %if %{with regen_docs} gtkdocize %endif @@ -565,10 +663,14 @@ intltoolize --automake --copy --force make %{?_smp_mflags} +%endif # end autotools %install -# install NM +%if %{with meson} +%meson_install +%else make install DESTDIR=%{buildroot} +%endif cp %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/ @@ -604,11 +706,20 @@ touch %{buildroot}%{_sbindir}/ifup %{buildroot}%{_sbindir}/ifdown %check +%if %{with meson} +%if %{with test} +%meson_test +%else +%ninja_test -C %{_vpath_builddir} || : +%endif +%else +# autotools %if %{with test} make -k %{?_smp_mflags} check %else make -k %{?_smp_mflags} check || : %endif +%endif # end autotools %pre |