archrelease: copy trunk to extra-x86_64
[arch-packages.git] / networkmanager / trunk / PKGBUILD
blobd4ba686d2ca49a718667b945a98fa623158f18f9
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>
8 pkgbase=networkmanager
9 pkgname=(networkmanager libnm nm-cloud-setup)
10 pkgver=1.42.6
11 pkgrel=1
12 pkgdesc="Network connection manager and user applications"
13 url="https://networkmanager.dev/"
14 arch=(x86_64)
15 license=(GPL)
16 _pppver=2.4.9
17 makedepends=(
18   audit
19   bluez-libs
20   curl
21   dhclient
22   dhcpcd
23   dnsmasq
24   git
25   glib2-docs
26   gobject-introspection
27   gtk-doc
28   iproute2
29   iptables
30   iwd
31   jansson
32   libmm-glib
33   libndp
34   libnewt
35   libpsl
36   libteam
37   meson
38   modemmanager
39   nftables
40   nss
41   openresolv
42   pacrunner
43   perl-yaml
44   polkit
45   "ppp=$_pppver"
46   python-gobject
47   systemd
48   vala
49   vala
50   wpa_supplicant
52 checkdepends=(
53   libx11
54   python-dbus
56 _commit=b6cc7c7e695ba3b1f2a5c95b0d6df418b8556e57  # tags/1.42.6^0
57 source=("git+https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git#commit=$_commit")
58 b2sums=('SKIP')
60 pkgver() {
61   cd NetworkManager
62   git describe --tags | sed 's/-dev/dev/;s/-rc/rc/;s/[^-]*-g/r&/;s/-/+/g'
65 prepare() {
66   cd NetworkManager
69 build() {
70   local meson_options=(
71     # system paths
72     -D dbus_conf_dir=/usr/share/dbus-1/system.d
74     # platform
75     -D dist_version="$pkgver-$pkgrel"
76     -D session_tracking_consolekit=false
77     -D suspend_resume=systemd
78     -D modify_system=true
79     -D selinux=false
81     # features
82     -D iwd=true
83     -D pppd_plugin_dir=/usr/lib/pppd/$_pppver
84     -D teamdctl=true
85     -D nm_cloud_setup=true
86     -D bluez5_dun=true
87     -D ebpf=true
89     # configuration plugins
90     -D config_plugins_default=keyfile
91     -D ifcfg_rh=false
92     -D ifupdown=false
94     # handlers for resolv.conf
95     -D netconfig=no
96     -D config_dns_rc_manager_default=symlink
98     # miscellaneous
99     -D vapi=true
100     -D docs=true
101     -D more_asserts=no
102     -D more_logging=false
103     -D qt=false
104   )
106   arch-meson NetworkManager build "${meson_options[@]}"
107   meson compile -C build
110 check() {
111   meson test -C build --print-errorlogs
114 _pick() {
115   local p="$1" f d; shift
116   for f; do
117     d="$srcdir/$p/${f#$pkgdir/}"
118     mkdir -p "$(dirname "$d")"
119     mv "$f" "$d"
120     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
121   done
124 package_networkmanager() {
125   depends=(
126     audit
127     bluez-libs
128     curl
129     iproute2
130     jansson
131     libmm-glib
132     libndp
133     libnewt
134     libnm
135     libpsl
136     libteam
137     mobile-broadband-provider-info
138     wpa_supplicant
139   )
140   optdepends=(
141     'bluez: Bluetooth support'
142     'dhclient: alternative DHCP client'
143     'dhcpcd: alternative DHCP client'
144     'dnsmasq: connection sharing'
145     'firewalld: firewall support'
146     'iptables: connection sharing'
147     'iwd: wpa_supplicant alternative'
148     'modemmanager: cellular network support'
149     'nftables: connection sharing'
150     'openresolv: alternative resolv.conf manager'
151     'pacrunner: PAC proxy support'
152     'polkit: let non-root users control networking'
153     'ppp: dialup connection support'
154   )
155   backup=(etc/NetworkManager/NetworkManager.conf)
157   meson install -C build --destdir "$pkgdir"
159   cd "$pkgdir"
161   # /etc/NetworkManager
162   install -d etc/NetworkManager/{conf,dnsmasq}.d
163   install -dm700 etc/NetworkManager/system-connections
164   install -m644 /dev/stdin etc/NetworkManager/NetworkManager.conf <<END
165 # Configuration file for NetworkManager.
166 # See "man 5 NetworkManager.conf" for details.
169   # packaged configuration
170   install -Dm644 /dev/stdin usr/lib/NetworkManager/conf.d/20-connectivity.conf <<END
171 [connectivity]
172 uri=http://ping.archlinux.org/nm-check.txt
175   shopt -s globstar
177   _pick libnm usr/include/libnm
178   _pick libnm usr/lib/girepository-1.0/NM-*
179   _pick libnm usr/lib/libnm.*
180   _pick libnm usr/lib/pkgconfig/libnm.pc
181   _pick libnm usr/share/gir-1.0/NM-*
182   _pick libnm usr/share/gtk-doc/html/libnm
183   _pick libnm usr/share/vala/vapi/libnm.*
185   _pick cloud usr/lib/**/*nm-cloud-setup*
186   _pick cloud usr/share/man/*/nm-cloud-setup*
188   # Not actually packaged (https://bugs.archlinux.org/task/69138)
189   _pick ovs usr/lib/systemd/system/NetworkManager.service.d/NetworkManager-ovs.conf
191   # Restore empty dir
192   install -d usr/lib/NetworkManager/dispatcher.d/no-wait.d
195 package_libnm() {
196   pkgdesc="NetworkManager client library"
197   license=(LGPL)
198   depends=(
199     glib2
200     nss
201     systemd-libs
202     util-linux-libs
203   )
204   provides=(libnm.so)
206   mv libnm/* "$pkgdir"
209 package_nm-cloud-setup() {
210   pkgdesc="Automatically configure NetworkManager in cloud"
211   depends=(networkmanager)
213   mv cloud/* "$pkgdir"
216 # vim:set sw=2 sts=-1 et: