PKGBUILD 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. # Maintainer: David P. <megver83@parabola.nu>
  2. # Maintainer (Arch): Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
  3. # Maintainer (Arch): Jan de Groot <jgc@archlinxu.org>
  4. # Contributor (Arch): Wael Nasreddine <gandalf@siemens-mobiles.org>
  5. # Contributor (Arch): Tor Krill <tor@krill.nu>
  6. # Contributor (Arch): Will Rea <sillywilly@gmail.com>
  7. # Contributor (Arch): Valentine Sinitsyn <e_val@inbox.ru>
  8. pkgbase=networkmanager
  9. pkgname=(networkmanager libnm)
  10. pkgver=1.20.6
  11. pkgrel=1
  12. pkgrel+=.nonsystemd1
  13. pkgdesc="Network connection manager and user applications"
  14. url="https://wiki.gnome.org/Projects/NetworkManager"
  15. arch=(x86_64 i686 armv7h)
  16. license=(GPL2 LGPL2.1)
  17. _pppver=2.4.7
  18. makedepends=(intltool dhclient iptables gobject-introspection gtk-doc "ppp=$_pppver" modemmanager
  19. iproute2 nss polkit wpa_supplicant curl elogind libmm-glib
  20. libnewt libndp libteam vala perl-yaml python-gobject git vala jansson bluez-libs
  21. glib2-docs dhcpcd iwd dnsmasq openresolv libpsl audit meson)
  22. checkdepends=(libx11 python-dbus)
  23. _commit=7910cdfe5a9ffe02cd0780d56fcc66500e292d09 # tags/1.20.6^0
  24. source=("git+https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git#commit=$_commit"
  25. NetworkManager.{confd,initd} 10-openrc-status)
  26. sha256sums=('SKIP'
  27. '4594573f01fe5e04b6dde4525796acf909158591bdcefd662ec23fe0d1c3e1bd'
  28. '861445d46e8863dca26a91018da3dd9fee6a64467a93e7512774dfd88914539d'
  29. '1535237db113a76261d6f1ce0b24a55e956934b0c1c59e9fd624f621961327b6')
  30. pkgver() {
  31. cd NetworkManager
  32. git describe | sed 's/-dev/dev/;s/-rc/rc/;s/-/+/g'
  33. }
  34. prepare() {
  35. cd NetworkManager
  36. }
  37. build() {
  38. local meson_args=(
  39. -D dbus_conf_dir=/usr/share/dbus-1/system.d
  40. -D dist_version="$pkgver-$pkgrel"
  41. -D session_tracking_consolekit=false
  42. -D suspend_resume=elogind
  43. -D modify_system=true
  44. -D polkit_agent=true
  45. -D selinux=false
  46. -D iwd=true
  47. -D pppd_plugin_dir=/usr/lib/pppd/$_pppver
  48. -D teamdctl=true
  49. -D bluez5_dun=true
  50. -D ebpf=true
  51. -D config_plugins_default=keyfile
  52. -D vapi=true
  53. -D docs=true
  54. -D more_asserts=no
  55. -D more_logging=false
  56. -D qt=false
  57. -D systemdsystemunitdir=no
  58. -D session_tracking=elogind
  59. -D systemd_journal=false
  60. )
  61. arch-meson NetworkManager build "${meson_args[@]}"
  62. ninja -C build
  63. }
  64. check() {
  65. # iproute2 bug
  66. # https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/be76d8b624fab99cbd76092ff511e6adc305279c
  67. meson test -C build --print-errorlogs || :
  68. }
  69. _pick() {
  70. local p="$1" f d; shift
  71. for f; do
  72. d="$srcdir/$p/${f#$pkgdir/}"
  73. mkdir -p "$(dirname "$d")"
  74. mv "$f" "$d"
  75. rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  76. done
  77. }
  78. package_networkmanager() {
  79. depends=(libnm iproute2 polkit wpa_supplicant libmm-glib libnewt libndp libteam curl
  80. bluez-libs libpsl audit elogind)
  81. optdepends=('dnsmasq: connection sharing'
  82. 'bluez: Bluetooth support'
  83. 'ppp: dialup connection support'
  84. 'modemmanager: cellular network support'
  85. 'iwd: wpa_supplicant alternative')
  86. provides=($pkgname-{elogind,openrc})
  87. replaces=($pkgname-{elogind,openrc})
  88. backup=(etc/NetworkManager/NetworkManager.conf)
  89. groups=(gnome)
  90. DESTDIR="$pkgdir" meson install -C build
  91. # /etc/NetworkManager
  92. install -d "$pkgdir"/etc/NetworkManager/{conf,dnsmasq}.d
  93. install -dm700 "$pkgdir/etc/NetworkManager/system-connections"
  94. install -m644 /dev/stdin "$pkgdir/etc/NetworkManager/NetworkManager.conf" <<END
  95. # Configuration file for NetworkManager.
  96. # See "man 5 NetworkManager.conf" for details.
  97. END
  98. # packaged configuration
  99. install -Dm644 /dev/stdin "$pkgdir/usr/lib/NetworkManager/conf.d/20-connectivity.conf" <<END
  100. [connectivity]
  101. uri=http://www.archlinux.org/check_network_status.txt
  102. END
  103. ### Split libnm
  104. _pick libnm "$pkgdir"/usr/include/libnm
  105. _pick libnm "$pkgdir"/usr/lib/girepository-1.0/NM-*
  106. _pick libnm "$pkgdir"/usr/lib/libnm.*
  107. _pick libnm "$pkgdir"/usr/lib/pkgconfig/libnm.pc
  108. _pick libnm "$pkgdir"/usr/share/gir-1.0/NM-*
  109. _pick libnm "$pkgdir"/usr/share/gtk-doc/html/libnm
  110. _pick libnm "$pkgdir"/usr/share/vala/vapi/libnm.*
  111. # Init script
  112. install -Dm755 ${srcdir}/NetworkManager.confd ${pkgdir}/etc/conf.d/NetworkManager
  113. install -Dm755 ${srcdir}/NetworkManager.initd ${pkgdir}/etc/init.d/NetworkManager
  114. install -Dm755 "${srcdir}/10-openrc-status" "${pkgdir}/etc/NetworkManager/dispatcher.d/10-openrc-status"
  115. sed -e 's|#!/sbin/openrc-run|#!/usr/bin/openrc-run|g' \
  116. -e 's|/var/run|/run|g' \
  117. -e 's|/usr/sbin|/usr/bin|g' \
  118. -e 's|use consolekit|use consolekit elogind|' \
  119. -i ${pkgdir}/etc/init.d/NetworkManager
  120. }
  121. package_libnm() {
  122. pkgdesc="NetworkManager client library"
  123. depends=(glib2 nss libutil-linux jansson libelogind)
  124. mv libnm/* "$pkgdir"
  125. }
  126. # vim:set sw=2 et: