Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [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 | udev \ |
| 15 | util-linux \ |
| 16 | libndp \ |
| 17 | libnewt \ |
| 18 | curl \ |
| 19 | " |
| 20 | |
| 21 | inherit gnomebase gettext update-rc.d systemd vala gobject-introspection gtk-doc update-alternatives upstream-version-is-even |
| 22 | |
| 23 | SRC_URI = " \ |
| 24 | ${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \ |
| 25 | file://${BPN}.initd \ |
| 26 | file://0001-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch \ |
| 27 | file://0002-Do-not-create-settings-settings-property-documentati.patch \ |
| 28 | file://0003-install-firewalld-to-var-libdir-rather-than-hardcod-.patch \ |
| 29 | " |
| 30 | SRC_URI[sha256sum] = "819795d0899076204f5672421a58f1b1d9e393536ee87bb844b911e6243bf0bd" |
| 31 | |
| 32 | S = "${WORKDIR}/NetworkManager-${PV}" |
| 33 | |
| 34 | EXTRA_OECONF = " \ |
| 35 | --disable-ifcfg-rh \ |
| 36 | --disable-more-warnings \ |
| 37 | --with-iptables=${sbindir}/iptables \ |
| 38 | --with-tests \ |
| 39 | --with-nmtui=yes \ |
| 40 | --with-udev-dir=${nonarch_base_libdir}/udev \ |
| 41 | --with-dhclient=no \ |
| 42 | --with-dhcpcd=no \ |
| 43 | --with-dhcpcanon=no \ |
| 44 | --with-netconfig=no \ |
| 45 | " |
| 46 | |
| 47 | # stolen from https://github.com/void-linux/void-packages/blob/master/srcpkgs/NetworkManager/template |
| 48 | # avoids: |
| 49 | # | ../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'? |
| 50 | CFLAGS:append:libc-musl = " \ |
| 51 | -DRTLD_DEEPBIND=0 \ |
| 52 | " |
| 53 | |
| 54 | do_compile:prepend() { |
| 55 | export GIR_EXTRA_LIBS_PATH="${B}/src/libnm-client-impl/.libs" |
| 56 | } |
| 57 | |
| 58 | PACKAGECONFIG ??= "nss ifupdown dnsmasq nmcli \ |
| 59 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \ |
| 60 | ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} \ |
| 61 | ${@bb.utils.filter('DISTRO_FEATURES', 'wifi polkit', d)} \ |
| 62 | ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux audit', '', d)} \ |
| 63 | " |
| 64 | |
| 65 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'nmcli', 'bash-completion', '', d)} |
| 66 | |
| 67 | PACKAGECONFIG[systemd] = " \ |
| 68 | --with-systemdsystemunitdir=${systemd_unitdir}/system --with-session-tracking=systemd, \ |
| 69 | --without-systemdsystemunitdir, \ |
| 70 | " |
| 71 | PACKAGECONFIG[polkit] = "--enable-polkit,--disable-polkit,polkit" |
| 72 | PACKAGECONFIG[bluez5] = "--enable-bluez5-dun,--disable-bluez5-dun,bluez5" |
| 73 | # consolekit is not picked by shlibs, so add it to RDEPENDS too |
| 74 | PACKAGECONFIG[consolekit] = "--with-session-tracking=consolekit,,consolekit,consolekit" |
| 75 | PACKAGECONFIG[modemmanager] = "--with-modem-manager-1=yes,--with-modem-manager-1=no,modemmanager" |
| 76 | PACKAGECONFIG[ppp] = "--enable-ppp,--disable-ppp,ppp,ppp" |
| 77 | PACKAGECONFIG[dnsmasq] = "--with-dnsmasq=${bindir}/dnsmasq" |
| 78 | PACKAGECONFIG[nss] = "--with-crypto=nss,,nss" |
| 79 | PACKAGECONFIG[resolvconf] = "--with-resolvconf=${base_sbindir}/resolvconf,,,resolvconf" |
| 80 | PACKAGECONFIG[gnutls] = "--with-crypto=gnutls,,gnutls" |
| 81 | PACKAGECONFIG[wifi] = "--with-wext=yes --enable-wifi=yes,--with-wext=no --enable-wifi=no,,wpa-supplicant" |
| 82 | PACKAGECONFIG[ifupdown] = "--enable-ifupdown,--disable-ifupdown" |
| 83 | PACKAGECONFIG[qt4-x11-free] = "--enable-qt,--disable-qt,qt4-x11-free" |
| 84 | PACKAGECONFIG[cloud-setup] = "--with-nm-cloud-setup=yes,--with-nm-cloud-setup=no" |
| 85 | PACKAGECONFIG[nmcli] = "--with-nmcli=yes,--with-nmcli=no,readline" |
| 86 | PACKAGECONFIG[ovs] = "--enable-ovs,--disable-ovs,jansson" |
| 87 | PACKAGECONFIG[audit] = "--with-libaudit,--without-libaudit,audit" |
| 88 | PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux" |
| 89 | |
| 90 | PACKAGES =+ " \ |
| 91 | ${PN}-nmcli ${PN}-nmcli-doc \ |
| 92 | ${PN}-nmtui ${PN}-nmtui-doc \ |
| 93 | ${PN}-adsl ${PN}-cloud-setup \ |
| 94 | " |
| 95 | |
| 96 | SYSTEMD_PACKAGES = "${PN} ${PN}-cloud-setup" |
| 97 | |
| 98 | FILES:${PN}-adsl = "${libdir}/NetworkManager/${PV}/libnm-device-plugin-adsl.so" |
| 99 | |
| 100 | FILES:${PN}-cloud-setup = " \ |
| 101 | ${libexecdir}/nm-cloud-setup \ |
| 102 | ${systemd_system_unitdir}/nm-cloud-setup.service \ |
| 103 | ${systemd_system_unitdir}/nm-cloud-setup.timer \ |
| 104 | ${libdir}/NetworkManager/dispatcher.d/90-nm-cloud-setup.sh \ |
| 105 | ${libdir}/NetworkManager/dispatcher.d/no-wait.d/90-nm-cloud-setup.sh \ |
| 106 | " |
| 107 | ALLOW_EMPTY:${PN}-cloud-setup = "1" |
| 108 | SYSTEMD_SERVICE:${PN}-cloud-setup = "${@bb.utils.contains('PACKAGECONFIG', 'cloud-setup', 'nm-cloud-setup.service nm-cloud-setup.timer', '', d)}" |
| 109 | |
| 110 | FILES:${PN} += " \ |
| 111 | ${libexecdir} \ |
| 112 | ${libdir}/NetworkManager/${PV}/*.so \ |
| 113 | ${libdir}/NetworkManager \ |
| 114 | ${libdir}/firewalld/zones \ |
| 115 | ${nonarch_libdir}/NetworkManager/conf.d \ |
| 116 | ${nonarch_libdir}/NetworkManager/dispatcher.d \ |
| 117 | ${nonarch_libdir}/NetworkManager/dispatcher.d/pre-down.d \ |
| 118 | ${nonarch_libdir}/NetworkManager/dispatcher.d/pre-up.d \ |
| 119 | ${nonarch_libdir}/NetworkManager/dispatcher.d/no-wait.d \ |
| 120 | ${nonarch_libdir}/NetworkManager/VPN \ |
| 121 | ${nonarch_libdir}/NetworkManager/system-connections \ |
| 122 | ${datadir}/polkit-1 \ |
| 123 | ${datadir}/dbus-1 \ |
| 124 | ${nonarch_base_libdir}/udev/* \ |
| 125 | ${systemd_system_unitdir} \ |
| 126 | ${libdir}/pppd \ |
| 127 | " |
| 128 | |
| 129 | RRECOMMENDS:${PN} += "iptables \ |
| 130 | ${@bb.utils.filter('PACKAGECONFIG', 'dnsmasq', d)} \ |
| 131 | " |
| 132 | RCONFLICTS:${PN} = "connman" |
| 133 | |
| 134 | FILES:${PN}-dev += " \ |
| 135 | ${datadir}/NetworkManager/gdb-cmd \ |
| 136 | ${libdir}/pppd/*/*.la \ |
| 137 | ${libdir}/NetworkManager/*.la \ |
| 138 | ${libdir}/NetworkManager/${PV}/*.la \ |
| 139 | " |
| 140 | |
| 141 | FILES:${PN}-nmcli = " \ |
| 142 | ${bindir}/nmcli \ |
| 143 | " |
| 144 | |
| 145 | FILES:${PN}-nmcli-doc = " \ |
| 146 | ${mandir}/man1/nmcli* \ |
| 147 | " |
| 148 | |
| 149 | FILES:${PN}-nmtui = " \ |
| 150 | ${bindir}/nmtui \ |
| 151 | ${bindir}/nmtui-edit \ |
| 152 | ${bindir}/nmtui-connect \ |
| 153 | ${bindir}/nmtui-hostname \ |
| 154 | " |
| 155 | |
| 156 | FILES:${PN}-nmtui-doc = " \ |
| 157 | ${mandir}/man1/nmtui* \ |
| 158 | " |
| 159 | |
| 160 | INITSCRIPT_NAME = "network-manager" |
| 161 | SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'NetworkManager.service NetworkManager-dispatcher.service', '', d)}" |
| 162 | |
| 163 | ALTERNATIVE_PRIORITY = "100" |
| 164 | ALTERNATIVE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}" |
| 165 | ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.NetworkManager','',d)}" |
| 166 | ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}" |
| 167 | |
| 168 | do_install:append() { |
| 169 | install -Dm 0755 ${WORKDIR}/${BPN}.initd ${D}${sysconfdir}/init.d/network-manager |
| 170 | |
| 171 | rm -rf ${D}/run ${D}${localstatedir}/run |
| 172 | |
| 173 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 174 | # For read-only filesystem, do not create links during bootup |
| 175 | ln -sf ../run/NetworkManager/resolv.conf ${D}${sysconfdir}/resolv-conf.NetworkManager |
| 176 | |
| 177 | # systemd v210 and newer do not need this rule file |
| 178 | rm ${D}/${nonarch_base_libdir}/udev/rules.d/84-nm-drivers.rules |
| 179 | fi |
| 180 | } |