NetworkManager.spec 23.6 KB
Newer Older
1 2 3
# SPEC file to build NetworkManager for testing. It aims for a similar
# configuration as rhel-7.0 and Fedora rawhide
#
4
# This spec file is not used as is to create official packages for RHEL, Fedora or any
5
# other distribution.
6 7 8
#
# Note that it contains __PLACEHOLDERS__ that will be replaced by the accompanying 'build.sh' script.

9

10
%global wireless_tools_version 1:28-0pre9
11

12 13
%global wpa_supplicant_version 1:1.1

14
%global ppp_version %(sed -n 's/^#define\\s*VERSION\\s*"\\([^\\s]*\\)"$/\\1/p' %{_includedir}/pppd/patchlevel.h 2>/dev/null | grep . || echo bad)
15
%global glib2_version %(pkg-config --modversion glib-2.0 2>/dev/null || echo bad)
16

17
%global epoch_version 1
18 19
%global rpm_version __VERSION__
%global real_version __VERSION__
20
%global release_version __RELEASE_VERSION__
21
%global snapshot __SNAPSHOT__
22
%global git_sha __COMMIT__
23

24
%global obsoletes_device_plugins 1:0.9.9.95-1
25
%global obsoletes_ppp_plugin     1:1.5.3
26

27 28
%global systemd_dir %{_prefix}/lib/systemd/system
%global nmlibdir %{_prefix}/lib/%{name}
29
%global nmplugindir %{_libdir}/%{name}/%{version}-%{release}
30

31 32
%global _hardened_build 1

33
%if "x%{?snapshot}" != x
34 35
%global snapshot_dot .%{snapshot}
%endif
36
%if "x%{?git_sha}" != x
37 38 39
%global git_sha_dot .%{git_sha}
%endif

40
%global snap %{?snapshot_dot}%{?git_sha_dot}
41

42 43
%global real_version_major %(printf '%s' '%{real_version}' | sed -n 's/^\\([1-9][0-9]*\\.[1-9][0-9]*\\)\\.[1-9][0-9]*$/\\1/p')

44 45
###############################################################################

46
%bcond_with meson
47 48 49 50 51
%bcond_without adsl
%bcond_without bluetooth
%bcond_without wwan
%bcond_without team
%bcond_without wifi
52
%bcond_with iwd
53
%bcond_without ovs
54
%bcond_without ppp
55 56 57
%bcond_without nmtui
%bcond_without regen_docs
%bcond_with    debug
58
%bcond_with    test
59
%bcond_with    lto
60
%bcond_with    sanitizer
61 62 63 64 65
%if 0%{?fedora}
%bcond_without connectivity_fedora
%else
%bcond_with connectivity_fedora
%endif
66
%if 0%{?rhel} && 0%{?rhel} > 7
67 68 69 70
%bcond_without connectivity_redhat
%else
%bcond_with connectivity_redhat
%endif
71 72 73 74 75
%if 0%{?fedora} > 28 || 0%{?rhel} > 7
%bcond_without crypto_gnutls
%else
%bcond_with crypto_gnutls
%endif
76 77 78

###############################################################################

79 80 81 82 83 84 85 86
%if 0%{?fedora}
%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

87
%if %{with bluetooth} || %{with wwan}
88 89 90
%global with_modem_manager_1 1
%else
%global with_modem_manager_1 0
91
%endif
92

93
%if 0%{?fedora} || 0%{?rhel} <= 7
94 95 96 97 98
%global dhcp_default dhclient
%else
%global dhcp_default internal
%endif

99
###############################################################################
100

101 102
Name: NetworkManager
Summary: Network connection manager and user applications
103
Epoch: %{epoch_version}
104
Version: %{rpm_version}
105
Release: %{release_version}%{?snap}%{?dist}
106 107 108 109
Group: System Environment/Base
License: GPLv2+
URL: http://www.gnome.org/projects/NetworkManager/

110
#Source: https://download.gnome.org/sources/NetworkManager/%{real_version_major}/%{name}-%{real_version}.tar.xz
111 112 113
Source: __SOURCE1__
Source1: NetworkManager.conf
Source2: 00-server.conf
114 115
Source4: 20-connectivity-fedora.conf
Source5: 20-connectivity-redhat.conf
116

117
#Patch1: 0001-some.patch
118 119

Requires(post): systemd
120
Requires(post): /usr/sbin/update-alternatives
121
Requires(preun): systemd
122
Requires(preun): /usr/sbin/update-alternatives
123 124 125 126
Requires(postun): systemd

Requires: dbus >= %{dbus_version}
Requires: glib2 >= %{glib2_version}
127
Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release}
128
Obsoletes: dhcdbd
129
Obsoletes: NetworkManager < %{obsoletes_device_plugins}
130
Obsoletes: NetworkManager < %{obsoletes_ppp_plugin}
131
Obsoletes: NetworkManager-wimax < 1.2
132 133 134 135 136 137 138

Conflicts: NetworkManager-vpnc < 1:0.7.0.99-1
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

139
BuildRequires: gcc
140 141
BuildRequires: libtool
BuildRequires: pkgconfig
142 143 144
%if %{with meson}
BuildRequires: meson
%else
145 146
BuildRequires: automake
BuildRequires: autoconf
147
%endif
148 149 150
BuildRequires: intltool
BuildRequires: gettext-devel

151 152 153 154
BuildRequires: dbus-devel >= %{dbus_version}
%if 0%{?fedora}
BuildRequires: wireless-tools-devel >= %{wireless_tools_version}
%endif
155
BuildRequires: glib2-devel >= 2.40.0
156
BuildRequires: gobject-introspection-devel >= 0.10.3
157
%if %{with ppp}
158
BuildRequires: ppp-devel >= 2.4.5
159
%endif
160 161 162
%if %{with crypto_gnutls}
BuildRequires: gnutls-devel >= 2.12
%else
163
BuildRequires: nss-devel >= 3.11.7
164
%endif
165
BuildRequires: dhclient
166
BuildRequires: readline-devel
Beniamino Galvani's avatar
Beniamino Galvani committed
167
BuildRequires: audit-libs-devel
168
%if %{with regen_docs}
169 170 171 172
BuildRequires: gtk-doc
%endif
BuildRequires: libudev-devel
BuildRequires: libuuid-devel
173
BuildRequires: /usr/bin/valac
174
BuildRequires: iptables
175
BuildRequires: libxslt
176
%if %{with bluetooth}
177 178
BuildRequires: bluez-libs-devel
%endif
179
BuildRequires: systemd >= 200-3 systemd-devel
180
%if 0%{?fedora}
181
BuildRequires: libpsl-devel >= 0.1
182
%endif
183
BuildRequires: libcurl-devel
184
BuildRequires: libndp-devel >= 1.0
185
%if 0%{?with_modem_manager_1}
186 187
BuildRequires: ModemManager-glib-devel >= 1.0
%endif
188
%if %{with nmtui}
189 190
BuildRequires: newt-devel
%endif
Lubomir Rintel's avatar
Lubomir Rintel committed
191
BuildRequires: /usr/bin/dbus-launch
Lubomir Rintel's avatar
Lubomir Rintel committed
192 193 194 195 196 197
%if 0%{?fedora} > 27 || 0%{?rhel} > 7
BuildRequires: python3
BuildRequires: python3-gobject-base
BuildRequires: python3-dbus
%else
BuildRequires: python2
Lubomir Rintel's avatar
Lubomir Rintel committed
198 199
BuildRequires: pygobject3-base
BuildRequires: dbus-python
Lubomir Rintel's avatar
Lubomir Rintel committed
200
%endif
201
BuildRequires: libselinux-devel
202
BuildRequires: polkit-devel
203
BuildRequires: jansson-devel
204 205 206 207 208 209
%if %{with sanitizer}
BuildRequires: libasan
%if 0%{?fedora}
BuildRequires: libubsan
%endif
%endif
210

211 212 213 214 215 216 217 218 219 220 221 222
# NetworkManager uses various parts of systemd-networkd internally, including
# DHCP client, IPv4 Link-Local address negotiation or LLDP support.
# This provide is essentially here so that NetworkManager shows on Security
# Response Team's radar in case a flaw is found. The code is frequently
# synchronized and thus it's not easy to establish a good version number
# here. The version of zero is there just to have something conservative so
# that the scripts that would parse the SPEC file naively would be unlikely
# to fail. Refer to git log for the real date and commit number of last
# synchronization:
# https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commits/master/src/systemd
Provides: bundled(systemd) = 0

223 224

%description
225 226 227 228 229
NetworkManager is a system service that manages network interfaces and
connections based on user or automatic configuration. It supports
Ethernet, Bridge, Bond, VLAN, Team, InfiniBand, Wi-Fi, mobile broadband
(WWAN), PPPoE and other devices, and supports a variety of different VPN
services.
230 231


232
%if %{with adsl}
233
%package adsl
234 235 236
Summary: ADSL device plugin for NetworkManager
Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
237
Obsoletes: NetworkManager < %{obsoletes_device_plugins}
238
Obsoletes: NetworkManager-atm
239

240
%description adsl
241 242 243 244
This package contains NetworkManager support for ADSL devices.
%endif


245
%if %{with bluetooth}
246
%package bluetooth
247 248 249
Summary: Bluetooth device plugin for NetworkManager
Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
250
Requires: NetworkManager-wwan = %{epoch}:%{version}-%{release}
251
Requires: bluez >= 4.101-5
252
Obsoletes: NetworkManager < %{obsoletes_device_plugins}
253
Obsoletes: NetworkManager-bt
254

255
%description bluetooth
256 257 258 259
This package contains NetworkManager support for Bluetooth devices.
%endif


Thomas Haller's avatar
Thomas Haller committed
260
%if %{with team}
261 262 263 264 265
%package team
Summary: Team device plugin for NetworkManager
Group: System Environment/Base
BuildRequires: teamd-devel
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
266
Obsoletes: NetworkManager < %{obsoletes_device_plugins}
267 268
# Team was split from main NM binary between 0.9.10 and 1.0
Obsoletes: NetworkManager < 1.0.0
269 270 271 272 273 274

%description team
This package contains NetworkManager support for team devices.
%endif


275
%if %{with wifi}
276 277 278 279
%package wifi
Summary: Wifi plugin for NetworkManager
Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
280 281 282 283 284 285 286 287 288 289

%if %{with iwd} && (0%{?fedora} > 24 || 0%{?rhel} > 7)
Requires: (wpa_supplicant >= %{wpa_supplicant_version} or iwd)
%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

290
Obsoletes: NetworkManager < %{obsoletes_device_plugins}
291 292 293 294 295 296

%description wifi
This package contains NetworkManager support for Wifi and OLPC devices.
%endif


297
%if %{with wwan}
298 299 300 301
%package wwan
Summary: Mobile broadband device plugin for NetworkManager
Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
302
Requires: ModemManager
303
Obsoletes: NetworkManager < %{obsoletes_device_plugins}
304 305

%description wwan
306 307
This package contains NetworkManager support for mobile broadband (WWAN)
devices.
308 309
%endif

310 311 312

%if %{with ovs}
%package ovs
313
Summary: Open vSwitch device plugin for NetworkManager
314 315
Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
316
%if 0%{?rhel} == 0
317
Requires: openvswitch
318
%endif
319 320

%description ovs
321
This package contains NetworkManager support for Open vSwitch bridges.
322 323 324
%endif


325 326 327 328 329 330
%if %{with ppp}
%package ppp
Summary: PPP plugin for NetworkManager
Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
Requires: ppp = %{ppp_version}
331
Requires: NetworkManager = %{epoch}:%{version}-%{release}
332 333 334 335 336 337
Obsoletes: NetworkManager < %{obsoletes_ppp_plugin}

%description ppp
This package contains NetworkManager support for PPP.
%endif

338

339 340 341
%package libnm
Summary: Libraries for adding NetworkManager support to applications (new API).
Group: Development/Libraries
342
Conflicts: NetworkManager-glib < %{epoch}:%{version}-%{release}
343 344

%description libnm
345 346 347
This package contains the libraries that make it easier to use some
NetworkManager functionality from applications.  This is the new
NetworkManager API.  See also NetworkManager-glib.
348 349 350 351 352 353 354 355 356 357


%package libnm-devel
Summary: Header files for adding NetworkManager support to applications (new API).
Group: Development/Libraries
Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release}
Requires: glib2-devel
Requires: pkgconfig

%description libnm-devel
358 359 360
This package contains the header and pkg-config files for development
applications using NetworkManager functionality from applications.  This
is the new NetworkManager API. See also NetworkManager-glib-devel.
361

362

363
%if %{with connectivity_fedora}
364 365 366
%package config-connectivity-fedora
Summary: NetworkManager config file for connectivity checking via Fedora servers
Group: System Environment/Base
367
BuildArch: noarch
368
Provides: NetworkManager-config-connectivity = %{epoch}:%{version}-%{release}
369 370 371 372

%description config-connectivity-fedora
This adds a NetworkManager configuration file to enable connectivity checking
via Fedora infrastructure.
373
%endif
374

375

376 377 378 379 380 381 382 383 384 385 386 387 388
%if %{with connectivity_redhat}
%package config-connectivity-redhat
Summary: NetworkManager config file for connectivity checking via Red Hat servers
Group: System Environment/Base
BuildArch: noarch
Provides: NetworkManager-config-connectivity = %{epoch}:%{version}-%{release}

%description config-connectivity-redhat
This adds a NetworkManager configuration file to enable connectivity checking
via Red Hat infrastructure.
%endif


389 390 391
%package config-server
Summary: NetworkManager config file for "server-like" defaults
Group: System Environment/Base
392
BuildArch: noarch
393 394 395 396 397 398 399 400 401 402 403

%description config-server
This adds a NetworkManager configuration file to make it behave more
like the old "network" service. In particular, it stops NetworkManager
from automatically running DHCP on unconfigured ethernet devices, and
allows connections with static IP addresses to be brought up even on
ethernet devices with no carrier.

This package is intended to be installed by default for server
deployments.

404

405 406
%package dispatcher-routing-rules
Summary: NetworkManager dispatcher file for advanced routing rules
407
Group: System Environment/Base
408
BuildArch: noarch
409 410
Provides: %{name}-config-routing-rules = %{epoch}:%{version}-%{release}
Obsoletes: %{name}-config-routing-rules < %{epoch}:%{version}-%{release}
411

412 413
%description dispatcher-routing-rules
This adds a NetworkManager dispatcher file to support networking
414 415 416
configurations using "/etc/sysconfig/network-scripts/rule-NAME" files
(eg, to do policy-based routing).

417

418 419 420 421
%if 0%{with_nmtui}
%package tui
Summary: NetworkManager curses-based UI
Group: System Environment/Base
422
Requires: %{name} = %{epoch}:%{version}-%{release}
423
Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release}
424 425 426 427 428 429 430

%description tui
This adds a curses-based "TUI" (Text User Interface) to
NetworkManager, to allow performing some of the operations supported
by nm-connection-editor and nm-applet in a non-graphical environment.
%endif

431

432
%prep
433
%autosetup -p1 -n NetworkManager-%{real_version}
434

435

436
%build
437 438
%if %{with meson}
%meson \
439 440 441 442
	--warnlevel 2 \
%if %{with test}
	--werror \
%endif
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458
	-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 \
459 460 461 462 463
%if %{with lto}
	-D b_lto=true \
%else
	-D b_lto=false \
%endif
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502
	-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 \
503
	-Dpolkit=true  \
504 505 506 507 508
	-Dpolkit_agent=true \
	-Dmodify_system=true \
	-Dconcheck=true \
%if 0%{?fedora}
	-Dlibpsl=true \
509
	-Debpf=true \
510 511
%else
	-Dlibpsl=false \
512
	-Debpf=false \
513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529
%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 \
Lubomir Rintel's avatar
Lubomir Rintel committed
530
	-Djson_validation=true
531 532 533 534 535

%meson_build

%else
# autotools
536
%if %{with regen_docs}
537
gtkdocize
538
%endif
539
autoreconf --install --force
540
intltoolize --automake --copy --force
541
%configure \
Lubomir Rintel's avatar
Lubomir Rintel committed
542
	--disable-silent-rules \
543 544 545
	--disable-static \
	--with-dhclient=yes \
	--with-dhcpcd=no \
juga's avatar
juga committed
546
	--with-dhcpcanon=no \
547
	--with-config-dhcp-default=%{dhcp_default} \
548 549 550
%if %{with crypto_gnutls}
	--with-crypto=gnutls \
%else
551
	--with-crypto=nss \
552
%endif
553
%if %{with sanitizer}
554 555
	--with-address-sanitizer=exec \
%if 0%{?fedora}
556
	--enable-undefined-sanitizer \
557
%endif
558
%else
559
	--with-address-sanitizer=no \
560 561
	--disable-undefined-sanitizer \
%endif
562
%if %{with debug}
563
	--enable-more-logging \
564
	--with-more-asserts=10000 \
565 566 567
%else
	--disable-more-logging \
	--without-more-asserts \
568
%endif
569
	--enable-ld-gc \
570 571 572 573 574
%if %{with lto}
	--enable-lto \
%else
	--disable-lto \
%endif
575
	--with-libaudit=yes-disabled-by-default \
576
%if 0%{?with_modem_manager_1}
577 578 579 580
	--with-modem-manager-1=yes \
%else
	--with-modem-manager-1=no \
%endif
581
%if %{with wifi}
582
	--enable-wifi=yes \
583 584 585 586 587
%if 0%{?fedora}
	--with-wext=yes \
%else
	--with-wext=no \
%endif
588 589
%else
	--enable-wifi=no \
590 591 592 593 594
%endif
%if %{with iwd}
	--with-iwd=yes \
%else
	--with-iwd=no \
595 596
%endif
	--enable-vala=yes \
597
	--enable-introspection \
598
%if %{with regen_docs}
599
	--enable-gtk-doc \
600 601
%else
	--disable-gtk-doc \
602
%endif
603
%if %{with team}
604
	--enable-teamdctl=yes \
605
%else
606
	--enable-teamdctl=no \
607 608 609 610 611
%endif
%if %{with ovs}
	--enable-ovs=yes \
%else
	--enable-ovs=no \
612
%endif
613
	--with-selinux=yes \
614
	--enable-polkit=yes \
615
	--enable-polkit-agent \
616 617
	--enable-modify-system=yes \
	--enable-concheck \
618
%if 0%{?fedora}
619
	--with-libpsl \
620
	--with-ebpf \
621
%else
622
	--without-libpsl \
623
	--without-ebpf \
624
%endif
625 626 627
	--with-session-tracking=systemd \
	--with-suspend-resume=systemd \
	--with-systemdsystemunitdir=%{systemd_dir} \
628
	--with-system-ca-path=/etc/pki/tls/cert.pem \
629
	--with-dbus-sys-dir=%{dbus_sys_dir} \
630
	--with-tests=yes \
631 632 633
%if %{with test}
	--enable-more-warnings=error \
%else
634
	--enable-more-warnings=yes \
635
%endif
636 637
	--with-valgrind=no \
	--enable-ifcfg-rh=yes \
638
%if %{with ppp}
639
	--with-pppd-plugin-dir=%{_libdir}/pppd/%{ppp_version} \
640 641
	--enable-ppp=yes \
%endif
642
	--with-dist-version=%{version}-%{release} \
643
	--with-config-plugins-default='ifcfg-rh' \
644
	--with-config-dns-rc-manager-default=symlink \
645
	--with-config-logging-backend-default=journal \
Lubomir Rintel's avatar
Lubomir Rintel committed
646
	--enable-json-validation
647 648 649

make %{?_smp_mflags}

650
%endif # end autotools
651

652
%install
653 654 655
%if %{with meson}
%meson_install
%else
656
make install DESTDIR=%{buildroot}
657
%endif
658

659
cp %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/
660

661
cp %{SOURCE2} %{buildroot}%{nmlibdir}/conf.d/
662 663

%if %{with connectivity_fedora}
664
cp %{SOURCE4} %{buildroot}%{nmlibdir}/conf.d/
665
%endif
666

667
%if %{with connectivity_redhat}
668
cp %{SOURCE5} %{buildroot}%{nmlibdir}/conf.d/
669 670
%endif

671
cp examples/dispatcher/10-ifcfg-rh-routes.sh %{buildroot}%{_sysconfdir}/%{name}/dispatcher.d/
672 673
ln -s ../no-wait.d/10-ifcfg-rh-routes.sh %{buildroot}%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d/
ln -s ../10-ifcfg-rh-routes.sh %{buildroot}%{_sysconfdir}/%{name}/dispatcher.d/no-wait.d/
674

675 676
%find_lang %{name}

677 678
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/pppd/%{ppp_version}/*.la
679
rm -f %{buildroot}%{nmplugindir}/*.la
680

681 682
# Ensure the documentation timestamps are constant to avoid multilib conflicts
find %{buildroot}%{_datadir}/gtk-doc -exec touch --reference configure.ac '{}' \+
683

684 685 686 687 688
%if 0%{?__debug_package}
mkdir -p %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
cp valgrind.suppressions %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
%endif

689 690
touch %{buildroot}%{_sbindir}/ifup %{buildroot}%{_sbindir}/ifdown

691

Lubomir Rintel's avatar
Lubomir Rintel committed
692
%check
693 694 695 696 697 698 699 700
%if %{with meson}
%if %{with test}
%meson_test
%else
%ninja_test -C %{_vpath_builddir} || :
%endif
%else
# autotools
701
%if %{with test}
702 703 704
make -k %{?_smp_mflags} check
%else
make -k %{?_smp_mflags} check || :
705
%endif
706
%endif # end autotools
Lubomir Rintel's avatar
Lubomir Rintel committed
707 708


709 710 711 712 713 714 715 716 717 718
%pre
if [ -f "%{systemd_dir}/network-online.target.wants/NetworkManager-wait-online.service" ] ; then
    # older versions used to install this file, effectively always enabling
    # NetworkManager-wait-online.service. We no longer do that and rely on
    # preset.
    # But on package upgrade we must explicitly enable it (rh#1455704).
    systemctl enable NetworkManager-wait-online.service || :
fi


719
%post
720 721 722
/usr/bin/udevadm control --reload-rules || :
/usr/bin/udevadm trigger --subsystem-match=net || :

723 724
%systemd_post NetworkManager.service NetworkManager-wait-online.service NetworkManager-dispatcher.service

725 726 727 728 729 730 731 732 733
%triggerin -- initscripts
if [ -f %{_sbindir}/ifup -a ! -L %{_sbindir}/ifup ]; then
    # initscripts package too old, won't let us set an alternative
    /usr/sbin/update-alternatives --remove ifup %{_libexecdir}/nm-ifup >/dev/null 2>&1 || :
else
    /usr/sbin/update-alternatives --install %{_sbindir}/ifup ifup %{_libexecdir}/nm-ifup 50 \
        --slave %{_sbindir}/ifdown ifdown %{_libexecdir}/nm-ifdown
fi

734

735 736 737 738 739 740 741
%preun
if [ $1 -eq 0 ]; then
    # Package removal, not upgrade
    /bin/systemctl --no-reload disable NetworkManager.service >/dev/null 2>&1 || :

    # Don't kill networking entirely just on package remove
    #/bin/systemctl stop NetworkManager.service >/dev/null 2>&1 || :
742 743

    /usr/sbin/update-alternatives --remove ifup %{_libexecdir}/nm-ifup >/dev/null 2>&1 || :
744 745 746
fi
%systemd_preun NetworkManager-wait-online.service NetworkManager-dispatcher.service

747

748
%postun
749 750 751
/usr/bin/udevadm control --reload-rules || :
/usr/bin/udevadm trigger --subsystem-match=net || :

752 753
%systemd_postun

754

755
%if 0%{?fedora} < 28
756 757
%post   libnm -p /sbin/ldconfig
%postun libnm -p /sbin/ldconfig
758
%endif
759

760

761
%files
762 763 764
%{dbus_sys_dir}/org.freedesktop.NetworkManager.conf
%{dbus_sys_dir}/nm-dispatcher.conf
%{dbus_sys_dir}/nm-ifcfg-rh.conf
765 766 767 768 769
%{_sbindir}/%{name}
%{_bindir}/nmcli
%{_datadir}/bash-completion/completions/nmcli
%dir %{_sysconfdir}/%{name}/
%dir %{_sysconfdir}/%{name}/dispatcher.d
770 771
%dir %{_sysconfdir}/%{name}/dispatcher.d/pre-down.d
%dir %{_sysconfdir}/%{name}/dispatcher.d/pre-up.d
772
%dir %{_sysconfdir}/%{name}/dispatcher.d/no-wait.d
773
%dir %{_sysconfdir}/%{name}/dnsmasq.d
774
%dir %{_sysconfdir}/%{name}/dnsmasq-shared.d
775 776
%config(noreplace) %{_sysconfdir}/%{name}/NetworkManager.conf
%{_bindir}/nm-online
777
%{_libexecdir}/nm-ifup
778
%ghost %attr(755, root, root) %{_sbindir}/ifup
779
%{_libexecdir}/nm-ifdown
780
%ghost %attr(755, root, root) %{_sbindir}/ifdown
781
%{_libexecdir}/nm-dhcp-helper
782
%{_libexecdir}/nm-dispatcher
783
%{_libexecdir}/nm-iface-helper
784
%{_libexecdir}/nm-initrd-generator
785 786 787
%dir %{_libdir}/%{name}
%dir %{nmplugindir}
%{nmplugindir}/libnm-settings-plugin*.so
788
%if %{with nmtui}
789 790
%exclude %{_mandir}/man1/nmtui*
%endif
791 792
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/conf.d
793 794
%dir %{nmlibdir}
%dir %{nmlibdir}/conf.d
795
%dir %{nmlibdir}/VPN
796 797
%{_mandir}/man1/*
%{_mandir}/man5/*
Lubomir Rintel's avatar
Lubomir Rintel committed
798
%{_mandir}/man7/nmcli-examples.7*
799 800 801
%{_mandir}/man8/*
%dir %{_localstatedir}/lib/NetworkManager
%dir %{_sysconfdir}/NetworkManager/system-connections
802
%dir %{_sysconfdir}/sysconfig/network-scripts
803 804
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service
%{_datadir}/polkit-1/actions/*.policy
805
%{_prefix}/lib/udev/rules.d/*.rules
806 807 808 809
# systemd stuff
%{systemd_dir}/NetworkManager.service
%{systemd_dir}/NetworkManager-wait-online.service
%{systemd_dir}/NetworkManager-dispatcher.service
810
%dir %{_datadir}/doc/NetworkManager/examples
811
%{_datadir}/doc/NetworkManager/examples/server.conf
812 813
%doc NEWS AUTHORS README CONTRIBUTING TODO
%license COPYING
814

815

816
%if %{with adsl}
817
%files adsl
818
%{nmplugindir}/libnm-device-plugin-adsl.so
819
%else
820
%exclude %{nmplugindir}/libnm-device-plugin-adsl.so
821 822
%endif

823

824
%if %{with bluetooth}
825
%files bluetooth
826
%{nmplugindir}/libnm-device-plugin-bluetooth.so
827 828
%endif

829

830
%if %{with team}
831
%files team
832
%{nmplugindir}/libnm-device-plugin-team.so
833 834
%endif

835

836
%if %{with wifi}
837
%files wifi
838
%{nmplugindir}/libnm-device-plugin-wifi.so
839 840
%endif

841

842
%if %{with wwan}
843
%files wwan
844 845
%{nmplugindir}/libnm-device-plugin-wwan.so
%{nmplugindir}/libnm-wwan.so
846 847
%endif

848

849 850
%if %{with ovs}
%files ovs
851
%{nmplugindir}/libnm-device-plugin-ovs.so
852
%{systemd_dir}/NetworkManager.service.d/NetworkManager-ovs.conf
Lubomir Rintel's avatar
Lubomir Rintel committed
853
%{_mandir}/man7/nm-openvswitch.7*
854 855
%endif

856

857 858 859
%if %{with ppp}
%files ppp
%{_libdir}/pppd/%{ppp_version}/nm-pppd-plugin.so
860
%{nmplugindir}/libnm-ppp-plugin.so
861 862
%endif

863

864
%files libnm -f %{name}.lang
865 866 867
%{_libdir}/libnm.so.*
%{_libdir}/girepository-1.0/NM-1.0.typelib

868

869 870 871 872 873 874 875 876
%files libnm-devel
%dir %{_includedir}/libnm
%{_includedir}/libnm/*.h
%{_libdir}/pkgconfig/libnm.pc
%{_libdir}/libnm.so
%{_datadir}/gir-1.0/NM-1.0.gir
%dir %{_datadir}/gtk-doc/html/libnm
%{_datadir}/gtk-doc/html/libnm/*
877 878
%dir %{_datadir}/gtk-doc/html/NetworkManager
%{_datadir}/gtk-doc/html/NetworkManager/*
879 880
%{_datadir}/vala/vapi/libnm.deps
%{_datadir}/vala/vapi/libnm.vapi
881
%{_datadir}/dbus-1/interfaces/*.xml
882

883

884
%if %{with connectivity_fedora}
885
%files config-connectivity-fedora
886 887 888
%dir %{nmlibdir}
%dir %{nmlibdir}/conf.d
%{nmlibdir}/conf.d/20-connectivity-fedora.conf
889
%endif
890

891

892 893 894 895 896 897 898 899
%if %{with connectivity_redhat}
%files config-connectivity-redhat
%dir %{nmlibdir}
%dir %{nmlibdir}/conf.d
%{nmlibdir}/conf.d/20-connectivity-redhat.conf
%endif


900
%files config-server
901 902 903
%dir %{nmlibdir}
%dir %{nmlibdir}/conf.d
%{nmlibdir}/conf.d/00-server.conf
904

905

906
%files dispatcher-routing-rules
907 908 909 910
%{_sysconfdir}/%{name}/dispatcher.d/10-ifcfg-rh-routes.sh
%{_sysconfdir}/%{name}/dispatcher.d/no-wait.d/10-ifcfg-rh-routes.sh
%{_sysconfdir}/%{name}/dispatcher.d/pre-up.d/10-ifcfg-rh-routes.sh

911

912
%if %{with nmtui}
913
%files tui
914
%{_bindir}/nmtui
915
%{_bindir}/nmtui-edit
916 917
%{_bindir}/nmtui-connect
%{_bindir}/nmtui-hostname
918
%{_mandir}/man1/nmtui*
919
%endif
920

921

922 923
%changelog
__CHANGELOG__