PKGBUILD 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. # Maintainer: Nathan Owens <ndowens@artixlinux.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>
  7. pkgbase=networkmanager
  8. pkgname=(networkmanager libnm nm-cloud-setup)
  9. pkgver=1.38.2
  10. pkgrel=2
  11. pkgrel+=.nonsystemd1
  12. pkgdesc="Network connection manager and user applications"
  13. url="https://networkmanager.dev/"
  14. arch=(x86_64)
  15. arch+=(i686 armv7h)
  16. license=(GPL)
  17. _pppver=2.4.9
  18. makedepends=(intltool dhclient dhcpcd iptables-nft gobject-introspection gtk-doc
  19. "ppp=$_pppver" modemmanager iproute2 nss polkit wpa_supplicant curl
  20. elogind libmm-glib libnewt libndp libteam nftables vala perl-yaml
  21. python-gobject git vala jansson bluez-libs glib2-docs iwd dnsmasq
  22. openresolv libpsl audit meson)
  23. checkdepends=(libx11 python-dbus)
  24. options=(debug)
  25. _commit=abfd2d6ea729926bff0ddafa1367a54f6d6f4230 # tags/1.38.2^0
  26. source=("git+https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git#commit=$_commit")
  27. b2sums=('SKIP')
  28. pkgver() {
  29. cd NetworkManager
  30. git describe --tags | sed 's/-dev/dev/;s/-rc/rc/;s/[^-]*-g/r&/;s/-/+/g'
  31. }
  32. prepare() {
  33. cd NetworkManager
  34. }
  35. build() {
  36. local meson_options=(
  37. # system paths
  38. -D dbus_conf_dir=/usr/share/dbus-1/system.d
  39. # platform
  40. -D dist_version="$pkgver-$pkgrel"
  41. -D session_tracking_consolekit=false
  42. -D suspend_resume=elogind
  43. -D modify_system=true
  44. -D selinux=false
  45. -D systemdsystemunitdir=no
  46. -D session_tracking=elogind
  47. -D systemd_journal=false
  48. # features
  49. -D iwd=true
  50. -D pppd_plugin_dir=/usr/lib/pppd/$_pppver
  51. -D teamdctl=true
  52. -D nm_cloud_setup=true
  53. -D bluez5_dun=true
  54. -D ebpf=true
  55. # configuration plugins
  56. -D config_plugins_default=keyfile
  57. # handlers for resolv.conf
  58. -D netconfig=no
  59. -D config_dns_rc_manager_default=symlink
  60. # miscellaneous
  61. -D vapi=true
  62. -D docs=true
  63. -D more_asserts=no
  64. -D more_logging=false
  65. -D qt=false
  66. )
  67. arch-meson NetworkManager build "${meson_options[@]}"
  68. meson compile -C build
  69. }
  70. check() {
  71. meson test -C build --print-errorlogs
  72. }
  73. _pick() {
  74. local p="$1" f d; shift
  75. for f; do
  76. d="$srcdir/$p/${f#$pkgdir/}"
  77. mkdir -p "$(dirname "$d")"
  78. mv "$f" "$d"
  79. rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  80. done
  81. }
  82. package_networkmanager() {
  83. depends=(libnm iproute2 wpa_supplicant libmm-glib libnewt libndp libteam curl
  84. bluez-libs libpsl audit mobile-broadband-provider-info elogind)
  85. optdepends=(
  86. 'polkit: let non-root users control networking'
  87. 'dnsmasq: connection sharing'
  88. 'nftables: connection sharing'
  89. 'iptables: connection sharing'
  90. 'bluez: Bluetooth support'
  91. 'ppp: dialup connection support'
  92. 'modemmanager: cellular network support'
  93. 'iwd: wpa_supplicant alternative'
  94. 'dhclient: alternative DHCP client'
  95. 'dhcpcd: alternative DHCP client'
  96. 'openresolv: alternative resolv.conf manager'
  97. 'firewalld: firewall support'
  98. )
  99. backup=(etc/NetworkManager/NetworkManager.conf)
  100. meson install -C build --destdir "$pkgdir"
  101. cd "$pkgdir"
  102. # /etc/NetworkManager
  103. install -d etc/NetworkManager/{conf,dnsmasq}.d
  104. install -dm700 etc/NetworkManager/system-connections
  105. install -m644 /dev/stdin etc/NetworkManager/NetworkManager.conf <<END
  106. # Configuration file for NetworkManager.
  107. # See "man 5 NetworkManager.conf" for details.
  108. [main]
  109. plugins=keyfile
  110. hostname-node=none
  111. END
  112. # packaged configuration
  113. install -Dm644 /dev/stdin usr/lib/NetworkManager/conf.d/20-connectivity.conf <<END
  114. [connectivity]
  115. uri=http://ping.archlinux.org/nm-check.txt
  116. END
  117. shopt -s globstar
  118. _pick libnm usr/include/libnm
  119. _pick libnm usr/lib/girepository-1.0/NM-*
  120. _pick libnm usr/lib/libnm.*
  121. _pick libnm usr/lib/pkgconfig/libnm.pc
  122. _pick libnm usr/share/gir-1.0/NM-*
  123. _pick libnm usr/share/gtk-doc/html/libnm
  124. _pick libnm usr/share/vala/vapi/libnm.*
  125. _pick nm-cloud-setup "$pkgdir"/usr/lib/**/*nm-cloud-setup*
  126. # _pick nm-cloud-setup "$pkgdir"/usr/share/man/*/nm-cloud-setup* (Artix)
  127. # Restore empty dir
  128. # mkdir "$pkgdir/usr/lib/NetworkManager/dispatcher.d/no-wait.d" (Artix)
  129. }
  130. package_libnm() {
  131. pkgdesc="NetworkManager client library"
  132. depends=(glib2 nss util-linux-libs jansson libelogind)
  133. license=(LGPL)
  134. provides=(libnm.so)
  135. mv libnm/* "$pkgdir"
  136. }
  137. package_nm-cloud-setup() {
  138. pkgdesc="Automatically configure NetworkManager in cloud"
  139. depends=(networkmanager)
  140. mv nm-cloud-setup/* "$pkgdir"
  141. }
  142. # vim:set sw=2 et: