1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
2 # Contributor: Jan de Groot <jgc@archlinxu.org>
3 # Contributor: Wael Nasreddine <gandalf@siemens-mobiles.org>
4 # Contributor: Tor Krill <tor@krill.nu>
5 # Contributor: Will Rea <sillywilly@gmail.com>
6 # Contributor: Valentine Sinitsyn <e_val@inbox.ru>
9 pkgname=(networkmanager libnm nm-cloud-setup)
12 pkgdesc="Network connection manager and user applications"
13 url="https://networkmanager.dev/"
17 makedepends=(intltool dhclient dhcpcd iptables-nft gobject-introspection gtk-doc
18 "ppp=$_pppver" modemmanager iproute2 nss polkit wpa_supplicant curl
19 systemd libmm-glib libnewt libndp libteam nftables vala perl-yaml
20 python-gobject git vala jansson bluez-libs glib2-docs iwd dnsmasq
21 openresolv libpsl audit meson)
22 checkdepends=(libx11 python-dbus)
24 _commit=abfd2d6ea729926bff0ddafa1367a54f6d6f4230 # tags/1.38.2^0
25 source=("git+https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git#commit=$_commit")
30 git describe --tags | sed 's/-dev/dev/;s/-rc/rc/;s/[^-]*-g/r&/;s/-/+/g'
40 -D dbus_conf_dir=/usr/share/dbus-1/system.d
43 -D dist_version="$pkgver-$pkgrel"
44 -D session_tracking_consolekit=false
45 -D suspend_resume=systemd
51 -D pppd_plugin_dir=/usr/lib/pppd/$_pppver
53 -D nm_cloud_setup=true
57 # configuration plugins
58 -D config_plugins_default=keyfile
60 # handlers for resolv.conf
62 -D config_dns_rc_manager_default=symlink
72 arch-meson NetworkManager build "${meson_options[@]}"
73 meson compile -C build
77 meson test -C build --print-errorlogs
81 local p="$1" f d; shift
83 d="$srcdir/$p/${f#$pkgdir/}"
84 mkdir -p "$(dirname "$d")"
86 rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
90 package_networkmanager() {
91 depends=(libnm iproute2 wpa_supplicant libmm-glib libnewt libndp libteam curl
92 bluez-libs libpsl audit mobile-broadband-provider-info)
94 'polkit: let non-root users control networking'
95 'dnsmasq: connection sharing'
96 'nftables: connection sharing'
97 'iptables: connection sharing'
98 'bluez: Bluetooth support'
99 'ppp: dialup connection support'
100 'modemmanager: cellular network support'
101 'iwd: wpa_supplicant alternative'
102 'dhclient: alternative DHCP client'
103 'dhcpcd: alternative DHCP client'
104 'openresolv: alternative resolv.conf manager'
105 'firewalld: firewall support'
107 backup=(etc/NetworkManager/NetworkManager.conf)
109 meson install -C build --destdir "$pkgdir"
113 # /etc/NetworkManager
114 install -d etc/NetworkManager/{conf,dnsmasq}.d
115 install -dm700 etc/NetworkManager/system-connections
116 install -m644 /dev/stdin etc/NetworkManager/NetworkManager.conf <<END
117 # Configuration file for NetworkManager.
118 # See "man 5 NetworkManager.conf" for details.
121 # packaged configuration
122 install -Dm644 /dev/stdin usr/lib/NetworkManager/conf.d/20-connectivity.conf <<END
124 uri=http://ping.archlinux.org/nm-check.txt
129 _pick libnm usr/include/libnm
130 _pick libnm usr/lib/girepository-1.0/NM-*
131 _pick libnm usr/lib/libnm.*
132 _pick libnm usr/lib/pkgconfig/libnm.pc
133 _pick libnm usr/share/gir-1.0/NM-*
134 _pick libnm usr/share/gtk-doc/html/libnm
135 _pick libnm usr/share/vala/vapi/libnm.*
137 _pick cloud usr/lib/**/*nm-cloud-setup*
138 _pick cloud usr/share/man/*/nm-cloud-setup*
140 # Not actually packaged (https://bugs.archlinux.org/task/69138)
141 _pick ovs usr/lib/systemd/system/NetworkManager.service.d/NetworkManager-ovs.conf
144 install -d usr/lib/NetworkManager/dispatcher.d/no-wait.d
148 pkgdesc="NetworkManager client library"
150 depends=(glib2 nss util-linux-libs jansson systemd-libs)
156 package_nm-cloud-setup() {
157 pkgdesc="Automatically configure NetworkManager in cloud"
158 depends=(networkmanager)