Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "NetworkManager" |
| 2 | HOMEPAGE = "https://wiki.gnome.org/Projects/NetworkManager" |
| 3 | SECTION = "net/misc" |
| 4 | |
| 5 | LICENSE = "GPLv2+ & LGPLv2.1+" |
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ |
| 7 | file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c \ |
| 8 | " |
| 9 | |
| 10 | DEPENDS = " \ |
| 11 | intltool-native \ |
| 12 | libxslt-native \ |
| 13 | libnl \ |
| 14 | libgudev \ |
| 15 | util-linux \ |
| 16 | libndp \ |
| 17 | libnewt \ |
| 18 | jansson \ |
| 19 | curl \ |
| 20 | " |
| 21 | |
| 22 | inherit gnomebase gettext update-rc.d systemd bash-completion vala gobject-introspection gtk-doc update-alternatives upstream-version-is-even |
| 23 | |
| 24 | SRC_URI = " \ |
| 25 | ${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \ |
| 26 | file://${BPN}.initd \ |
| 27 | file://0001-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch \ |
| 28 | file://0002-Do-not-create-settings-settings-property-documentati.patch \ |
Andrew Geissler | d221e03 | 2020-07-10 16:13:21 -0500 | [diff] [blame^] | 29 | file://0001-install-firewalld-to-var-libdir-rather-than-hardcod-.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 30 | " |
| 31 | SRC_URI_append_libc-musl = " \ |
| 32 | file://musl/0001-Fix-build-with-musl-systemd-specific.patch \ |
| 33 | file://musl/0002-Fix-build-with-musl.patch \ |
| 34 | file://musl/0003-Fix-build-with-musl-for-n-dhcp4.patch \ |
| 35 | file://musl/0004-Fix-build-with-musl-systemd-specific.patch \ |
| 36 | " |
Andrew Geissler | d221e03 | 2020-07-10 16:13:21 -0500 | [diff] [blame^] | 37 | SRC_URI[sha256sum] = "c6893971936a1ce252ba4fdff830c972d2ae93fec6751b57dcfd3ad9f0c949dd" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 38 | |
| 39 | S = "${WORKDIR}/NetworkManager-${PV}" |
| 40 | |
| 41 | EXTRA_OECONF = " \ |
| 42 | --disable-ifcfg-rh \ |
| 43 | --disable-more-warnings \ |
| 44 | --with-iptables=${sbindir}/iptables \ |
| 45 | --with-tests \ |
| 46 | --with-nmtui=yes \ |
| 47 | --with-udev-dir=${nonarch_base_libdir}/udev \ |
| 48 | " |
| 49 | |
| 50 | # stolen from https://github.com/void-linux/void-packages/blob/master/srcpkgs/NetworkManager/template |
| 51 | # avoids: |
| 52 | # | ../NetworkManager-1.16.0/libnm-core/nm-json.c:106:50: error: 'RTLD_DEEPBIND' undeclared (first use in this function); did you mean 'RTLD_DEFAULT'? |
| 53 | CFLAGS_append_libc-musl = " \ |
| 54 | -DRTLD_DEEPBIND=0 \ |
| 55 | " |
| 56 | |
| 57 | do_compile_prepend() { |
| 58 | export GIR_EXTRA_LIBS_PATH="${B}/libnm/.libs:${B}/libnm-glib/.libs:${B}/libnm-util/.libs" |
| 59 | } |
| 60 | |
| 61 | PACKAGECONFIG ??= "nss ifupdown dhclient dnsmasq \ |
| 62 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \ |
| 63 | ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} \ |
| 64 | ${@bb.utils.filter('DISTRO_FEATURES', 'wifi polkit', d)} \ |
| 65 | " |
| 66 | PACKAGECONFIG[systemd] = " \ |
| 67 | --with-systemdsystemunitdir=${systemd_unitdir}/system --with-session-tracking=systemd, \ |
| 68 | --without-systemdsystemunitdir, \ |
| 69 | " |
| 70 | PACKAGECONFIG[polkit] = "--enable-polkit,--disable-polkit,polkit" |
| 71 | PACKAGECONFIG[bluez5] = "--enable-bluez5-dun,--disable-bluez5-dun,bluez5" |
| 72 | # consolekit is not picked by shlibs, so add it to RDEPENDS too |
| 73 | PACKAGECONFIG[consolekit] = "--with-session-tracking=consolekit,,consolekit,consolekit" |
| 74 | PACKAGECONFIG[modemmanager] = "--with-modem-manager-1=yes,--with-modem-manager-1=no,modemmanager" |
| 75 | PACKAGECONFIG[ppp] = "--enable-ppp,--disable-ppp,ppp,ppp" |
| 76 | # Use full featured dhcp client instead of internal one |
| 77 | PACKAGECONFIG[dhclient] = "--with-dhclient=${base_sbindir}/dhclient,,,dhcp-client" |
| 78 | PACKAGECONFIG[dnsmasq] = "--with-dnsmasq=${bindir}/dnsmasq" |
| 79 | PACKAGECONFIG[nss] = "--with-crypto=nss,,nss" |
| 80 | PACKAGECONFIG[resolvconf] = "--with-resolvconf=${base_sbindir}/resolvconf,,,resolvconf" |
| 81 | PACKAGECONFIG[gnutls] = "--with-crypto=gnutls,,gnutls" |
| 82 | PACKAGECONFIG[wifi] = "--enable-wifi=yes,--enable-wifi=no,,wpa-supplicant" |
| 83 | PACKAGECONFIG[ifupdown] = "--enable-ifupdown,--disable-ifupdown" |
| 84 | PACKAGECONFIG[qt4-x11-free] = "--enable-qt,--disable-qt,qt4-x11-free" |
| 85 | PACKAGECONFIG[cloud-setup] = "--with-nm-cloud-setup=yes,--with-nm-cloud-setup=no" |
| 86 | |
| 87 | PACKAGES =+ " \ |
| 88 | ${PN}-nmtui ${PN}-nmtui-doc \ |
| 89 | ${PN}-adsl ${PN}-cloud-setup \ |
| 90 | " |
| 91 | |
| 92 | SYSTEMD_PACKAGES = "${PN} ${PN}-cloud-setup" |
| 93 | |
| 94 | FILES_${PN}-adsl = "${libdir}/NetworkManager/${PV}/libnm-device-plugin-adsl.so" |
| 95 | |
| 96 | FILES_${PN}-cloud-setup = " \ |
| 97 | ${libexecdir}/nm-cloud-setup \ |
| 98 | ${systemd_system_unitdir}/nm-cloud-setup.service \ |
| 99 | ${systemd_system_unitdir}/nm-cloud-setup.timer \ |
| 100 | ${libdir}/NetworkManager/dispatcher.d/90-nm-cloud-setup.sh \ |
| 101 | ${libdir}/NetworkManager/dispatcher.d/no-wait.d/90-nm-cloud-setup.sh \ |
| 102 | " |
| 103 | ALLOW_EMPTY_${PN}-cloud-setup = "1" |
| 104 | SYSTEMD_SERVICE_${PN}-cloud-setup = "${@bb.utils.contains('PACKAGECONFIG', 'cloud-setup', 'nm-cloud-setup.service nm-cloud-setup.timer', '', d)}" |
| 105 | |
| 106 | FILES_${PN} += " \ |
| 107 | ${libexecdir} \ |
| 108 | ${libdir}/NetworkManager/${PV}/*.so \ |
| 109 | ${libdir}/NetworkManager \ |
Andrew Geissler | d221e03 | 2020-07-10 16:13:21 -0500 | [diff] [blame^] | 110 | ${libdir}/firewalld/zones \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 111 | ${nonarch_libdir}/NetworkManager/conf.d \ |
| 112 | ${nonarch_libdir}/NetworkManager/dispatcher.d \ |
| 113 | ${nonarch_libdir}/NetworkManager/dispatcher.d/pre-down.d \ |
| 114 | ${nonarch_libdir}/NetworkManager/dispatcher.d/pre-up.d \ |
| 115 | ${nonarch_libdir}/NetworkManager/dispatcher.d/no-wait.d \ |
| 116 | ${nonarch_libdir}/NetworkManager/VPN \ |
| 117 | ${nonarch_libdir}/NetworkManager/system-connections \ |
| 118 | ${datadir}/polkit-1 \ |
| 119 | ${datadir}/dbus-1 \ |
| 120 | ${nonarch_base_libdir}/udev/* \ |
| 121 | ${systemd_system_unitdir} \ |
| 122 | ${libdir}/pppd \ |
| 123 | " |
| 124 | |
| 125 | RRECOMMENDS_${PN} += "iptables \ |
| 126 | ${@bb.utils.filter('PACKAGECONFIG', 'dnsmasq', d)} \ |
| 127 | " |
| 128 | RCONFLICTS_${PN} = "connman" |
| 129 | |
| 130 | FILES_${PN}-dev += " \ |
| 131 | ${datadir}/NetworkManager/gdb-cmd \ |
| 132 | ${libdir}/pppd/*/*.la \ |
| 133 | ${libdir}/NetworkManager/*.la \ |
| 134 | ${libdir}/NetworkManager/${PV}/*.la \ |
| 135 | " |
| 136 | |
| 137 | FILES_${PN}-nmtui = " \ |
| 138 | ${bindir}/nmtui \ |
| 139 | ${bindir}/nmtui-edit \ |
| 140 | ${bindir}/nmtui-connect \ |
| 141 | ${bindir}/nmtui-hostname \ |
| 142 | " |
| 143 | |
| 144 | FILES_${PN}-nmtui-doc = " \ |
| 145 | ${mandir}/man1/nmtui* \ |
| 146 | " |
| 147 | |
| 148 | INITSCRIPT_NAME = "network-manager" |
| 149 | SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'NetworkManager.service NetworkManager-dispatcher.service', '', d)}" |
| 150 | |
| 151 | ALTERNATIVE_PRIORITY = "100" |
| 152 | ALTERNATIVE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}" |
| 153 | ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.NetworkManager','',d)}" |
| 154 | ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}" |
| 155 | |
| 156 | do_install_append() { |
| 157 | install -Dm 0755 ${WORKDIR}/${BPN}.initd ${D}${sysconfdir}/init.d/network-manager |
| 158 | |
| 159 | rm -rf ${D}/run ${D}${localstatedir}/run |
| 160 | |
| 161 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 162 | # For read-only filesystem, do not create links during bootup |
| 163 | ln -sf ../run/NetworkManager/resolv.conf ${D}${sysconfdir}/resolv-conf.NetworkManager |
| 164 | |
| 165 | # systemd v210 and newer do not need this rule file |
| 166 | rm ${D}/${nonarch_base_libdir}/udev/rules.d/84-nm-drivers.rules |
| 167 | fi |
| 168 | } |