summaryrefslogtreecommitdiff
path: root/nonsystemd/networkmanager/PKGBUILD
blob: 4061ccfb1e208b87f9134290ca82e0a41efa4d0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# Maintainer: Nathan Owens <ndowens@artixlinux.org>
# Contributor: Jan de Groot <jgc@archlinxu.org>
# Contributor: Wael Nasreddine <gandalf@siemens-mobiles.org>
# Contributor: Tor Krill <tor@krill.nu>
# Contributor: Will Rea <sillywilly@gmail.com>
# Contributor: Valentine Sinitsyn <e_val@inbox.ru>

pkgbase=networkmanager
pkgname=(networkmanager libnm nm-cloud-setup)
pkgver=1.38.2
pkgrel=2
pkgrel+=.nonsystemd1
pkgdesc="Network connection manager and user applications"
url="https://networkmanager.dev/"
arch=(x86_64)
arch+=(i686 armv7h)
license=(GPL)
_pppver=2.4.9
makedepends=(intltool dhclient dhcpcd iptables-nft gobject-introspection gtk-doc
             "ppp=$_pppver" modemmanager iproute2 nss polkit wpa_supplicant curl
             elogind libmm-glib libnewt libndp libteam nftables vala perl-yaml
             python-gobject git vala jansson bluez-libs glib2-docs iwd dnsmasq
             openresolv libpsl audit meson)
checkdepends=(libx11 python-dbus)
options=(debug)
_commit=abfd2d6ea729926bff0ddafa1367a54f6d6f4230  # tags/1.38.2^0
source=("git+https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd NetworkManager
  git describe --tags | sed 's/-dev/dev/;s/-rc/rc/;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd NetworkManager
}

build() {
  local meson_options=(
    # system paths
    -D dbus_conf_dir=/usr/share/dbus-1/system.d

    # platform
    -D dist_version="$pkgver-$pkgrel"
    -D session_tracking_consolekit=false
    -D suspend_resume=elogind
    -D modify_system=true
    -D selinux=false
    -D systemdsystemunitdir=no
    -D session_tracking=elogind
    -D systemd_journal=false

    # features
    -D iwd=true
    -D pppd_plugin_dir=/usr/lib/pppd/$_pppver
    -D teamdctl=true
    -D nm_cloud_setup=true
    -D bluez5_dun=true
    -D ebpf=true

    # configuration plugins
    -D config_plugins_default=keyfile

    # handlers for resolv.conf
    -D netconfig=no
    -D config_dns_rc_manager_default=symlink

    # miscellaneous
    -D vapi=true
    -D docs=true
    -D more_asserts=no
    -D more_logging=false
    -D qt=false
  )

  arch-meson NetworkManager build "${meson_options[@]}"
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

_pick() {
  local p="$1" f d; shift
  for f; do
    d="$srcdir/$p/${f#$pkgdir/}"
    mkdir -p "$(dirname "$d")"
    mv "$f" "$d"
    rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  done
}

package_networkmanager() {
  depends=(libnm iproute2 wpa_supplicant libmm-glib libnewt libndp libteam curl
           bluez-libs libpsl audit mobile-broadband-provider-info elogind)
  optdepends=(
    'polkit: let non-root users control networking'
    'dnsmasq: connection sharing'
    'nftables: connection sharing'
    'iptables: connection sharing'
    'bluez: Bluetooth support'
    'ppp: dialup connection support'
    'modemmanager: cellular network support'
    'iwd: wpa_supplicant alternative'
    'dhclient: alternative DHCP client'
    'dhcpcd: alternative DHCP client'
    'openresolv: alternative resolv.conf manager'
    'firewalld: firewall support'
  )
  backup=(etc/NetworkManager/NetworkManager.conf)

  meson install -C build --destdir "$pkgdir"

  cd "$pkgdir"

  # /etc/NetworkManager
  install -d etc/NetworkManager/{conf,dnsmasq}.d
  install -dm700 etc/NetworkManager/system-connections
  install -m644 /dev/stdin etc/NetworkManager/NetworkManager.conf <<END
# Configuration file for NetworkManager.
# See "man 5 NetworkManager.conf" for details.
[main]
plugins=keyfile
hostname-node=none
END

  # packaged configuration
  install -Dm644 /dev/stdin usr/lib/NetworkManager/conf.d/20-connectivity.conf <<END
[connectivity]
uri=http://ping.archlinux.org/nm-check.txt
END

  shopt -s globstar

  _pick libnm usr/include/libnm
  _pick libnm usr/lib/girepository-1.0/NM-*
  _pick libnm usr/lib/libnm.*
  _pick libnm usr/lib/pkgconfig/libnm.pc
  _pick libnm usr/share/gir-1.0/NM-*
  _pick libnm usr/share/gtk-doc/html/libnm
  _pick libnm usr/share/vala/vapi/libnm.*

  _pick nm-cloud-setup "$pkgdir"/usr/lib/**/*nm-cloud-setup*
#  _pick nm-cloud-setup "$pkgdir"/usr/share/man/*/nm-cloud-setup* (Artix)

  # Restore empty dir
# mkdir "$pkgdir/usr/lib/NetworkManager/dispatcher.d/no-wait.d" (Artix)
}

package_libnm() {
  pkgdesc="NetworkManager client library"
  depends=(glib2 nss util-linux-libs jansson libelogind)
  license=(LGPL)
  provides=(libnm.so)

  mv libnm/* "$pkgdir"
}

package_nm-cloud-setup() {
  pkgdesc="Automatically configure NetworkManager in cloud"
  depends=(networkmanager)

  mv nm-cloud-setup/* "$pkgdir"
}

# vim:set sw=2 et: