pkgname=networkmanager pkgver=1.51.4 pkgrel=1 pkgdesc="Network connection manager and user applications" arch=('x86_64') url="https://networkmanager.dev" license=('GPL-2.0-or-later') groups=('base') depends=( 'dbus' 'curl' 'glib2' 'glibc' 'iproute2' 'jansson' 'libmm-glib' 'libndp' 'newt' 'libpsl' 'mobile-broadband-provider-info' 'nss' 'readline' 'systemd' 'util-linux' 'wpa_supplicant' ) makedepends=('gobject-introspection' 'iwd' 'libxslt' 'meson' 'modemmanager' 'python-setuptools' 'vala') backup=(etc/NetworkManager/NetworkManager.conf) install=${pkgname}.install source=(https://download.gnome.org/sources/NetworkManager/${pkgver%.*}/NetworkManager-${pkgver}.tar.xz cross_file.txt) sha256sums=(865a7cc5686a51d7efe81d7dcb3c5246bfa3b996a58629135354972804ff4d3c 1c186e8303567e4d509386276538f7f28d996ac1775bc6ff9c85795c24d91809) prepare() { cd NetworkManager-${pkgver} grep -rl '^#!.*python$' | xargs sed -i '1s/python/&3/' } build() { cd NetworkManager-${pkgver} local meson_args=( -Dlibaudit=no -Dnmtui=true -Dppp=false -Dselinux=false -Dqt=false -Dsession_tracking=systemd -Db_lto=true -Dvapi=true -Dwifi=true -Diwd=true -Dconfig_wifi_backend_default=iwd -Dconfig_plugins_default=keyfile -Ddist_version="${pkgver}-${pkgrel}" ) ${meson_options} ${meson_args[@]} ${meson_build} } package() { cd NetworkManager-${pkgver} ${meson_install} ${pkgdir} mv -v ${pkgdir}/usr/share/doc/NetworkManager{,-${pkgver}} for file in $(echo ./man/*.[1578]); do section=${file##*.} && install -vdm 755 ${pkgdir}/usr/share/man/man${section} install -vm 644 ${file} ${pkgdir}/usr/share/man/man${section}/ done cp -Rv ./docs/{api,libnm} ${pkgdir}/usr/share/doc/NetworkManager-${pkgver} install -Dm644 /dev/stdin ${pkgdir}/etc/NetworkManager/NetworkManager.conf << "EOF" [main] plugins=keyfile EOF install -Dm644 /dev/stdin ${pkgdir}/etc/NetworkManager/conf.d/polkit.conf << "EOF" [main] auth-polkit=true EOF install -Dm644 /dev/stdin ${pkgdir}/etc/NetworkManager/conf.d/dhcp.conf << "EOF" [main] dhcp=dhcpcd EOF install -Dm644 /dev/stdin ${pkgdir}/etc/NetworkManager/conf.d/no-dns-update.conf << "EOF" [main] dns=none EOF install -Dm644 /dev/stdin ${pkgdir}/usr/share/polkit-1/rules.d/org.freedesktop.NetworkManager.rules << "EOF" polkit.addRule(function(action, subject) { if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("netdev")) { return polkit.Result.YES; } }); EOF }