From de9449483a5ebc3f6ec15176b4b38e3210121b4c Mon Sep 17 00:00:00 2001 From: Sayan Chowdhury Date: Fri, 19 Mar 2021 18:59:58 +0530 Subject: [PATCH 1/3] net-dns/dnsmasq: Sync with Gentoo upstream Signed-off-by: Sayan Chowdhury --- .../portage-stable/net-dns/dnsmasq/Manifest | 6 +- .../net-dns/dnsmasq/dnsmasq-2.76-r1.ebuild | 192 --------------- .../net-dns/dnsmasq/dnsmasq-2.76.ebuild | 188 --------------- .../net-dns/dnsmasq/dnsmasq-2.77-r1.ebuild | 198 ---------------- .../net-dns/dnsmasq/dnsmasq-2.77.ebuild | 196 ---------------- .../net-dns/dnsmasq/dnsmasq-2.78.ebuild | 198 ---------------- ...asq-2.82.ebuild => dnsmasq-2.83-r1.ebuild} | 13 +- .../net-dns/dnsmasq/dnsmasq-2.83-r101.ebuild | 217 +++++++++++++++++ .../net-dns/dnsmasq/dnsmasq-2.84-r101.ebuild | 221 ++++++++++++++++++ .../net-dns/dnsmasq/dnsmasq-2.84.ebuild | 212 +++++++++++++++++ .../files/dnsmasq-2.84-version-string.patch | 13 ++ .../dnsmasq/files/dnsmasq-init-dhcp-r1 | 29 --- .../dnsmasq/files/dnsmasq-init-dhcp-r2 | 29 --- .../net-dns/dnsmasq/files/dnsmasq-init-r2 | 23 -- .../net-dns/dnsmasq/files/dnsmasq-init-r3 | 23 -- .../net-dns/dnsmasq/metadata.xml | 3 +- 16 files changed, 675 insertions(+), 1086 deletions(-) delete mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.76-r1.ebuild delete mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.76.ebuild delete mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.77-r1.ebuild delete mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.77.ebuild delete mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.78.ebuild rename sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/{dnsmasq-2.82.ebuild => dnsmasq-2.83-r1.ebuild} (93%) create mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.83-r101.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.84-r101.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.84.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-2.84-version-string.patch delete mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-dhcp-r1 delete mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-dhcp-r2 delete mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-r2 delete mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-r3 diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/Manifest b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/Manifest index 61ed038655..8d32f2d0f7 100644 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/Manifest +++ b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/Manifest @@ -1,4 +1,2 @@ -DIST dnsmasq-2.76.tar.xz 480796 SHA256 4b92698dee19ca0cb2a8f2e48f1d2dffd01a21eb15d1fbed4cf085630c8c9f96 SHA512 8a930f3e7cdc0c291ce89bea8128a4b8438b9aa9e660a2ac037e0baa4c5c74f4482a8f83b0410066a759444b3c4e1cf62a9beb625e38509690227996de10e06a WHIRLPOOL e0710f879fd6f8e27581b8c400704660941601cd2077f32d7c2b3f9791c6be8404469770e74f7e1a03880507a32a30c19b89f6a953a757ad01305f829448f0bc -DIST dnsmasq-2.77.tar.xz 487244 SHA256 6eac3b1c50ae25170e3ff8c96ddb55236cf45007633fdb8a35b1f3e02f5f8b8a SHA512 6ca98a71a8fdfd606e29c58b34dadfa63148c39f931570cca67a287e044d52c6ec2f8acbf5620ada3312e9db3a2fd63877188d829c070beaa730607e3309e768 WHIRLPOOL 94a4fdc23d81fe38456756d81e53f1258ccd360c4d22952c889f2d5f76d401696587a5362f5aacd1ef86799874ac9eae3c3879d0fe81b66beeafb2f3ce0e01d0 -DIST dnsmasq-2.78.tar.xz 489172 SHA256 89949f438c74b0c7543f06689c319484bd126cc4b1f8c745c742ab397681252b SHA512 9b79b84e5a768d52f90f6335ccef2c404ecd7a13e78e49f4cd0755fffc6cf34d0dc96ad4c72cad1dab3c5743a8d0d789b3e9b6e625b03c5675bb898ca61a698b WHIRLPOOL 3fdde3511c39b5f42a8166936576b60f7114a54388e317136ef9c4b5770c02106706dc0612361b18d25fa16a340e613c98aa78973e2dc038dc93f2a664d27606 -DIST dnsmasq-2.82.tar.xz 509904 BLAKE2B 4df3778b2ec6775a6147f66d53b8dd7068d97872c6e5d3a16716faeb0ca489331560c77d6fa9cc913af0d7e0320a6ef463c690bb9e3fdbd8c266ed273e5a5403 SHA512 faf36efdaa3abe84994e46aea018b0a324218d42814baac056ca635f6d03f1301e7b4d958f92b272a8e3a7ac358f3a4e2606129a217587b471aedb3ce23e903b +DIST dnsmasq-2.83.tar.xz 513880 BLAKE2B 16220fd7eac03f3ba70b014ace3c9775a85b31cdbabd7680d88a87697453a54bfec4c553207477f416032e679dbdaf3ca6c8bb56b72ee423540e0bedf0621865 SHA512 1eaade775dc19658afe825407c10456ab954b82034644bb19af2594d737ceae17ff2cee7f1f917e8e8b2dadbfbcb83dd8b842c0693fcac71487a5fade1eb4b05 +DIST dnsmasq-2.84.tar.xz 514216 BLAKE2B 2bca97c16bcf32e0126eb50dc14b82a1f37e1635ebd1dc205e9a92455640fcbb98c093be725768ba9ced84443e451775f8556a164c82967e09e1df4bf7fc901b SHA512 e84bdcdf3cf35f08e8492eb5aa89ee6543233bdb821d01f164783bd6d0913ec01c513e85e2109352c77e77142a1a94bedcd3361f37d7b2a9a5d35a02448e85c6 diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.76-r1.ebuild b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.76-r1.ebuild deleted file mode 100644 index 27f157cd66..0000000000 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.76-r1.ebuild +++ /dev/null @@ -1,192 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit eutils toolchain-funcs flag-o-matic user systemd - -DESCRIPTION="Small forwarding DNS server" -HOMEPAGE="http://www.thekelleys.org.uk/dnsmasq/doc.html" -SRC_URI="http://www.thekelleys.org.uk/dnsmasq/${P}.tar.xz" - -LICENSE="|| ( GPL-2 GPL-3 )" -SLOT="0" -KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~sparc-fbsd ~x86-fbsd" -IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec idn +inotify ipv6 lua nls script selinux static tftp" -DM_LINGUAS="de es fi fr id it no pl pt_BR ro" -for dm_lingua in ${DM_LINGUAS}; do - IUSE+=" linguas_${dm_lingua}" -done - -CDEPEND="dbus? ( sys-apps/dbus ) - idn? ( net-dns/libidn ) - lua? ( dev-lang/lua:* ) - conntrack? ( net-libs/libnetfilter_conntrack ) - nls? ( - sys-devel/gettext - net-dns/libidn - ) -" - -DEPEND="${CDEPEND} - app-arch/xz-utils - dnssec? ( - dev-libs/nettle[gmp] - static? ( - dev-libs/nettle[static-libs(+)] - ) - ) - virtual/pkgconfig" - -RDEPEND="${CDEPEND} - dnssec? ( - !static? ( - dev-libs/nettle[gmp] - ) - ) - selinux? ( sec-policy/selinux-dnsmasq ) -" - -REQUIRED_USE="dhcp-tools? ( dhcp ) - lua? ( script )" - -use_have() { - local useflag no_only uword - if [[ $1 == '-n' ]]; then - no_only=1 - shift - fi - useflag="${1}" - shift - - uword="${1:-${useflag}}" - shift - - while [[ ${uword} ]]; do - uword="${uword^^}" - - if ! use "${useflag}"; then - echo -n " -DNO_${uword}" - elif [[ -z "${no_only}" ]]; then - echo -n " -DHAVE_${uword}" - fi - uword="${1}" - shift - done -} - -pkg_pretend() { - if use static; then - einfo "Only sys-libs/gmp and dev-libs/nettle are statically linked." - use dnssec || einfo "Thus, ${P}[!dnssec,static] makes no sense; the static USE flag is ignored." - fi -} - -pkg_setup() { - enewgroup dnsmasq - enewuser dnsmasq -1 -1 /dev/null dnsmasq -} - -src_prepare() { - default - - sed -i -r 's:lua5.[0-9]+:lua:' Makefile - sed -i "s:%%PREFIX%%:${EPREFIX}/usr:" dnsmasq.conf.example -} - -src_configure() { - COPTS="$(use_have -n auth-dns auth)" - COPTS+="$(use_have conntrack)" - COPTS+="$(use_have dbus)" - COPTS+="$(use_have idn)" - COPTS+="$(use_have -n inotify)" - COPTS+="$(use_have -n dhcp dhcp dhcp6)" - COPTS+="$(use_have -n ipv6 ipv6 dhcp6)" - COPTS+="$(use_have lua luascript)" - COPTS+="$(use_have -n script)" - COPTS+="$(use_have -n tftp)" - COPTS+="$(use_have dnssec)" - COPTS+="$(use_have static dnssec_static)" -} - -src_compile() { - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - COPTS="${COPTS}" \ - CONFFILE="/etc/${PN}.conf" \ - all$(use nls && echo "-i18n") - - use dhcp-tools && emake -C contrib/lease-tools \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - all -} - -src_install() { - local lingua puid - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - COPTS="${COPTS}" \ - DESTDIR="${D}" \ - install$(use nls && echo "-i18n") - - for lingua in ${DM_LINGUAS}; do - use linguas_${lingua} || rm -rf "${D}"/usr/share/locale/${lingua} - done - [[ -d "${D}"/usr/share/locale/ ]] && rmdir --ignore-fail-on-non-empty "${D}"/usr/share/locale/ - - dodoc CHANGELOG CHANGELOG.archive FAQ dnsmasq.conf.example - dodoc -r logo - - docinto html/ - dodoc *.html - - newinitd "${FILESDIR}"/dnsmasq-init-r2 ${PN} - newconfd "${FILESDIR}"/dnsmasq.confd-r1 ${PN} - - insinto /etc - newins dnsmasq.conf.example dnsmasq.conf - - insinto /usr/share/dnsmasq - doins trust-anchors.conf - - if use dhcp; then - dodir /var/lib/misc - newinitd "${FILESDIR}"/dnsmasq-init-dhcp-r1 ${PN} - fi - if use dbus; then - insinto /etc/dbus-1/system.d - doins dbus/dnsmasq.conf - fi - - if use dhcp-tools; then - dosbin contrib/lease-tools/{dhcp_release,dhcp_lease_time} - doman contrib/lease-tools/{dhcp_release,dhcp_lease_time}.1 - if use ipv6; then - dosbin contrib/lease-tools/dhcp_release6 - doman contrib/lease-tools/dhcp_release6.1 - fi - fi - - systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service -} - -pkg_preinst() { - # temporary workaround to (hopefully) prevent leases file from being removed - [[ -f /var/lib/misc/dnsmasq.leases ]] && cp /var/lib/misc/dnsmasq.leases "${T}" -} - -pkg_postinst() { - # temporary workaround to (hopefully) prevent leases file from being removed - [[ -f "${T}"/dnsmasq.leases ]] && cp "${T}"/dnsmasq.leases /var/lib/misc/dnsmasq.leases -} diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.76.ebuild b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.76.ebuild deleted file mode 100644 index 3b3d54b64e..0000000000 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.76.ebuild +++ /dev/null @@ -1,188 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit eutils toolchain-funcs flag-o-matic user systemd - -DESCRIPTION="Small forwarding DNS server" -HOMEPAGE="http://www.thekelleys.org.uk/dnsmasq/doc.html" -SRC_URI="http://www.thekelleys.org.uk/dnsmasq/${P}.tar.xz" - -LICENSE="|| ( GPL-2 GPL-3 )" -SLOT="0" -KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd" -IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec idn +inotify ipv6 lua nls script selinux static tftp" -DM_LINGUAS="de es fi fr id it no pl pt_BR ro" -for dm_lingua in ${DM_LINGUAS}; do - IUSE+=" linguas_${dm_lingua}" -done - -CDEPEND="dbus? ( sys-apps/dbus ) - idn? ( net-dns/libidn ) - lua? ( dev-lang/lua:* ) - conntrack? ( net-libs/libnetfilter_conntrack ) - nls? ( - sys-devel/gettext - net-dns/libidn - ) -" - -DEPEND="${CDEPEND} - app-arch/xz-utils - dnssec? ( - dev-libs/nettle[gmp] - static? ( - dev-libs/nettle[static-libs(+)] - ) - ) - virtual/pkgconfig" - -RDEPEND="${CDEPEND} - dnssec? ( - !static? ( - dev-libs/nettle[gmp] - ) - ) - selinux? ( sec-policy/selinux-dnsmasq ) -" - -REQUIRED_USE="dhcp-tools? ( dhcp ) - lua? ( script )" - -use_have() { - local useflag no_only uword - if [[ $1 == '-n' ]]; then - no_only=1 - shift - fi - useflag="${1}" - shift - - uword="${1:-${useflag}}" - shift - - while [[ ${uword} ]]; do - uword="${uword^^}" - - if ! use "${useflag}"; then - echo -n " -DNO_${uword}" - elif [[ -z "${no_only}" ]]; then - echo -n " -DHAVE_${uword}" - fi - uword="${1}" - shift - done -} - -pkg_pretend() { - if use static; then - einfo "Only sys-libs/gmp and dev-libs/nettle are statically linked." - use dnssec || einfo "Thus, ${P}[!dnssec,static] makes no sense; the static USE flag is ignored." - fi -} - -pkg_setup() { - enewgroup dnsmasq - enewuser dnsmasq -1 -1 /dev/null dnsmasq -} - -src_prepare() { - default - - sed -i -r 's:lua5.[0-9]+:lua:' Makefile - sed -i "s:%%PREFIX%%:${EPREFIX}/usr:" dnsmasq.conf.example -} - -src_configure() { - COPTS="$(use_have -n auth-dns auth)" - COPTS+="$(use_have conntrack)" - COPTS+="$(use_have dbus)" - COPTS+="$(use_have idn)" - COPTS+="$(use_have -n inotify)" - COPTS+="$(use_have -n dhcp dhcp dhcp6)" - COPTS+="$(use_have -n ipv6 ipv6 dhcp6)" - COPTS+="$(use_have lua luascript)" - COPTS+="$(use_have -n script)" - COPTS+="$(use_have -n tftp)" - COPTS+="$(use_have dnssec)" - COPTS+="$(use_have static dnssec_static)" -} - -src_compile() { - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - COPTS="${COPTS}" \ - CONFFILE="/etc/${PN}.conf" \ - all$(use nls && echo "-i18n") - - use dhcp-tools && emake -C contrib/lease-tools \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - all -} - -src_install() { - local lingua puid - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - COPTS="${COPTS}" \ - DESTDIR="${D}" \ - install$(use nls && echo "-i18n") - - for lingua in ${DM_LINGUAS}; do - use linguas_${lingua} || rm -rf "${D}"/usr/share/locale/${lingua} - done - [[ -d "${D}"/usr/share/locale/ ]] && rmdir --ignore-fail-on-non-empty "${D}"/usr/share/locale/ - - dodoc CHANGELOG CHANGELOG.archive FAQ dnsmasq.conf.example - dodoc -r logo - - docinto html/ - dodoc *.html - - newinitd "${FILESDIR}"/dnsmasq-init-r2 ${PN} - newconfd "${FILESDIR}"/dnsmasq.confd-r1 ${PN} - - insinto /etc - newins dnsmasq.conf.example dnsmasq.conf - - insinto /usr/share/dnsmasq - doins trust-anchors.conf - - if use dhcp; then - dodir /var/lib/misc - newinitd "${FILESDIR}"/dnsmasq-init-dhcp-r1 ${PN} - fi - if use dbus; then - insinto /etc/dbus-1/system.d - doins dbus/dnsmasq.conf - fi - - if use dhcp-tools; then - dosbin contrib/lease-tools/{dhcp_release,dhcp_lease_time} - doman contrib/lease-tools/{dhcp_release,dhcp_lease_time}.1 - fi - - systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service -} - -pkg_preinst() { - # temporary workaround to (hopefully) prevent leases file from being removed - [[ -f /var/lib/misc/dnsmasq.leases ]] && cp /var/lib/misc/dnsmasq.leases "${T}" -} - -pkg_postinst() { - # temporary workaround to (hopefully) prevent leases file from being removed - [[ -f "${T}"/dnsmasq.leases ]] && cp "${T}"/dnsmasq.leases /var/lib/misc/dnsmasq.leases -} diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.77-r1.ebuild b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.77-r1.ebuild deleted file mode 100644 index 754968a7d3..0000000000 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.77-r1.ebuild +++ /dev/null @@ -1,198 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit toolchain-funcs flag-o-matic user systemd - -DESCRIPTION="Small forwarding DNS server" -HOMEPAGE="http://www.thekelleys.org.uk/dnsmasq/doc.html" -SRC_URI="http://www.thekelleys.org.uk/dnsmasq/${P}.tar.xz" - -LICENSE="|| ( GPL-2 GPL-3 )" -SLOT="0" -KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" - -IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec +id idn libidn2 +inotify" -IUSE+=" ipv6 lua nls script selinux static tftp" - -DM_LINGUAS=(de es fi fr id it no pl pt_BR ro) - -for dm_lingua in "${DM_LINGUAS[@]}"; do - IUSE+=" linguas_${dm_lingua}" -done - -CDEPEND="dbus? ( sys-apps/dbus ) - idn? ( - !libidn2? ( net-dns/libidn ) - libidn2? ( >=net-dns/libidn2-2.0 ) - ) - lua? ( dev-lang/lua:* ) - conntrack? ( net-libs/libnetfilter_conntrack ) - nls? ( sys-devel/gettext ) -" - -DEPEND="${CDEPEND} - app-arch/xz-utils - dnssec? ( - dev-libs/nettle[gmp] - static? ( dev-libs/nettle[static-libs(+)] ) - ) - virtual/pkgconfig -" - -RDEPEND="${CDEPEND} - dnssec? ( - !static? ( - dev-libs/nettle[gmp] - ) - ) - selinux? ( sec-policy/selinux-dnsmasq ) -" - -REQUIRED_USE="dhcp-tools? ( dhcp ) - lua? ( script ) - libidn2? ( idn )" - -use_have() { - local useflag no_only uword - if [[ $1 == '-n' ]]; then - no_only=1 - shift - fi - useflag="${1}" - shift - - uword="${1:-${useflag}}" - shift - - while [[ ${uword} ]]; do - uword="${uword^^}" - - if ! use "${useflag}"; then - echo -n " -DNO_${uword}" - elif [[ -z "${no_only}" ]]; then - echo -n " -DHAVE_${uword}" - fi - uword="${1}" - shift - done -} - -pkg_pretend() { - if use static; then - einfo "Only sys-libs/gmp and dev-libs/nettle are statically linked." - use dnssec || einfo "Thus, ${P}[!dnssec,static] makes no sense; the static USE flag is ignored." - fi -} - -pkg_setup() { - enewgroup dnsmasq - enewuser dnsmasq -1 -1 /dev/null dnsmasq -} - -src_prepare() { - default - - sed -i -r 's:lua5.[0-9]+:lua:' Makefile - sed -i "s:%%PREFIX%%:${EPREFIX}/usr:" dnsmasq.conf.example -} - -src_configure() { - COPTS="$(use_have -n auth-dns auth)" - COPTS+="$(use_have conntrack)" - COPTS+="$(use_have dbus)" - COPTS+="$(use libidn2 || use_have idn)" - COPTS+="$(use_have libidn2)" - COPTS+="$(use_have -n inotify)" - COPTS+="$(use_have -n dhcp dhcp dhcp6)" - COPTS+="$(use_have -n ipv6 ipv6 dhcp6)" - COPTS+="$(use_have -n id id)" - COPTS+="$(use_have lua luascript)" - COPTS+="$(use_have -n script)" - COPTS+="$(use_have -n tftp)" - COPTS+="$(use_have dnssec)" - COPTS+="$(use_have static dnssec_static)" -} - -src_compile() { - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - COPTS="${COPTS}" \ - CONFFILE="/etc/${PN}.conf" \ - all$(use nls && echo "-i18n") - - use dhcp-tools && emake -C contrib/lease-tools \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - all -} - -src_install() { - local lingua puid - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - COPTS="${COPTS}" \ - DESTDIR="${D}" \ - install$(use nls && echo "-i18n") - - for lingua in "${DM_LINGUAS[@]}"; do - use linguas_${lingua} || rm -rf "${D}"/usr/share/locale/${lingua} - done - [[ -d "${D}"/usr/share/locale/ ]] && rmdir --ignore-fail-on-non-empty "${D}"/usr/share/locale/ - - dodoc CHANGELOG CHANGELOG.archive FAQ dnsmasq.conf.example - dodoc -r logo - - docinto html/ - dodoc *.html - - newinitd "${FILESDIR}"/dnsmasq-init-r2 ${PN} - newconfd "${FILESDIR}"/dnsmasq.confd-r1 ${PN} - - insinto /etc - newins dnsmasq.conf.example dnsmasq.conf - - insinto /usr/share/dnsmasq - doins trust-anchors.conf - - if use dhcp; then - dodir /var/lib/misc - newinitd "${FILESDIR}"/dnsmasq-init-dhcp-r1 ${PN} - fi - if use dbus; then - insinto /etc/dbus-1/system.d - doins dbus/dnsmasq.conf - fi - - if use dhcp-tools; then - dosbin contrib/lease-tools/{dhcp_release,dhcp_lease_time} - doman contrib/lease-tools/{dhcp_release,dhcp_lease_time}.1 - if use ipv6; then - dosbin contrib/lease-tools/dhcp_release6 - doman contrib/lease-tools/dhcp_release6.1 - fi - fi - - systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service -} - -pkg_preinst() { - # temporary workaround to (hopefully) prevent leases file from being removed - [[ -f /var/lib/misc/dnsmasq.leases ]] && cp /var/lib/misc/dnsmasq.leases "${T}" -} - -pkg_postinst() { - # temporary workaround to (hopefully) prevent leases file from being removed - [[ -f "${T}"/dnsmasq.leases ]] && cp "${T}"/dnsmasq.leases /var/lib/misc/dnsmasq.leases -} diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.77.ebuild b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.77.ebuild deleted file mode 100644 index 3b26668c2d..0000000000 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.77.ebuild +++ /dev/null @@ -1,196 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit toolchain-funcs flag-o-matic user systemd - -DESCRIPTION="Small forwarding DNS server" -HOMEPAGE="http://www.thekelleys.org.uk/dnsmasq/doc.html" -SRC_URI="http://www.thekelleys.org.uk/dnsmasq/${P}.tar.xz" - -LICENSE="|| ( GPL-2 GPL-3 )" -SLOT="0" -KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" - -IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec +id idn libidn2 +inotify" -IUSE+=" ipv6 lua nls script selinux static tftp" - -DM_LINGUAS=(de es fi fr id it no pl pt_BR ro) - -for dm_lingua in "${DM_LINGUAS[@]}"; do - IUSE+=" linguas_${dm_lingua}" -done - -CDEPEND="dbus? ( sys-apps/dbus ) - idn? ( net-dns/libidn ) - libidn2? ( >=net-dns/libidn2-2.0 ) - lua? ( dev-lang/lua:* ) - conntrack? ( net-libs/libnetfilter_conntrack ) - nls? ( sys-devel/gettext ) -" - -DEPEND="${CDEPEND} - app-arch/xz-utils - dnssec? ( - dev-libs/nettle[gmp] - static? ( dev-libs/nettle[static-libs(+)] ) - ) - virtual/pkgconfig -" - -RDEPEND="${CDEPEND} - dnssec? ( - !static? ( - dev-libs/nettle[gmp] - ) - ) - selinux? ( sec-policy/selinux-dnsmasq ) -" - -REQUIRED_USE="dhcp-tools? ( dhcp ) - lua? ( script ) - libidn2? ( !idn )" - -use_have() { - local useflag no_only uword - if [[ $1 == '-n' ]]; then - no_only=1 - shift - fi - useflag="${1}" - shift - - uword="${1:-${useflag}}" - shift - - while [[ ${uword} ]]; do - uword="${uword^^}" - - if ! use "${useflag}"; then - echo -n " -DNO_${uword}" - elif [[ -z "${no_only}" ]]; then - echo -n " -DHAVE_${uword}" - fi - uword="${1}" - shift - done -} - -pkg_pretend() { - if use static; then - einfo "Only sys-libs/gmp and dev-libs/nettle are statically linked." - use dnssec || einfo "Thus, ${P}[!dnssec,static] makes no sense; the static USE flag is ignored." - fi -} - -pkg_setup() { - enewgroup dnsmasq - enewuser dnsmasq -1 -1 /dev/null dnsmasq -} - -src_prepare() { - default - - sed -i -r 's:lua5.[0-9]+:lua:' Makefile - sed -i "s:%%PREFIX%%:${EPREFIX}/usr:" dnsmasq.conf.example -} - -src_configure() { - COPTS="$(use_have -n auth-dns auth)" - COPTS+="$(use_have conntrack)" - COPTS+="$(use_have dbus)" - COPTS+="$(use_have idn)" - COPTS+="$(use_have libidn2)" - COPTS+="$(use_have -n inotify)" - COPTS+="$(use_have -n dhcp dhcp dhcp6)" - COPTS+="$(use_have -n ipv6 ipv6 dhcp6)" - COPTS+="$(use_have -n id id)" - COPTS+="$(use_have lua luascript)" - COPTS+="$(use_have -n script)" - COPTS+="$(use_have -n tftp)" - COPTS+="$(use_have dnssec)" - COPTS+="$(use_have static dnssec_static)" -} - -src_compile() { - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - COPTS="${COPTS}" \ - CONFFILE="/etc/${PN}.conf" \ - all$(use nls && echo "-i18n") - - use dhcp-tools && emake -C contrib/lease-tools \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - all -} - -src_install() { - local lingua puid - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - COPTS="${COPTS}" \ - DESTDIR="${D}" \ - install$(use nls && echo "-i18n") - - for lingua in "${DM_LINGUAS[@]}"; do - use linguas_${lingua} || rm -rf "${D}"/usr/share/locale/${lingua} - done - [[ -d "${D}"/usr/share/locale/ ]] && rmdir --ignore-fail-on-non-empty "${D}"/usr/share/locale/ - - dodoc CHANGELOG CHANGELOG.archive FAQ dnsmasq.conf.example - dodoc -r logo - - docinto html/ - dodoc *.html - - newinitd "${FILESDIR}"/dnsmasq-init-r2 ${PN} - newconfd "${FILESDIR}"/dnsmasq.confd-r1 ${PN} - - insinto /etc - newins dnsmasq.conf.example dnsmasq.conf - - insinto /usr/share/dnsmasq - doins trust-anchors.conf - - if use dhcp; then - dodir /var/lib/misc - newinitd "${FILESDIR}"/dnsmasq-init-dhcp-r1 ${PN} - fi - if use dbus; then - insinto /etc/dbus-1/system.d - doins dbus/dnsmasq.conf - fi - - if use dhcp-tools; then - dosbin contrib/lease-tools/{dhcp_release,dhcp_lease_time} - doman contrib/lease-tools/{dhcp_release,dhcp_lease_time}.1 - if use ipv6; then - dosbin contrib/lease-tools/dhcp_release6 - doman contrib/lease-tools/dhcp_release6.1 - fi - fi - - systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service -} - -pkg_preinst() { - # temporary workaround to (hopefully) prevent leases file from being removed - [[ -f /var/lib/misc/dnsmasq.leases ]] && cp /var/lib/misc/dnsmasq.leases "${T}" -} - -pkg_postinst() { - # temporary workaround to (hopefully) prevent leases file from being removed - [[ -f "${T}"/dnsmasq.leases ]] && cp "${T}"/dnsmasq.leases /var/lib/misc/dnsmasq.leases -} diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.78.ebuild b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.78.ebuild deleted file mode 100644 index 463bdb3d94..0000000000 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.78.ebuild +++ /dev/null @@ -1,198 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit toolchain-funcs flag-o-matic user systemd - -DESCRIPTION="Small forwarding DNS server" -HOMEPAGE="http://www.thekelleys.org.uk/dnsmasq/doc.html" -SRC_URI="http://www.thekelleys.org.uk/dnsmasq/${P}.tar.xz" - -LICENSE="|| ( GPL-2 GPL-3 )" -SLOT="0" -KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd" - -IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec +id idn libidn2 +inotify" -IUSE+=" ipv6 lua nls script selinux static tftp" - -DM_LINGUAS=(de es fi fr id it no pl pt_BR ro) - -for dm_lingua in "${DM_LINGUAS[@]}"; do - IUSE+=" linguas_${dm_lingua}" -done - -CDEPEND="dbus? ( sys-apps/dbus ) - idn? ( - !libidn2? ( net-dns/libidn ) - libidn2? ( >=net-dns/libidn2-2.0 ) - ) - lua? ( dev-lang/lua:* ) - conntrack? ( net-libs/libnetfilter_conntrack ) - nls? ( sys-devel/gettext ) -" - -DEPEND="${CDEPEND} - app-arch/xz-utils - dnssec? ( - dev-libs/nettle[gmp] - static? ( dev-libs/nettle[static-libs(+)] ) - ) - virtual/pkgconfig -" - -RDEPEND="${CDEPEND} - dnssec? ( - !static? ( - dev-libs/nettle[gmp] - ) - ) - selinux? ( sec-policy/selinux-dnsmasq ) -" - -REQUIRED_USE="dhcp-tools? ( dhcp ) - lua? ( script ) - libidn2? ( idn )" - -use_have() { - local useflag no_only uword - if [[ $1 == '-n' ]]; then - no_only=1 - shift - fi - useflag="${1}" - shift - - uword="${1:-${useflag}}" - shift - - while [[ ${uword} ]]; do - uword="${uword^^}" - - if ! use "${useflag}"; then - echo -n " -DNO_${uword}" - elif [[ -z "${no_only}" ]]; then - echo -n " -DHAVE_${uword}" - fi - uword="${1}" - shift - done -} - -pkg_pretend() { - if use static; then - einfo "Only sys-libs/gmp and dev-libs/nettle are statically linked." - use dnssec || einfo "Thus, ${P}[!dnssec,static] makes no sense; the static USE flag is ignored." - fi -} - -pkg_setup() { - enewgroup dnsmasq - enewuser dnsmasq -1 -1 /dev/null dnsmasq -} - -src_prepare() { - default - - sed -i -r 's:lua5.[0-9]+:lua:' Makefile - sed -i "s:%%PREFIX%%:${EPREFIX}/usr:" dnsmasq.conf.example -} - -src_configure() { - COPTS="$(use_have -n auth-dns auth)" - COPTS+="$(use_have conntrack)" - COPTS+="$(use_have dbus)" - COPTS+="$(use libidn2 || use_have idn)" - COPTS+="$(use_have libidn2)" - COPTS+="$(use_have -n inotify)" - COPTS+="$(use_have -n dhcp dhcp dhcp6)" - COPTS+="$(use_have -n ipv6 ipv6 dhcp6)" - COPTS+="$(use_have -n id id)" - COPTS+="$(use_have lua luascript)" - COPTS+="$(use_have -n script)" - COPTS+="$(use_have -n tftp)" - COPTS+="$(use_have dnssec)" - COPTS+="$(use_have static dnssec_static)" -} - -src_compile() { - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - COPTS="${COPTS}" \ - CONFFILE="/etc/${PN}.conf" \ - all$(use nls && echo "-i18n") - - use dhcp-tools && emake -C contrib/lease-tools \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - all -} - -src_install() { - local lingua puid - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - COPTS="${COPTS}" \ - DESTDIR="${D}" \ - install$(use nls && echo "-i18n") - - for lingua in "${DM_LINGUAS[@]}"; do - use linguas_${lingua} || rm -rf "${D}"/usr/share/locale/${lingua} - done - [[ -d "${D}"/usr/share/locale/ ]] && rmdir --ignore-fail-on-non-empty "${D}"/usr/share/locale/ - - dodoc CHANGELOG CHANGELOG.archive FAQ dnsmasq.conf.example - dodoc -r logo - - docinto html/ - dodoc *.html - - newinitd "${FILESDIR}"/dnsmasq-init-r3 ${PN} - newconfd "${FILESDIR}"/dnsmasq.confd-r1 ${PN} - - insinto /etc - newins dnsmasq.conf.example dnsmasq.conf - - insinto /usr/share/dnsmasq - doins trust-anchors.conf - - if use dhcp; then - dodir /var/lib/misc - newinitd "${FILESDIR}"/dnsmasq-init-dhcp-r2 ${PN} - fi - if use dbus; then - insinto /etc/dbus-1/system.d - doins dbus/dnsmasq.conf - fi - - if use dhcp-tools; then - dosbin contrib/lease-tools/{dhcp_release,dhcp_lease_time} - doman contrib/lease-tools/{dhcp_release,dhcp_lease_time}.1 - if use ipv6; then - dosbin contrib/lease-tools/dhcp_release6 - doman contrib/lease-tools/dhcp_release6.1 - fi - fi - - systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service -} - -pkg_preinst() { - # temporary workaround to (hopefully) prevent leases file from being removed - [[ -f /var/lib/misc/dnsmasq.leases ]] && cp /var/lib/misc/dnsmasq.leases "${T}" -} - -pkg_postinst() { - # temporary workaround to (hopefully) prevent leases file from being removed - [[ -f "${T}"/dnsmasq.leases ]] && cp "${T}"/dnsmasq.leases /var/lib/misc/dnsmasq.leases -} diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.82.ebuild b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.83-r1.ebuild similarity index 93% rename from sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.82.ebuild rename to sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.83-r1.ebuild index 338ba1de11..1035fe01ff 100644 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.82.ebuild +++ b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.83-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -11,10 +11,10 @@ SRC_URI="http://www.thekelleys.org.uk/dnsmasq/${P}.tar.xz" LICENSE="|| ( GPL-2 GPL-3 )" SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86" +KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 sparc x86" IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec +dumpfile id idn libidn2" -IUSE+=" +inotify ipv6 lua nls script selinux static tftp" +IUSE+=" +inotify ipv6 lua nettlehash nls script selinux static tftp" DM_LINGUAS=(de es fi fr id it no pl pt_BR ro) @@ -32,7 +32,7 @@ COMMON_DEPEND=" !libidn2? ( net-dns/libidn:0= ) libidn2? ( >=net-dns/libidn2-2.0:= ) ) - lua? ( dev-lang/lua:* ) + lua? ( dev-lang/lua:0= ) conntrack? ( net-libs/libnetfilter_conntrack:= ) nls? ( sys-devel/gettext ) " @@ -53,8 +53,10 @@ RDEPEND="${COMMON_DEPEND} REQUIRED_USE=" dhcp-tools? ( dhcp ) + dnssec? ( !nettlehash ) lua? ( script ) - libidn2? ( idn )" + libidn2? ( idn ) +" use_have() { local no_only @@ -112,6 +114,7 @@ src_configure() { $(use_have -n script) $(use_have -n tftp) $(use_have dnssec) + $(use_have nettlehash) $(use_have static dnssec_static) $(use_have -n dumpfile) ) diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.83-r101.ebuild b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.83-r101.ebuild new file mode 100644 index 0000000000..d1c269b766 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.83-r101.ebuild @@ -0,0 +1,217 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-{1..4} luajit ) + +inherit toolchain-funcs flag-o-matic lua-single systemd + +DESCRIPTION="Small forwarding DNS server" +HOMEPAGE="http://www.thekelleys.org.uk/dnsmasq/doc.html" +SRC_URI="http://www.thekelleys.org.uk/dnsmasq/${P}.tar.xz" + +LICENSE="|| ( GPL-2 GPL-3 )" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86" + +IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec +dumpfile id idn libidn2" +IUSE+=" +inotify ipv6 lua nettlehash nls script selinux static tftp" + +DM_LINGUAS=(de es fi fr id it no pl pt_BR ro) + +BDEPEND=" + app-arch/xz-utils + virtual/pkgconfig + nls? ( sys-devel/gettext ) +" + +COMMON_DEPEND=" + acct-group/dnsmasq + acct-user/dnsmasq + dbus? ( sys-apps/dbus:= ) + idn? ( + !libidn2? ( net-dns/libidn:0= ) + libidn2? ( >=net-dns/libidn2-2.0:= ) + ) + lua? ( ${LUA_DEPS} ) + conntrack? ( net-libs/libnetfilter_conntrack:= ) + nls? ( sys-devel/gettext ) +" + +DEPEND="${COMMON_DEPEND} + dnssec? ( + dev-libs/nettle:=[gmp] + static? ( >=dev-libs/nettle-3.4[static-libs(+)] ) + ) +" + +RDEPEND="${COMMON_DEPEND} + dnssec? ( + !static? ( >=dev-libs/nettle-3.4:=[gmp] ) + ) + selinux? ( sec-policy/selinux-dnsmasq ) +" + +REQUIRED_USE=" + dhcp-tools? ( dhcp ) + dnssec? ( !nettlehash ) + lua? ( + script + ${LUA_REQUIRED_USE} + ) + libidn2? ( idn ) +" + +use_have() { + local no_only + if [[ ${1} == '-n' ]]; then + no_only=1 + shift + fi + local useflag="${1}" + shift + + local uword="${1:-${useflag}}" + shift + + while [[ ${uword} ]]; do + uword="${uword^^}" + + if ! use "${useflag}"; then + printf -- " -DNO_%s" "${uword}" + elif [[ -z "${no_only}" ]]; then + printf -- " -DHAVE_%s" "${uword}" + fi + uword="${1}" + shift + done +} + +pkg_setup() { + use lua && lua-single_pkg_setup +} + +pkg_pretend() { + if use static; then + einfo "Only sys-libs/gmp and dev-libs/nettle are statically linked." + use dnssec || einfo "Thus, ${P}[!dnssec,static] makes no sense;" \ + "in this case the static USE flag does nothing." + fi +} + +src_prepare() { + default + + sed -i -r 's:lua5.[0-9]+:lua:' Makefile || die + sed -i "s:%%PREFIX%%:${EPREFIX}/usr:" \ + dnsmasq.conf.example || die +} + +src_configure() { + COPTS=( + $(use_have -n auth-dns auth) + $(use_have conntrack) + $(use_have dbus) + $(use libidn2 || use_have idn) + $(use_have libidn2) + $(use_have -n inotify) + $(use_have -n dhcp dhcp dhcp6) + $(use_have -n ipv6 ipv6 dhcp6) + $(use_have -n id id) + $(use_have lua luascript) + $(use_have -n script) + $(use_have -n tftp) + $(use_have dnssec) + $(use_have nettlehash) + $(use_have static dnssec_static) + $(use_have -n dumpfile) + ) +} + +src_compile() { + emake \ + PREFIX=/usr \ + MANDIR=/usr/share/man \ + CC="$(tc-getCC)" \ + PKG_CONFIG="$(tc-getPKG_CONFIG)" \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + COPTS="${COPTS[*]}" \ + CONFFILE="/etc/${PN}.conf" \ + all$(use nls && printf -- "-i18n\n") + + use dhcp-tools && emake -C contrib/lease-tools \ + PREFIX=/usr \ + MANDIR=/usr/share/man \ + CC="$(tc-getCC)" \ + PKG_CONFIG="$(tc-getPKG_CONFIG)" \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + all +} + +src_install() { + local lingua puid + emake \ + PREFIX=/usr \ + MANDIR=/usr/share/man \ + COPTS="${COPTS[*]}" \ + DESTDIR="${ED}" \ + install$(use nls && printf -- "-i18n\n") + + for lingua in "${DM_LINGUAS[@]}"; do + has ${lingua} ${LINGUAS-${lingua}} \ + || rm -rf "${ED}"/usr/share/locale/${lingua} + done + [[ -d "${D}"/usr/share/locale/ ]] && \ + rmdir --ignore-fail-on-non-empty "${ED}"/usr/share/locale/ + + dodoc CHANGELOG CHANGELOG.archive FAQ dnsmasq.conf.example + dodoc -r logo + + docinto html/ + dodoc *.html + + newinitd "${FILESDIR}"/dnsmasq-init-r4 ${PN} + newconfd "${FILESDIR}"/dnsmasq.confd-r1 ${PN} + + insinto /etc/logrotate.d + newins "${FILESDIR}"/dnsmasq.logrotate ${PN} + + insinto /etc + newins dnsmasq.conf.example dnsmasq.conf + + insinto /usr/share/dnsmasq + doins trust-anchors.conf + + if use dhcp; then + keepdir /var/lib/misc + newinitd "${FILESDIR}"/dnsmasq-init-dhcp-r3 ${PN} + fi + if use dbus; then + insinto /etc/dbus-1/system.d + doins dbus/dnsmasq.conf + fi + + if use dhcp-tools; then + dosbin contrib/lease-tools/{dhcp_release,dhcp_lease_time} + doman contrib/lease-tools/{dhcp_release,dhcp_lease_time}.1 + if use ipv6; then + dosbin contrib/lease-tools/dhcp_release6 + doman contrib/lease-tools/dhcp_release6.1 + fi + fi + + systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service +} + +pkg_preinst() { + [[ -f /var/lib/misc/dnsmasq.leases ]] && \ + cp /var/lib/misc/dnsmasq.leases "${T}" +} + +pkg_postinst() { + [[ -f "${T}"/dnsmasq.leases ]] && \ + cp "${T}"/dnsmasq.leases /var/lib/misc/dnsmasq.leases +} diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.84-r101.ebuild b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.84-r101.ebuild new file mode 100644 index 0000000000..3ca7420ed5 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.84-r101.ebuild @@ -0,0 +1,221 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-{1..4} luajit ) + +inherit toolchain-funcs flag-o-matic lua-single systemd + +DESCRIPTION="Small forwarding DNS server" +HOMEPAGE="http://www.thekelleys.org.uk/dnsmasq/doc.html" +SRC_URI="http://www.thekelleys.org.uk/dnsmasq/${P}.tar.xz" + +LICENSE="|| ( GPL-2 GPL-3 )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" + +IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec +dumpfile id idn libidn2" +IUSE+=" +inotify ipv6 lua nettlehash nls script selinux static tftp" + +DM_LINGUAS=(de es fi fr id it no pl pt_BR ro) + +BDEPEND=" + app-arch/xz-utils + virtual/pkgconfig + nls? ( sys-devel/gettext ) +" + +COMMON_DEPEND=" + acct-group/dnsmasq + acct-user/dnsmasq + dbus? ( sys-apps/dbus:= ) + idn? ( + !libidn2? ( net-dns/libidn:0= ) + libidn2? ( >=net-dns/libidn2-2.0:= ) + ) + lua? ( ${LUA_DEPS} ) + conntrack? ( net-libs/libnetfilter_conntrack:= ) + nls? ( sys-devel/gettext ) +" + +DEPEND="${COMMON_DEPEND} + dnssec? ( + dev-libs/nettle:=[gmp] + static? ( >=dev-libs/nettle-3.4[static-libs(+)] ) + ) +" + +RDEPEND="${COMMON_DEPEND} + dnssec? ( + !static? ( >=dev-libs/nettle-3.4:=[gmp] ) + ) + selinux? ( sec-policy/selinux-dnsmasq ) +" + +REQUIRED_USE=" + dhcp-tools? ( dhcp ) + dnssec? ( !nettlehash ) + lua? ( + script + ${LUA_REQUIRED_USE} + ) + libidn2? ( idn ) +" + +PATCHES=( + "${FILESDIR}/dnsmasq-2.84-version-string.patch" +) + +use_have() { + local no_only + if [[ ${1} == '-n' ]]; then + no_only=1 + shift + fi + local useflag="${1}" + shift + + local uword="${1:-${useflag}}" + shift + + while [[ ${uword} ]]; do + uword="${uword^^}" + + if ! use "${useflag}"; then + printf -- " -DNO_%s" "${uword}" + elif [[ -z "${no_only}" ]]; then + printf -- " -DHAVE_%s" "${uword}" + fi + uword="${1}" + shift + done +} + +pkg_setup() { + use lua && lua-single_pkg_setup +} + +pkg_pretend() { + if use static; then + einfo "Only sys-libs/gmp and dev-libs/nettle are statically linked." + use dnssec || einfo "Thus, ${P}[!dnssec,static] makes no sense;" \ + "in this case the static USE flag does nothing." + fi +} + +src_prepare() { + default + + sed -i -r 's:lua5.[0-9]+:lua:' Makefile || die + sed -i "s:%%PREFIX%%:${EPREFIX}/usr:" \ + dnsmasq.conf.example || die +} + +src_configure() { + COPTS=( + $(use_have -n auth-dns auth) + $(use_have conntrack) + $(use_have dbus) + $(use libidn2 || use_have idn) + $(use_have libidn2) + $(use_have -n inotify) + $(use_have -n dhcp dhcp dhcp6) + $(use_have -n ipv6 ipv6 dhcp6) + $(use_have -n id id) + $(use_have lua luascript) + $(use_have -n script) + $(use_have -n tftp) + $(use_have dnssec) + $(use_have nettlehash) + $(use_have static dnssec_static) + $(use_have -n dumpfile) + ) +} + +src_compile() { + emake \ + PREFIX=/usr \ + MANDIR=/usr/share/man \ + CC="$(tc-getCC)" \ + PKG_CONFIG="$(tc-getPKG_CONFIG)" \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + COPTS="${COPTS[*]}" \ + CONFFILE="/etc/${PN}.conf" \ + all$(use nls && printf -- "-i18n\n") + + use dhcp-tools && emake -C contrib/lease-tools \ + PREFIX=/usr \ + MANDIR=/usr/share/man \ + CC="$(tc-getCC)" \ + PKG_CONFIG="$(tc-getPKG_CONFIG)" \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + all +} + +src_install() { + local lingua puid + emake \ + PREFIX=/usr \ + MANDIR=/usr/share/man \ + COPTS="${COPTS[*]}" \ + DESTDIR="${ED}" \ + install$(use nls && printf -- "-i18n\n") + + for lingua in "${DM_LINGUAS[@]}"; do + has ${lingua} ${LINGUAS-${lingua}} \ + || rm -rf "${ED}"/usr/share/locale/${lingua} + done + [[ -d "${D}"/usr/share/locale/ ]] && \ + rmdir --ignore-fail-on-non-empty "${ED}"/usr/share/locale/ + + dodoc CHANGELOG CHANGELOG.archive FAQ dnsmasq.conf.example + dodoc -r logo + + docinto html/ + dodoc *.html + + newinitd "${FILESDIR}"/dnsmasq-init-r4 ${PN} + newconfd "${FILESDIR}"/dnsmasq.confd-r1 ${PN} + + insinto /etc/logrotate.d + newins "${FILESDIR}"/dnsmasq.logrotate ${PN} + + insinto /etc + newins dnsmasq.conf.example dnsmasq.conf + + insinto /usr/share/dnsmasq + doins trust-anchors.conf + + if use dhcp; then + keepdir /var/lib/misc + newinitd "${FILESDIR}"/dnsmasq-init-dhcp-r3 ${PN} + fi + if use dbus; then + insinto /etc/dbus-1/system.d + doins dbus/dnsmasq.conf + fi + + if use dhcp-tools; then + dosbin contrib/lease-tools/{dhcp_release,dhcp_lease_time} + doman contrib/lease-tools/{dhcp_release,dhcp_lease_time}.1 + if use ipv6; then + dosbin contrib/lease-tools/dhcp_release6 + doman contrib/lease-tools/dhcp_release6.1 + fi + fi + + systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service +} + +pkg_preinst() { + [[ -f /var/lib/misc/dnsmasq.leases ]] && \ + cp /var/lib/misc/dnsmasq.leases "${T}" +} + +pkg_postinst() { + [[ -f "${T}"/dnsmasq.leases ]] && \ + cp "${T}"/dnsmasq.leases /var/lib/misc/dnsmasq.leases +} diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.84.ebuild b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.84.ebuild new file mode 100644 index 0000000000..eee292c64a --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.84.ebuild @@ -0,0 +1,212 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs flag-o-matic systemd + +DESCRIPTION="Small forwarding DNS server" +HOMEPAGE="http://www.thekelleys.org.uk/dnsmasq/doc.html" +SRC_URI="http://www.thekelleys.org.uk/dnsmasq/${P}.tar.xz" + +LICENSE="|| ( GPL-2 GPL-3 )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" + +IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec +dumpfile id idn libidn2" +IUSE+=" +inotify ipv6 lua nettlehash nls script selinux static tftp" + +DM_LINGUAS=(de es fi fr id it no pl pt_BR ro) + +BDEPEND=" + app-arch/xz-utils + virtual/pkgconfig + nls? ( sys-devel/gettext ) +" + +COMMON_DEPEND=" + acct-group/dnsmasq + acct-user/dnsmasq + dbus? ( sys-apps/dbus:= ) + idn? ( + !libidn2? ( net-dns/libidn:0= ) + libidn2? ( >=net-dns/libidn2-2.0:= ) + ) + lua? ( dev-lang/lua:0= ) + conntrack? ( net-libs/libnetfilter_conntrack:= ) + nls? ( sys-devel/gettext ) +" + +DEPEND="${COMMON_DEPEND} + dnssec? ( + dev-libs/nettle:=[gmp] + static? ( >=dev-libs/nettle-3.4[static-libs(+)] ) + ) +" + +RDEPEND="${COMMON_DEPEND} + dnssec? ( + !static? ( >=dev-libs/nettle-3.4:=[gmp] ) + ) + selinux? ( sec-policy/selinux-dnsmasq ) +" + +REQUIRED_USE=" + dhcp-tools? ( dhcp ) + dnssec? ( !nettlehash ) + lua? ( script ) + libidn2? ( idn ) +" + +PATCHES=( + "${FILESDIR}/dnsmasq-2.84-version-string.patch" +) + +use_have() { + local no_only + if [[ ${1} == '-n' ]]; then + no_only=1 + shift + fi + local useflag="${1}" + shift + + local uword="${1:-${useflag}}" + shift + + while [[ ${uword} ]]; do + uword="${uword^^}" + + if ! use "${useflag}"; then + printf -- " -DNO_%s" "${uword}" + elif [[ -z "${no_only}" ]]; then + printf -- " -DHAVE_%s" "${uword}" + fi + uword="${1}" + shift + done +} + +pkg_pretend() { + if use static; then + einfo "Only sys-libs/gmp and dev-libs/nettle are statically linked." + use dnssec || einfo "Thus, ${P}[!dnssec,static] makes no sense;" \ + "in this case the static USE flag does nothing." + fi +} + +src_prepare() { + default + + sed -i -r 's:lua5.[0-9]+:lua:' Makefile || die + sed -i "s:%%PREFIX%%:${EPREFIX}/usr:" \ + dnsmasq.conf.example || die +} + +src_configure() { + COPTS=( + $(use_have -n auth-dns auth) + $(use_have conntrack) + $(use_have dbus) + $(use libidn2 || use_have idn) + $(use_have libidn2) + $(use_have -n inotify) + $(use_have -n dhcp dhcp dhcp6) + $(use_have -n ipv6 ipv6 dhcp6) + $(use_have -n id id) + $(use_have lua luascript) + $(use_have -n script) + $(use_have -n tftp) + $(use_have dnssec) + $(use_have nettlehash) + $(use_have static dnssec_static) + $(use_have -n dumpfile) + ) +} + +src_compile() { + emake \ + PREFIX=/usr \ + MANDIR=/usr/share/man \ + CC="$(tc-getCC)" \ + PKG_CONFIG="$(tc-getPKG_CONFIG)" \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + COPTS="${COPTS[*]}" \ + CONFFILE="/etc/${PN}.conf" \ + all$(use nls && printf -- "-i18n\n") + + use dhcp-tools && emake -C contrib/lease-tools \ + PREFIX=/usr \ + MANDIR=/usr/share/man \ + CC="$(tc-getCC)" \ + PKG_CONFIG="$(tc-getPKG_CONFIG)" \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + all +} + +src_install() { + local lingua puid + emake \ + PREFIX=/usr \ + MANDIR=/usr/share/man \ + COPTS="${COPTS[*]}" \ + DESTDIR="${ED}" \ + install$(use nls && printf -- "-i18n\n") + + for lingua in "${DM_LINGUAS[@]}"; do + has ${lingua} ${LINGUAS-${lingua}} \ + || rm -rf "${ED}"/usr/share/locale/${lingua} + done + [[ -d "${D}"/usr/share/locale/ ]] && \ + rmdir --ignore-fail-on-non-empty "${ED}"/usr/share/locale/ + + dodoc CHANGELOG CHANGELOG.archive FAQ dnsmasq.conf.example + dodoc -r logo + + docinto html/ + dodoc *.html + + newinitd "${FILESDIR}"/dnsmasq-init-r4 ${PN} + newconfd "${FILESDIR}"/dnsmasq.confd-r1 ${PN} + + insinto /etc/logrotate.d + newins "${FILESDIR}"/dnsmasq.logrotate ${PN} + + insinto /etc + newins dnsmasq.conf.example dnsmasq.conf + + insinto /usr/share/dnsmasq + doins trust-anchors.conf + + if use dhcp; then + keepdir /var/lib/misc + newinitd "${FILESDIR}"/dnsmasq-init-dhcp-r3 ${PN} + fi + if use dbus; then + insinto /etc/dbus-1/system.d + doins dbus/dnsmasq.conf + fi + + if use dhcp-tools; then + dosbin contrib/lease-tools/{dhcp_release,dhcp_lease_time} + doman contrib/lease-tools/{dhcp_release,dhcp_lease_time}.1 + if use ipv6; then + dosbin contrib/lease-tools/dhcp_release6 + doman contrib/lease-tools/dhcp_release6.1 + fi + fi + + systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service +} + +pkg_preinst() { + [[ -f /var/lib/misc/dnsmasq.leases ]] && \ + cp /var/lib/misc/dnsmasq.leases "${T}" +} + +pkg_postinst() { + [[ -f "${T}"/dnsmasq.leases ]] && \ + cp "${T}"/dnsmasq.leases /var/lib/misc/dnsmasq.leases +} diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-2.84-version-string.patch b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-2.84-version-string.patch new file mode 100644 index 0000000000..bd37dbbfe7 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-2.84-version-string.patch @@ -0,0 +1,13 @@ +diff --git a/bld/get-version b/bld/get-version +index e472aab..3bf0b87 100755 +--- a/bld/get-version ++++ b/bld/get-version +@@ -28,7 +28,7 @@ else + vers=`cat $1/VERSION | sed 's/[(), ]/,/ g' | tr ',' '\n' | grep ^v[0-9]` + + if [ $? -eq 0 ]; then +- echo "${vers}" | sort -r | head -n 1 | sed 's/^v//' ++ echo "${vers}" | sort | head -n 1 | sed 's/^v//' + else + cat $1/VERSION + fi diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-dhcp-r1 b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-dhcp-r1 deleted file mode 100644 index b62630f714..0000000000 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-dhcp-r1 +++ /dev/null @@ -1,29 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License, v2 or later - -extra_started_commands="reload" - -pidfile="/var/run/dnsmasq.pid" -command="/usr/sbin/dnsmasq" -command_args="-x ${pidfile} ${DNSMASQ_OPTS}" -retry="TERM/3/TERM/5" - -depend() { - provide dns - need localmount net - after bootmisc - use logger -} - -start_pre() { - checkpath --owner dnsmasq:dnsmasq \ - --mode 0644 \ - --file /var/lib/misc/dnsmasq.leases -} - -reload() { - ebegin "Reloading ${RC_SVCNAME}" - kill -HUP "$(cat "${pidfile}")" - eend $? -} diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-dhcp-r2 b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-dhcp-r2 deleted file mode 100644 index 610ce7a5d2..0000000000 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-dhcp-r2 +++ /dev/null @@ -1,29 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License, v2 or later - -extra_started_commands="reload" - -pidfile="/var/run/dnsmasq.pid" -command="/usr/sbin/dnsmasq" -command_args="-x ${pidfile} ${DNSMASQ_OPTS}" -retry="TERM/3/TERM/5" - -depend() { - provide dns - need localmount net - after bootmisc - use logger -} - -start_pre() { - checkpath --owner dnsmasq:dnsmasq \ - --mode 0644 \ - --file /var/lib/misc/dnsmasq.leases -} - -reload() { - ebegin "Reloading ${RC_SVCNAME}" - start-stop-daemon --signal HUP --pidfile "${pidfile}" - eend $? -} diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-r2 b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-r2 deleted file mode 100644 index ed487b9fd1..0000000000 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-r2 +++ /dev/null @@ -1,23 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License, v2 or later - -extra_started_commands="reload" - -pidfile="/var/run/dnsmasq.pid" -command="/usr/sbin/dnsmasq" -command_args="-x ${pidfile} ${DNSMASQ_OPTS}" -retry="TERM/3/TERM/5" - -depend() { - provide dns - need localmount net - after bootmisc - use logger -} - -reload() { - ebegin "Reloading ${SVCNAME}" - kill -HUP $(cat "${pidfile}") - eend $? -} diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-r3 b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-r3 deleted file mode 100644 index 9d58b26fa5..0000000000 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/files/dnsmasq-init-r3 +++ /dev/null @@ -1,23 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License, v2 or later - -extra_started_commands="reload" - -pidfile="/var/run/dnsmasq.pid" -command="/usr/sbin/dnsmasq" -command_args="-x ${pidfile} ${DNSMASQ_OPTS}" -retry="TERM/3/TERM/5" - -depend() { - provide dns - need localmount net - after bootmisc - use logger -} - -reload() { - ebegin "Reloading ${SVCNAME}" - start-stop-daemon --signal HUP --pidfile "${pidfile}" - eend $? -} diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/metadata.xml b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/metadata.xml index 9a597f9b11..661033afab 100644 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/metadata.xml +++ b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/metadata.xml @@ -13,7 +13,8 @@ Enable support DNSSEC validation and caching. Include code to dump packets to a libpcap-format file for debugging Whether report *.bind CHAOS info to clients, otherwise forward such requests upstream instead - Enable support for Internationalized Domain Names, via net-dns/libidn2 rather than net-dns/libidn + Enable support for Internationalized Domain Names, via net-dns/libidn2 rather than net-dns/libidn + Use hashing functions from dev-libs/nettle Enable support for calling scripts when leases change. Enables built in TFTP server for netbooting. From ec5a1a7d7d972111a6a3d7bec1977bc65b2bdc23 Mon Sep 17 00:00:00 2001 From: Sayan Chowdhury Date: Fri, 9 Apr 2021 11:02:46 +0000 Subject: [PATCH 2/3] net-dns/dnsmasq: Sync with Gentoo upstream Signed-off-by: Sayan Chowdhury --- .../net-dns/dnsmasq/dnsmasq-2.83-r1.ebuild | 208 ----------------- .../net-dns/dnsmasq/dnsmasq-2.84.ebuild | 212 ------------------ 2 files changed, 420 deletions(-) delete mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.83-r1.ebuild delete mode 100644 sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.84.ebuild diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.83-r1.ebuild b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.83-r1.ebuild deleted file mode 100644 index 1035fe01ff..0000000000 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.83-r1.ebuild +++ /dev/null @@ -1,208 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit toolchain-funcs flag-o-matic systemd - -DESCRIPTION="Small forwarding DNS server" -HOMEPAGE="http://www.thekelleys.org.uk/dnsmasq/doc.html" -SRC_URI="http://www.thekelleys.org.uk/dnsmasq/${P}.tar.xz" - -LICENSE="|| ( GPL-2 GPL-3 )" -SLOT="0" -KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 sparc x86" - -IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec +dumpfile id idn libidn2" -IUSE+=" +inotify ipv6 lua nettlehash nls script selinux static tftp" - -DM_LINGUAS=(de es fi fr id it no pl pt_BR ro) - -BDEPEND=" - app-arch/xz-utils - virtual/pkgconfig - nls? ( sys-devel/gettext ) -" - -COMMON_DEPEND=" - acct-group/dnsmasq - acct-user/dnsmasq - dbus? ( sys-apps/dbus:= ) - idn? ( - !libidn2? ( net-dns/libidn:0= ) - libidn2? ( >=net-dns/libidn2-2.0:= ) - ) - lua? ( dev-lang/lua:0= ) - conntrack? ( net-libs/libnetfilter_conntrack:= ) - nls? ( sys-devel/gettext ) -" - -DEPEND="${COMMON_DEPEND} - dnssec? ( - dev-libs/nettle:=[gmp] - static? ( >=dev-libs/nettle-3.4[static-libs(+)] ) - ) -" - -RDEPEND="${COMMON_DEPEND} - dnssec? ( - !static? ( >=dev-libs/nettle-3.4:=[gmp] ) - ) - selinux? ( sec-policy/selinux-dnsmasq ) -" - -REQUIRED_USE=" - dhcp-tools? ( dhcp ) - dnssec? ( !nettlehash ) - lua? ( script ) - libidn2? ( idn ) -" - -use_have() { - local no_only - if [[ ${1} == '-n' ]]; then - no_only=1 - shift - fi - local useflag="${1}" - shift - - local uword="${1:-${useflag}}" - shift - - while [[ ${uword} ]]; do - uword="${uword^^}" - - if ! use "${useflag}"; then - printf -- " -DNO_%s" "${uword}" - elif [[ -z "${no_only}" ]]; then - printf -- " -DHAVE_%s" "${uword}" - fi - uword="${1}" - shift - done -} - -pkg_pretend() { - if use static; then - einfo "Only sys-libs/gmp and dev-libs/nettle are statically linked." - use dnssec || einfo "Thus, ${P}[!dnssec,static] makes no sense;" \ - "in this case the static USE flag does nothing." - fi -} - -src_prepare() { - default - - sed -i -r 's:lua5.[0-9]+:lua:' Makefile || die - sed -i "s:%%PREFIX%%:${EPREFIX}/usr:" \ - dnsmasq.conf.example || die -} - -src_configure() { - COPTS=( - $(use_have -n auth-dns auth) - $(use_have conntrack) - $(use_have dbus) - $(use libidn2 || use_have idn) - $(use_have libidn2) - $(use_have -n inotify) - $(use_have -n dhcp dhcp dhcp6) - $(use_have -n ipv6 ipv6 dhcp6) - $(use_have -n id id) - $(use_have lua luascript) - $(use_have -n script) - $(use_have -n tftp) - $(use_have dnssec) - $(use_have nettlehash) - $(use_have static dnssec_static) - $(use_have -n dumpfile) - ) -} - -src_compile() { - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - COPTS="${COPTS[*]}" \ - CONFFILE="/etc/${PN}.conf" \ - all$(use nls && printf -- "-i18n\n") - - use dhcp-tools && emake -C contrib/lease-tools \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - all -} - -src_install() { - local lingua puid - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - COPTS="${COPTS[*]}" \ - DESTDIR="${ED}" \ - install$(use nls && printf -- "-i18n\n") - - for lingua in "${DM_LINGUAS[@]}"; do - has ${lingua} ${LINGUAS-${lingua}} \ - || rm -rf "${ED}"/usr/share/locale/${lingua} - done - [[ -d "${D}"/usr/share/locale/ ]] && \ - rmdir --ignore-fail-on-non-empty "${ED}"/usr/share/locale/ - - dodoc CHANGELOG CHANGELOG.archive FAQ dnsmasq.conf.example - dodoc -r logo - - docinto html/ - dodoc *.html - - newinitd "${FILESDIR}"/dnsmasq-init-r4 ${PN} - newconfd "${FILESDIR}"/dnsmasq.confd-r1 ${PN} - - insinto /etc/logrotate.d - newins "${FILESDIR}"/dnsmasq.logrotate ${PN} - - insinto /etc - newins dnsmasq.conf.example dnsmasq.conf - - insinto /usr/share/dnsmasq - doins trust-anchors.conf - - if use dhcp; then - keepdir /var/lib/misc - newinitd "${FILESDIR}"/dnsmasq-init-dhcp-r3 ${PN} - fi - if use dbus; then - insinto /etc/dbus-1/system.d - doins dbus/dnsmasq.conf - fi - - if use dhcp-tools; then - dosbin contrib/lease-tools/{dhcp_release,dhcp_lease_time} - doman contrib/lease-tools/{dhcp_release,dhcp_lease_time}.1 - if use ipv6; then - dosbin contrib/lease-tools/dhcp_release6 - doman contrib/lease-tools/dhcp_release6.1 - fi - fi - - systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service -} - -pkg_preinst() { - [[ -f /var/lib/misc/dnsmasq.leases ]] && \ - cp /var/lib/misc/dnsmasq.leases "${T}" -} - -pkg_postinst() { - [[ -f "${T}"/dnsmasq.leases ]] && \ - cp "${T}"/dnsmasq.leases /var/lib/misc/dnsmasq.leases -} diff --git a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.84.ebuild b/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.84.ebuild deleted file mode 100644 index eee292c64a..0000000000 --- a/sdk_container/src/third_party/portage-stable/net-dns/dnsmasq/dnsmasq-2.84.ebuild +++ /dev/null @@ -1,212 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit toolchain-funcs flag-o-matic systemd - -DESCRIPTION="Small forwarding DNS server" -HOMEPAGE="http://www.thekelleys.org.uk/dnsmasq/doc.html" -SRC_URI="http://www.thekelleys.org.uk/dnsmasq/${P}.tar.xz" - -LICENSE="|| ( GPL-2 GPL-3 )" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" - -IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec +dumpfile id idn libidn2" -IUSE+=" +inotify ipv6 lua nettlehash nls script selinux static tftp" - -DM_LINGUAS=(de es fi fr id it no pl pt_BR ro) - -BDEPEND=" - app-arch/xz-utils - virtual/pkgconfig - nls? ( sys-devel/gettext ) -" - -COMMON_DEPEND=" - acct-group/dnsmasq - acct-user/dnsmasq - dbus? ( sys-apps/dbus:= ) - idn? ( - !libidn2? ( net-dns/libidn:0= ) - libidn2? ( >=net-dns/libidn2-2.0:= ) - ) - lua? ( dev-lang/lua:0= ) - conntrack? ( net-libs/libnetfilter_conntrack:= ) - nls? ( sys-devel/gettext ) -" - -DEPEND="${COMMON_DEPEND} - dnssec? ( - dev-libs/nettle:=[gmp] - static? ( >=dev-libs/nettle-3.4[static-libs(+)] ) - ) -" - -RDEPEND="${COMMON_DEPEND} - dnssec? ( - !static? ( >=dev-libs/nettle-3.4:=[gmp] ) - ) - selinux? ( sec-policy/selinux-dnsmasq ) -" - -REQUIRED_USE=" - dhcp-tools? ( dhcp ) - dnssec? ( !nettlehash ) - lua? ( script ) - libidn2? ( idn ) -" - -PATCHES=( - "${FILESDIR}/dnsmasq-2.84-version-string.patch" -) - -use_have() { - local no_only - if [[ ${1} == '-n' ]]; then - no_only=1 - shift - fi - local useflag="${1}" - shift - - local uword="${1:-${useflag}}" - shift - - while [[ ${uword} ]]; do - uword="${uword^^}" - - if ! use "${useflag}"; then - printf -- " -DNO_%s" "${uword}" - elif [[ -z "${no_only}" ]]; then - printf -- " -DHAVE_%s" "${uword}" - fi - uword="${1}" - shift - done -} - -pkg_pretend() { - if use static; then - einfo "Only sys-libs/gmp and dev-libs/nettle are statically linked." - use dnssec || einfo "Thus, ${P}[!dnssec,static] makes no sense;" \ - "in this case the static USE flag does nothing." - fi -} - -src_prepare() { - default - - sed -i -r 's:lua5.[0-9]+:lua:' Makefile || die - sed -i "s:%%PREFIX%%:${EPREFIX}/usr:" \ - dnsmasq.conf.example || die -} - -src_configure() { - COPTS=( - $(use_have -n auth-dns auth) - $(use_have conntrack) - $(use_have dbus) - $(use libidn2 || use_have idn) - $(use_have libidn2) - $(use_have -n inotify) - $(use_have -n dhcp dhcp dhcp6) - $(use_have -n ipv6 ipv6 dhcp6) - $(use_have -n id id) - $(use_have lua luascript) - $(use_have -n script) - $(use_have -n tftp) - $(use_have dnssec) - $(use_have nettlehash) - $(use_have static dnssec_static) - $(use_have -n dumpfile) - ) -} - -src_compile() { - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - COPTS="${COPTS[*]}" \ - CONFFILE="/etc/${PN}.conf" \ - all$(use nls && printf -- "-i18n\n") - - use dhcp-tools && emake -C contrib/lease-tools \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - CC="$(tc-getCC)" \ - PKG_CONFIG="$(tc-getPKG_CONFIG)" \ - CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS}" \ - all -} - -src_install() { - local lingua puid - emake \ - PREFIX=/usr \ - MANDIR=/usr/share/man \ - COPTS="${COPTS[*]}" \ - DESTDIR="${ED}" \ - install$(use nls && printf -- "-i18n\n") - - for lingua in "${DM_LINGUAS[@]}"; do - has ${lingua} ${LINGUAS-${lingua}} \ - || rm -rf "${ED}"/usr/share/locale/${lingua} - done - [[ -d "${D}"/usr/share/locale/ ]] && \ - rmdir --ignore-fail-on-non-empty "${ED}"/usr/share/locale/ - - dodoc CHANGELOG CHANGELOG.archive FAQ dnsmasq.conf.example - dodoc -r logo - - docinto html/ - dodoc *.html - - newinitd "${FILESDIR}"/dnsmasq-init-r4 ${PN} - newconfd "${FILESDIR}"/dnsmasq.confd-r1 ${PN} - - insinto /etc/logrotate.d - newins "${FILESDIR}"/dnsmasq.logrotate ${PN} - - insinto /etc - newins dnsmasq.conf.example dnsmasq.conf - - insinto /usr/share/dnsmasq - doins trust-anchors.conf - - if use dhcp; then - keepdir /var/lib/misc - newinitd "${FILESDIR}"/dnsmasq-init-dhcp-r3 ${PN} - fi - if use dbus; then - insinto /etc/dbus-1/system.d - doins dbus/dnsmasq.conf - fi - - if use dhcp-tools; then - dosbin contrib/lease-tools/{dhcp_release,dhcp_lease_time} - doman contrib/lease-tools/{dhcp_release,dhcp_lease_time}.1 - if use ipv6; then - dosbin contrib/lease-tools/dhcp_release6 - doman contrib/lease-tools/dhcp_release6.1 - fi - fi - - systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service -} - -pkg_preinst() { - [[ -f /var/lib/misc/dnsmasq.leases ]] && \ - cp /var/lib/misc/dnsmasq.leases "${T}" -} - -pkg_postinst() { - [[ -f "${T}"/dnsmasq.leases ]] && \ - cp "${T}"/dnsmasq.leases /var/lib/misc/dnsmasq.leases -} From 6cef7c175f6fa37dd6294adfbd13704c8b9a4c15 Mon Sep 17 00:00:00 2001 From: Sayan Chowdhury Date: Fri, 9 Apr 2021 16:36:37 +0530 Subject: [PATCH 3/3] eclass: Add the eclasses required for the LUA suite Signed-off-by: Sayan Chowdhury --- .../portage-stable/eclass/lua-single.eclass | 540 ++++++++++++++++++ .../portage-stable/eclass/lua-utils.eclass | 532 +++++++++++++++++ .../portage-stable/eclass/lua.eclass | 381 ++++++++++++ 3 files changed, 1453 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/eclass/lua-single.eclass create mode 100644 sdk_container/src/third_party/portage-stable/eclass/lua-utils.eclass create mode 100644 sdk_container/src/third_party/portage-stable/eclass/lua.eclass diff --git a/sdk_container/src/third_party/portage-stable/eclass/lua-single.eclass b/sdk_container/src/third_party/portage-stable/eclass/lua-single.eclass new file mode 100644 index 0000000000..11c2790dac --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/eclass/lua-single.eclass @@ -0,0 +1,540 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: lua-single.eclass +# @MAINTAINER: +# William Hubbs +# Marek Szuba +# @AUTHOR: +# Marek Szuba +# Based on python-single-r1.eclass by Michał Górny et al. +# @SUPPORTED_EAPIS: 7 +# @BLURB: An eclass for Lua packages not installed for multiple implementations. +# @DESCRIPTION: +# An extension of lua.eclass suite for packages which don't support being +# installed for multiple Lua implementations. This mostly includes software +# embedding Lua. +# +# This eclass sets correct IUSE. It also provides LUA_DEPS +# and LUA_REQUIRED_USE that need to be added to appropriate ebuild +# metadata variables. +# +# The eclass exports LUA_SINGLE_USEDEP that is suitable for depending +# on other packages using the eclass. Dependencies on packages using +# lua.eclass should be created via lua_gen_cond_dep() function, using +# LUA_USEDEP placeholder. +# +# Please note that packages support multiple Lua implementations +# (using lua.eclass) cannot depend on packages not supporting +# them (using this eclass). +# +# Note that since this eclass always inherits lua-utils as well, in ebuilds +# using the former there is no need to explicitly inherit the latter in order +# to use helper functions such as lua_get_CFLAGS. +# +# @EXAMPLE: +# @CODE +# EAPI=7 +# +# LUA_COMPAT=( lua5-{1..3} ) +# +# inherit lua-single +# +# [...] +# +# REQUIRED_USE="${LUA_REQUIRED_USE}" +# DEPEND="${LUA_DEPS}" +# RDEPEND="${DEPEND} +# $(lua_gen_cond_dep ' +# dev-lua/foo[${LUA_USEDEP}] +# ') +# " +# BDEPEND="virtual/pkgconfig" +# +# # Only neeed if the setup phase has to do more than just call lua-single_pkg_setup +# pkg_setup() { +# lua-single_pkg_setup +# [...] +# } +# +# src_install() { +# emake LUA_VERSION="$(lua_get_version)" install +# } +# @CODE + +case ${EAPI:-0} in + 0|1|2|3|4|5|6) + die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}" + ;; + 7) + ;; + *) + die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" + ;; +esac + +if [[ ! ${_LUA_SINGLE_R0} ]]; then + +if [[ ${_LUA_R0} ]]; then + die 'lua-single.eclass cannot be used with lua.eclass.' +fi + +inherit lua-utils + +fi + +EXPORT_FUNCTIONS pkg_setup + +# @ECLASS-VARIABLE: LUA_COMPAT +# @REQUIRED +# @PRE_INHERIT +# @DESCRIPTION: +# This variable contains a list of Lua implementations the package +# supports. It must be set before the `inherit' call. It has to be +# an array. +# +# Example: +# @CODE +# LUA_COMPAT=( lua5-1 lua5-2 lua5-3 ) +# @CODE +# +# Please note that you can also use bash brace expansion if you like: +# @CODE +# LUA_COMPAT=( lua5-{1..3} ) +# @CODE + +# @ECLASS-VARIABLE: LUA_COMPAT_OVERRIDE +# @USER_VARIABLE +# @DEFAULT_UNSET +# @DESCRIPTION: +# This variable can be used when working with ebuilds to override +# the in-ebuild LUA_COMPAT. It is a string listing all +# the implementations which package will be built for. It need be +# specified in the calling environment, and not in ebuilds. +# +# It should be noted that in order to preserve metadata immutability, +# LUA_COMPAT_OVERRIDE does not affect IUSE nor dependencies. +# The state of LUA_TARGETS is ignored, and all the implementations +# in LUA_COMPAT_OVERRIDE are built. Dependencies need to be satisfied +# manually. +# +# Example: +# @CODE +# LUA_COMPAT_OVERRIDE='lua5-2' emerge -1v dev-lua/foo +# @CODE + +# @ECLASS-VARIABLE: LUA_REQ_USE +# @DEFAULT_UNSET +# @PRE_INHERIT +# @DESCRIPTION: +# The list of USE flags required to be enabled on the chosen Lua +# implementations, formed as a USE-dependency string. It should be valid +# for all implementations in LUA_COMPAT, so it may be necessary to +# use USE defaults. +# This must be set before calling `inherit'. +# +# Example: +# @CODE +# LUA_REQ_USE="deprecated" +# @CODE +# +# It will cause the Lua dependencies to look like: +# @CODE +# lua_targets_luaX-Y? ( dev-lang/lua:X.Y[deprecated] ) +# @CODE + +# @ECLASS-VARIABLE: LUA_DEPS +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# This is an eclass-generated Lua dependency string for all +# implementations listed in LUA_COMPAT. +# +# Example use: +# @CODE +# RDEPEND="${LUA_DEPS} +# dev-foo/mydep" +# DEPEND="${RDEPEND}" +# @CODE +# +# Example value: +# @CODE +# lua_targets_lua5-1? ( dev-lang/lua:5.1 ) +# lua_targets_lua5-2? ( dev-lang/lua:5.2 ) +# @CODE + +# @ECLASS-VARIABLE: LUA_REQUIRED_USE +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# This is an eclass-generated required-use expression which ensures at +# least one Lua implementation has been enabled. +# +# This expression should be utilized in an ebuild by including it in +# REQUIRED_USE, optionally behind a use flag. +# +# Example use: +# @CODE +# REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )" +# @CODE +# +# Example value: +# @CODE +# || ( lua_targets_lua5-1 lua_targets_lua5-2 ) +# @CODE + +# @ECLASS-VARIABLE: LUA_SINGLE_USEDEP +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# This is an eclass-generated USE-dependency string which can be used +# to depend on another lua-single package being built for the same +# Lua implementations. +# +# If you need to depend on a multi-impl (lua.eclass) package, use +# lua_gen_cond_dep with LUA_USEDEP placeholder instead. +# +# Example use: +# @CODE +# RDEPEND="dev-lua/foo[${LUA_SINGLE_USEDEP}]" +# @CODE +# +# Example value: +# @CODE +# lua_single_target_lua5-1(-)? +# @CODE + +# @ECLASS-VARIABLE: LUA_USEDEP +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# This is an eclass-generated USE-dependency string which can be used to +# depend on another Lua package being built for the same Lua +# implementations. +# +# Example use: +# @CODE +# RDEPEND="dev-lua/foo[${LUA_USEDEP}]" +# @CODE +# +# Example value: +# @CODE +# lua_targets_lua5-1(-)?,lua_targets_lua5-2(-)? +# @CODE + +# @FUNCTION: _lua_single_set_globals +# @INTERNAL +# @DESCRIPTION: +# Sets all the global output variables provided by this eclass. +# This function must be called once, in global scope. +_lua_single_set_globals() { + _lua_set_impls + + local flags=( "${_LUA_SUPPORTED_IMPLS[@]/#/lua_single_target_}" ) + + if [[ ${#_LUA_SUPPORTED_IMPLS[@]} -eq 1 ]]; then + # if only one implementation is supported, use IUSE defaults + # to avoid requesting the user to enable it + IUSE="+${flags[0]}" + else + IUSE="${flags[*]}" + fi + + local requse="^^ ( ${flags[*]} )" + local single_flags="${flags[@]/%/(-)?}" + local single_usedep=${single_flags// /,} + + local deps= i LUA_PKG_DEP + for i in "${_LUA_SUPPORTED_IMPLS[@]}"; do + _lua_export "${i}" LUA_PKG_DEP + deps+="lua_single_target_${i}? ( ${LUA_PKG_DEP} ) " + done + + if [[ ${LUA_DEPS+1} ]]; then + if [[ ${LUA_DEPS} != "${deps}" ]]; then + eerror "LUA_DEPS have changed between inherits (LUA_REQ_USE?)!" + eerror "Before: ${LUA_DEPS}" + eerror "Now : ${deps}" + die "LUA_DEPS integrity check failed" + fi + + # these two are formality -- they depend on LUA_COMPAT only + if [[ ${LUA_REQUIRED_USE} != ${requse} ]]; then + eerror "LUA_REQUIRED_USE have changed between inherits!" + eerror "Before: ${LUA_REQUIRED_USE}" + eerror "Now : ${requse}" + die "LUA_REQUIRED_USE integrity check failed" + fi + + if [[ ${LUA_SINGLE_USEDEP} != "${single_usedep}" ]]; then + eerror "LUA_SINGLE_USEDEP have changed between inherits!" + eerror "Before: ${LUA_SINGLE_USEDEP}" + eerror "Now : ${single_usedep}" + die "LUA_SINGLE_USEDEP integrity check failed" + fi + else + LUA_DEPS=${deps} + LUA_REQUIRED_USE=${requse} + LUA_SINGLE_USEDEP=${single_usedep} + LUA_USEDEP='%LUA_USEDEP-NEEDS-TO-BE-USED-IN-LUA_GEN_COND_DEP%' + readonly LUA_DEPS LUA_REQUIRED_USE LUA_SINGLE_USEDEP LUA_USEDEP + fi +} + +_lua_single_set_globals +unset -f _lua_single_set_globals + +if [[ ! ${_LUA_SINGLE_R0} ]]; then + +# @FUNCTION: _lua_gen_usedep +# @USAGE: [...] +# @INTERNAL +# @DESCRIPTION: +# Output a USE dependency string for Lua implementations which +# are both in LUA_COMPAT and match any of the patterns passed +# as parameters to the function. +# +# The patterns can be fnmatch-style patterns (matched via bash == operator +# against LUA_COMPAT values). Remember to escape or quote the fnmatch +# patterns to prevent accidental shell filename expansion. +# +# This is an internal function used to implement lua_gen_cond_dep. +_lua_gen_usedep() { + debug-print-function ${FUNCNAME} "${@}" + + local impl matches=() + + _lua_verify_patterns "${@}" + for impl in "${_LUA_SUPPORTED_IMPLS[@]}"; do + if _lua_impl_matches "${impl}" "${@}"; then + matches+=( + "lua_single_target_${impl}(-)?" + ) + fi + done + + [[ ${matches[@]} ]] || die "No supported implementations match lua_gen_usedep patterns: ${@}" + + local out=${matches[@]} + echo "${out// /,}" +} + +# @FUNCTION: _lua_impl_matches +# @USAGE: [...] +# @INTERNAL +# @DESCRIPTION: +# Check whether the specified matches at least one +# of the patterns following it. Return 0 if it does, 1 otherwise. +# Matches if no patterns are provided. +# +# can be in LUA_COMPAT or ELUA form. The patterns can be +# fnmatch-style patterns, e.g. 'lua5*', '.. +_lua_impl_matches() { + [[ ${#} -ge 1 ]] || die "${FUNCNAME}: takes at least 1 parameter" + [[ ${#} -eq 1 ]] && return 0 + + local impl=${1} pattern + shift + + for pattern; do + # unify value style to allow lax matching + if [[ ${impl/./-} == ${pattern/./-} ]]; then + return 0 + fi + done + + return 1 +} + +# @FUNCTION: _lua_verify_patterns +# @USAGE: ... +# @INTERNAL +# @DESCRIPTION: +# Verify whether the patterns passed to the eclass function are correct +# (i.e. can match any valid implementation). Dies on wrong pattern. +_lua_verify_patterns() { + debug-print-function ${FUNCNAME} "${@}" + + local impl pattern + for pattern; do + for impl in "${_LUA_ALL_IMPLS[@]}"; do + [[ ${impl} == ${pattern/./-} ]] && continue 2 + done + + die "Invalid implementation pattern: ${pattern}" + done +} + +# @FUNCTION: lua_gen_cond_dep +# @USAGE: [...] +# @DESCRIPTION: +# Output a list of -ies made conditional to USE flags +# of Lua implementations which are both in LUA_COMPAT and match +# any of the patterns passed as the remaining parameters. +# +# The patterns can be fnmatch-style patterns (matched via bash == operator +# against LUA_COMPAT values). Remember to escape or quote the fnmatch +# patterns to prevent accidental shell filename expansion. +# +# In order to enforce USE constraints on the packages, verbatim +# '${LUA_SINGLE_USEDEP}' and '${LUA_USEDEP}' (quoted!) may +# be placed in the dependency specification. It will get expanded within +# the function into a proper USE dependency string. +# +# Example: +# @CODE +# LUA_COMPAT=( lua5-{1..3} ) +# RDEPEND="$(lua_gen_cond_dep \ +# 'dev-lua/backported_core_module[${LUA_USEDEP}]' lua5-1 lua5-2 )" +# @CODE +# +# It will cause the variable to look like: +# @CODE +# RDEPEND="lua_single_target_lua5-1? ( +# dev-lua/backported_core_module[lua_targets_lua5-1(-)?,...] ) +# lua_single_target_lua5-2? ( +# dev-lua/backported_core_module[lua_targets_lua5-2(-)?,...] )" +# @CODE +lua_gen_cond_dep() { + debug-print-function ${FUNCNAME} "${@}" + + local impl matches=() + + local dep=${1} + shift + + _lua_verify_patterns "${@}" + for impl in "${_LUA_SUPPORTED_IMPLS[@]}"; do + if _lua_impl_matches "${impl}" "${@}"; then + # substitute ${LUA_SINGLE_USEDEP} if used + # (since lua_gen_usedep() will not return + # ${LUA_SINGLE_USEDEP}, the code is run at most once) + if [[ ${dep} == *'${LUA_SINGLE_USEDEP}'* ]]; then + local usedep=$(_lua_gen_usedep "${@}") + dep=${dep//\$\{LUA_SINGLE_USEDEP\}/${usedep}} + fi + local multi_usedep="lua_targets_${impl}(-)" + + local subdep=${dep//\$\{LUA_MULTI_USEDEP\}/${multi_usedep}} + matches+=( "lua_single_target_${impl}? ( + ${subdep//\$\{LUA_USEDEP\}/${multi_usedep}} )" ) + fi + done + + echo "${matches[@]}" +} + +# @FUNCTION: lua_gen_impl_dep +# @USAGE: [ [...]] +# @DESCRIPTION: +# Output a dependency on Lua implementations with the specified USE +# dependency string appended, or no USE dependency string if called +# without the argument (or with empty argument). If any implementation +# patterns are passed, the output dependencies will be generated only +# for the implementations matching them. +# +# The patterns can be fnmatch-style patterns (matched via bash == operator +# against LUA_COMPAT values). Remember to escape or quote the fnmatch +# patterns to prevent accidental shell filename expansion. +# +# Use this function when you need to request different USE flags +# on the Lua interpreter depending on package's USE flags. If you +# only need a single set of interpreter USE flags, just set +# LUA_REQ_USE and use ${LUA_DEPS} globally. +# +# Example: +# @CODE +# LUA_COMPAT=( lua5-{1..3} ) +# RDEPEND="foo? ( $(lua_gen_impl_dep 'deprecated(+)' lua5-3 ) )" +# @CODE +# +# It will cause the variable to look like: +# @CODE +# RDEPEND="foo? ( +# lua_single_target_lua5-3? ( dev-lang/lua:5.3[deprecated(+)] ) +# )" +# @CODE +lua_gen_impl_dep() { + debug-print-function ${FUNCNAME} "${@}" + + local impl + local matches=() + + local LUA_REQ_USE=${1} + shift + + _lua_verify_patterns "${@}" + for impl in "${_LUA_SUPPORTED_IMPLS[@]}"; do + if _lua_impl_matches "${impl}" "${@}"; then + local LUA_PKG_DEP + _lua_export "${impl}" LUA_PKG_DEP + matches+=( "lua_single_target_${impl}? ( ${LUA_PKG_DEP} )" ) + fi + done + + echo "${matches[@]}" +} + +# @FUNCTION: lua_setup +# @DESCRIPTION: +# Determine what the selected Lua implementation is and set +# the Lua build environment up for it. +lua_setup() { + debug-print-function ${FUNCNAME} "${@}" + + unset ELUA + + # support developer override + if [[ ${LUA_COMPAT_OVERRIDE} ]]; then + local impls=( ${LUA_COMPAT_OVERRIDE} ) + [[ ${#impls[@]} -eq 1 ]] || die "LUA_COMPAT_OVERRIDE must name exactly one implementation for lua-single" + + ewarn "WARNING: LUA_COMPAT_OVERRIDE in effect. The following Lua" + ewarn "implementation will be used:" + ewarn + ewarn " ${LUA_COMPAT_OVERRIDE}" + ewarn + ewarn "Dependencies won't be satisfied, and LUA_SINGLE_TARGET flags will be ignored." + + _lua_export "${impls[0]}" ELUA LUA + _lua_wrapper_setup + einfo "Using ${ELUA} to build" + return + fi + + local impl + for impl in "${_LUA_SUPPORTED_IMPLS[@]}"; do + if use "lua_single_target_${impl}"; then + if [[ ${ELUA} ]]; then + eerror "Your LUA_SINGLE_TARGET setting lists more than a single Lua" + eerror "implementation. Please set it to just one value. If you need" + eerror "to override the value for a single package, please use package.env" + eerror "or an equivalent solution (man 5 portage)." + echo + die "More than one implementation in LUA_SINGLE_TARGET." + fi + + _lua_export "${impl}" ELUA LUA + _lua_wrapper_setup + einfo "Using ${ELUA} to build" + fi + done + + if [[ ! ${ELUA} ]]; then + eerror "No Lua implementation selected for the build. Please set" + eerror "the LUA_SINGLE_TARGET variable in your make.conf to one" + eerror "of the following values:" + eerror + eerror "${_LUA_SUPPORTED_IMPLS[@]}" + echo + die "No supported Lua implementation in LUA_SINGLE_TARGET." + fi +} + +# @FUNCTION: lua-single_pkg_setup +# @DESCRIPTION: +# Runs lua_setup. +lua-single_pkg_setup() { + debug-print-function ${FUNCNAME} "${@}" + + [[ ${MERGE_TYPE} != binary ]] && lua_setup +} + +_LUA_SINGLE_R0=1 +fi diff --git a/sdk_container/src/third_party/portage-stable/eclass/lua-utils.eclass b/sdk_container/src/third_party/portage-stable/eclass/lua-utils.eclass new file mode 100644 index 0000000000..0589318ef5 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/eclass/lua-utils.eclass @@ -0,0 +1,532 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: lua-utils.eclass +# @MAINTAINER: +# William Hubbs +# Marek Szuba +# @AUTHOR: +# Marek Szuba +# Based on python-utils-r1.eclass by Michał Górny et al. +# @SUPPORTED_EAPIS: 7 +# @BLURB: Utility functions for packages with Lua parts +# @DESCRIPTION: +# A utility eclass providing functions to query Lua implementations, +# install Lua modules and scripts. +# +# This eclass neither sets any metadata variables nor exports any phase +# functions. It can be inherited safely. + +case ${EAPI:-0} in + 0|1|2|3|4|5|6) + die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}" + ;; + 7) + ;; + *) + die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" + ;; +esac + +if [[ ! ${_LUA_UTILS_R0} ]]; then + +inherit toolchain-funcs + +# @ECLASS-VARIABLE: _LUA_ALL_IMPLS +# @INTERNAL +# @DESCRIPTION: +# All supported Lua implementations, most preferred last +_LUA_ALL_IMPLS=( + luajit + lua5-1 + lua5-2 + lua5-3 + lua5-4 +) +readonly _LUA_ALL_IMPLS + +# @FUNCTION: _lua_set_impls +# @INTERNAL +# @DESCRIPTION: +# Check LUA_COMPAT for well-formedness and validity, then set +# two global variables: +# +# - _LUA_SUPPORTED_IMPLS containing valid implementations supported +# by the ebuild (LUA_COMPAT minus dead implementations), +# +# - and _LUA_UNSUPPORTED_IMPLS containing valid implementations that +# are not supported by the ebuild. +# +# Implementations in both variables are ordered using the pre-defined +# eclass implementation ordering. +# +# This function must only be called once. +_lua_set_impls() { + local i + + if ! declare -p LUA_COMPAT &>/dev/null; then + die 'LUA_COMPAT not declared.' + fi + if [[ $(declare -p LUA_COMPAT) != "declare -a"* ]]; then + die 'LUA_COMPAT must be an array.' + fi + + local supp=() unsupp=() + + for i in "${_LUA_ALL_IMPLS[@]}"; do + if has "${i}" "${LUA_COMPAT[@]}"; then + supp+=( "${i}" ) + else + unsupp+=( "${i}" ) + fi + done + + if [[ ! ${supp[@]} ]]; then + die "No supported implementation in LUA_COMPAT." + fi + + if [[ ${_LUA_SUPPORTED_IMPLS[@]} ]]; then + # set once already, verify integrity + if [[ ${_LUA_SUPPORTED_IMPLS[@]} != ${supp[@]} ]]; then + eerror "Supported impls (LUA_COMPAT) changed between inherits!" + eerror "Before: ${_LUA_SUPPORTED_IMPLS[*]}" + eerror "Now : ${supp[*]}" + die "_LUA_SUPPORTED_IMPLS integrity check failed" + fi + if [[ ${_LUA_UNSUPPORTED_IMPLS[@]} != ${unsupp[@]} ]]; then + eerror "Unsupported impls changed between inherits!" + eerror "Before: ${_LUA_UNSUPPORTED_IMPLS[*]}" + eerror "Now : ${unsupp[*]}" + die "_LUA_UNSUPPORTED_IMPLS integrity check failed" + fi + else + _LUA_SUPPORTED_IMPLS=( "${supp[@]}" ) + _LUA_UNSUPPORTED_IMPLS=( "${unsupp[@]}" ) + readonly _LUA_SUPPORTED_IMPLS _LUA_UNSUPPORTED_IMPLS + fi +} + +# @FUNCTION: _lua_wrapper_setup +# @USAGE: [ []] +# @INTERNAL +# @DESCRIPTION: +# Create proper Lua executables and pkg-config wrappers +# (if available) in the directory named by . Set up PATH +# and PKG_CONFIG_PATH appropriately. defaults to ${T}/${ELUA}. +# +# The wrappers will be created for implementation named by , +# or for one named by ${ELUA} if no passed. +# +# If the named directory contains a lua symlink already, it will +# be assumed to contain proper wrappers already and only environment +# setup will be done. If wrapper update is requested, the directory +# shall be removed first. +_lua_wrapper_setup() { + debug-print-function ${FUNCNAME} "${@}" + + local workdir=${1:-${T}/${ELUA}} + local impl=${2:-${ELUA}} + + [[ ${workdir} ]] || die "${FUNCNAME}: no workdir specified." + [[ ${impl} ]] || die "${FUNCNAME}: no impl nor ELUA specified." + + if [[ ! -x ${workdir}/bin/lua ]]; then + mkdir -p "${workdir}"/{bin,pkgconfig} || die + + # Clean up, in case we were supposed to do a cheap update + rm -f "${workdir}"/bin/lua{,c} || die + rm -f "${workdir}"/pkgconfig/lua.pc || die + + local ELUA LUA + _lua_export "${impl}" ELUA LUA + + # Lua interpreter + ln -s "${EPREFIX}"/usr/bin/${ELUA} "${workdir}"/bin/lua || die + + # Lua compiler, or a stub for it in case of luajit + if [[ ${ELUA} == luajit ]]; then + # Just in case + ln -s "${EPREFIX}"/bin/true "${workdir}"/bin/luac || die + else + ln -s "${EPREFIX}"/usr/bin/${ELUA/a/ac} "${workdir}"/bin/luac || die + fi + + # pkg-config + ln -s "${EPREFIX}"/usr/$(get_libdir)/pkgconfig/${ELUA}.pc \ + "${workdir}"/pkgconfig/lua.pc || die + fi + + # Now, set the environment. + # But note that ${workdir} may be shared with something else, + # and thus already on top of PATH. + if [[ ${PATH##:*} != ${workdir}/bin ]]; then + PATH=${workdir}/bin${PATH:+:${PATH}} + fi + if [[ ${PKG_CONFIG_PATH##:*} != ${workdir}/pkgconfig ]]; then + PKG_CONFIG_PATH=${workdir}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}} + fi + export PATH PKG_CONFIG_PATH +} + +# @ECLASS-VARIABLE: ELUA +# @DEFAULT_UNSET +# @DESCRIPTION: +# The executable name of the current Lua interpreter. This variable is set +# automatically in functions called by lua_foreach_impl(). +# +# Example value: +# @CODE +# lua5.1 +# @CODE + +# @ECLASS-VARIABLE: LUA +# @DEFAULT_UNSET +# @DESCRIPTION: +# The absolute path to the current Lua interpreter. This variable is set +# automatically in functions called by lua_foreach_impl(). +# +# Example value: +# @CODE +# /usr/bin/lua5.1 +# @CODE + +# @FUNCTION: _lua_get_library_file +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Get the core part (i.e. without the extension) of the library name, +# with path, of the given Lua implementation. +# Used internally by _lua_export(). +_lua_get_library_file() { + local impl="${1}" + local libdir libname + + case ${impl} in + luajit) + libname=lib$($(tc-getPKG_CONFIG) --variable libname ${impl}) || die + ;; + lua*) + libname=lib${impl} + ;; + *) + die "Invalid implementation: ${impl}" + ;; + esac + libdir=$($(tc-getPKG_CONFIG) --variable libdir ${impl}) || die + + debug-print "${FUNCNAME}: libdir = ${libdir}, libname = ${libname}" + echo "${libdir}/${libname}" +} + +# @FUNCTION: _lua_export +# @USAGE: [] ... +# @INTERNAL +# @DESCRIPTION: +# Set and export the Lua implementation-relevant variables passed +# as parameters. +# +# The optional first parameter may specify the requested Lua +# implementation (either as LUA_TARGETS value, e.g. lua5-2, +# or an ELUA one, e.g. lua5.2). If no implementation passed, +# the current one will be obtained from ${ELUA}. +_lua_export() { + debug-print-function ${FUNCNAME} "${@}" + + local impl var + + case "${1}" in + luajit) + impl=${1} + shift + ;; + lua*) + impl=${1/-/.} + shift + ;; + *) + impl=${ELUA} + if [[ -z ${impl} ]]; then + die "_lua_export called without a Lua implementation and ELUA is unset" + fi + ;; + esac + debug-print "${FUNCNAME}: implementation: ${impl}" + + for var; do + case "${var}" in + ELUA) + export ELUA=${impl} + debug-print "${FUNCNAME}: ELUA = ${ELUA}" + ;; + LUA) + export LUA="${EPREFIX}"/usr/bin/${impl} + debug-print "${FUNCNAME}: LUA = ${LUA}" + ;; + LUA_CFLAGS) + local val + + val=$($(tc-getPKG_CONFIG) --cflags ${impl}) || die + + export LUA_CFLAGS=${val} + debug-print "${FUNCNAME}: LUA_CFLAGS = ${LUA_CFLAGS}" + ;; + LUA_CMOD_DIR) + local val + + val=$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD ${impl}) || die + + export LUA_CMOD_DIR=${val} + debug-print "${FUNCNAME}: LUA_CMOD_DIR = ${LUA_CMOD_DIR}" + ;; + LUA_INCLUDE_DIR) + local val + + val=$($(tc-getPKG_CONFIG) --variable includedir ${impl}) || die + + export LUA_INCLUDE_DIR=${val} + debug-print "${FUNCNAME}: LUA_INCLUDE_DIR = ${LUA_INCLUDE_DIR}" + ;; + LUA_LIBS) + local val + + val=$($(tc-getPKG_CONFIG) --libs ${impl}) || die + + export LUA_LIBS=${val} + debug-print "${FUNCNAME}: LUA_LIBS = ${LUA_LIBS}" + ;; + LUA_LMOD_DIR) + local val + + val=$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD ${impl}) || die + + export LUA_LMOD_DIR=${val} + debug-print "${FUNCNAME}: LUA_LMOD_DIR = ${LUA_LMOD_DIR}" + ;; + LUA_PKG_DEP) + local d + case ${impl} in + luajit) + LUA_PKG_DEP="dev-lang/luajit:=" + ;; + lua*) + LUA_PKG_DEP="dev-lang/lua:${impl#lua}" + ;; + *) + die "Invalid implementation: ${impl}" + ;; + esac + + # use-dep + if [[ ${LUA_REQ_USE} ]]; then + LUA_PKG_DEP+=[${LUA_REQ_USE}] + fi + + export LUA_PKG_DEP + debug-print "${FUNCNAME}: LUA_PKG_DEP = ${LUA_PKG_DEP}" + ;; + LUA_SHARED_LIB) + local val=$(_lua_get_library_file ${impl}) + export LUA_SHARED_LIB="${val}".so + debug-print "${FUNCNAME}: LUA_SHARED_LIB = ${LUA_SHARED_LIB}" + ;; + LUA_VERSION) + local val + + val=$($(tc-getPKG_CONFIG) --modversion ${impl}) || die + + export LUA_VERSION=${val} + debug-print "${FUNCNAME}: LUA_VERSION = ${LUA_VERSION}" + ;; + *) + die "_lua_export: unknown variable ${var}" + ;; + esac + done +} + +# @FUNCTION: lua_enable_tests +# @USAGE: +# @DESCRIPTION: +# Set up IUSE, RESTRICT, BDEPEND and src_test() for running tests +# with the specified test runner. Also copies the current value +# of RDEPEND to test?-BDEPEND. The test-runner argument must be one of: +# +# - busted: dev-lua/busted +# +# Additionally, a second argument can be passed after , +# so will use that directory to search for tests. +# If not passed, a default directory of will be used. +# +# - busted: spec +# +# This function is meant as a helper for common use cases, and it only +# takes care of basic setup. You still need to list additional test +# dependencies manually. If you have uncommon use case, you should +# not use it and instead enable tests manually. +# +# This function must be called in global scope, after RDEPEND has been +# declared. Take care not to overwrite the variables set by it. +lua_enable_tests() { + debug-print-function ${FUNCNAME} "${@}" + + [[ ${#} -ge 1 ]] || die "${FUNCNAME} takes at least one argument: test-runner (test-directory)" + local test_directory + local test_pkg + case ${1} in + busted) + test_directory="${2:-spec}" + test_pkg="dev-lua/busted" + if [[ ! ${_LUA_SINGLE_R0} ]]; then + eval "lua_src_test() { + busted --lua=\"\${ELUA}\" --output=\"plainTerminal\" \"${test_directory}\" || die \"Tests fail with \${ELUA}\" + }" + src_test() { + lua_foreach_impl lua_src_test + } + else + eval "src_test() { + busted --lua=\"\${ELUA}\" --output=\"plainTerminal\" \"${test_directory}\" || die \"Tests fail with \${ELUA}\" + }" + fi + ;; + *) + die "${FUNCNAME}: unsupported argument: ${1}" + esac + + local test_deps=${RDEPEND} + if [[ -n ${test_pkg} ]]; then + if [[ ! ${_LUA_SINGLE_R0} ]]; then + test_deps+=" ${test_pkg}[${LUA_USEDEP}]" + else + test_deps+=" $(lua_gen_cond_dep " + ${test_pkg}[\${LUA_USEDEP}] + ")" + fi + fi + if [[ -n ${test_deps} ]]; then + IUSE+=" test" + RESTRICT+=" !test? ( test )" + BDEPEND+=" test? ( ${test_deps} )" + fi + + # we need to ensure successful return in case we're called last, + # otherwise Portage may wrongly assume sourcing failed + return 0 +} + +# @FUNCTION: lua_get_CFLAGS +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the compiler flags for building against Lua, +# for the given implementation. If no implementation is provided, +# ${ELUA} will be used. +# +# Please note that this function requires Lua and pkg-config installed, +# and therefore proper build-time dependencies need be added to the ebuild. +lua_get_CFLAGS() { + debug-print-function ${FUNCNAME} "${@}" + + _lua_export "${@}" LUA_CFLAGS + echo "${LUA_CFLAGS}" +} + +# @FUNCTION: lua_get_cmod_dir +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the name of the directory into which compiled Lua +# modules are installed, for the given implementation. If no implementation +# is provided, ${ELUA} will be used. +# +# Please note that this function requires Lua and pkg-config installed, +# and therefore proper build-time dependencies need be added to the ebuild. +lua_get_cmod_dir() { + debug-print-function ${FUNCNAME} "${@}" + + _lua_export "${@}" LUA_CMOD_DIR + echo "${LUA_CMOD_DIR}" +} + +# @FUNCTION: lua_get_include_dir +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the name of the directory containing header files +# of the given Lua implementation. If no implementation is provided, +# ${ELUA} will be used. +# +# Please note that this function requires Lua and pkg-config installed, +# and therefore proper build-time dependencies need be added to the ebuild. +lua_get_include_dir() { + debug-print-function ${FUNCNAME} "${@}" + + _lua_export "${@}" LUA_INCLUDE_DIR + echo "${LUA_INCLUDE_DIR}" +} + +# @FUNCTION: lua_get_LIBS +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the compiler flags for linking against Lua, +# for the given implementation. If no implementation is provided, +# ${ELUA} will be used. +# +# Please note that this function requires Lua and pkg-config installed, +# and therefore proper build-time dependencies need be added to the ebuild. +lua_get_LIBS() { + debug-print-function ${FUNCNAME} "${@}" + + _lua_export "${@}" LUA_LIBS + echo "${LUA_LIBS}" +} + +# @FUNCTION: lua_get_lmod_dir +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the name of the directory into which native-Lua +# modules are installed, for the given implementation. If no implementation +# is provided, ${ELUA} will be used. +# +# Please note that this function requires Lua and pkg-config installed, +# and therefore proper build-time dependencies need be added to the ebuild. +lua_get_lmod_dir() { + debug-print-function ${FUNCNAME} "${@}" + + _lua_export "${@}" LUA_LMOD_DIR + echo "${LUA_LMOD_DIR}" +} + +# @FUNCTION: lua_get_shared_lib +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the expected name, with path, of the main shared library +# of the given Lua implementation. If no implementation is provided, +# ${ELUA} will be used. +# +# Note that it is up to the ebuild maintainer to ensure Lua actually +# provides a shared library. +# +# Please note that this function requires Lua and pkg-config installed, +# and therefore proper build-time dependencies need be added to the ebuild. +lua_get_shared_lib() { + debug-print-function ${FUNCNAME} "${@}" + + _lua_export "${@}" LUA_SHARED_LIB + echo "${LUA_SHARED_LIB}" +} + +# @FUNCTION: lua_get_version +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the full version number of the given Lua implementation. +# If no implementation is provided, ${ELUA} will be used. +# +# Please note that this function requires Lua and pkg-config installed, +# and therefore proper build-time dependencies need be added to the ebuild. +lua_get_version() { + debug-print-function ${FUNCNAME} "${@}" + + _lua_export "${@}" LUA_VERSION + echo "${LUA_VERSION}" +} + +_LUA_UTILS_R0=1 +fi diff --git a/sdk_container/src/third_party/portage-stable/eclass/lua.eclass b/sdk_container/src/third_party/portage-stable/eclass/lua.eclass new file mode 100644 index 0000000000..46d9e848c8 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/eclass/lua.eclass @@ -0,0 +1,381 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: lua.eclass +# @MAINTAINER: +# William Hubbs +# Marek Szuba +# @AUTHOR: +# Marek Szuba +# Based on python-r1.eclass by Michał Górny et al. +# @SUPPORTED_EAPIS: 7 +# @BLURB: A common eclass for Lua packages +# @DESCRIPTION: +# A common eclass providing helper functions to build and install +# packages supporting being installed for multiple Lua implementations. +# +# This eclass sets correct IUSE. Modification of REQUIRED_USE has to +# be done by the author of the ebuild (but LUA_REQUIRED_USE is +# provided for convenience, see below). The eclass exports LUA_DEPS +# and LUA_USEDEP so you can create correct dependencies for your +# package easily. It also provides methods to easily run a command for +# each enabled Lua implementation and duplicate the sources for them. +# +# Note that since this eclass always inherits lua-utils as well, in ebuilds +# using the former there is no need to explicitly inherit the latter in order +# to use helper functions such as lua_get_CFLAGS. +# +# @EXAMPLE: +# @CODE +# EAPI=7 +# +# LUA_COMPAT=( lua5-{1..3} ) +# +# inherit lua +# +# [...] +# +# REQUIRED_USE="${LUA_REQUIRED_USE}" +# DEPEND="${LUA_DEPS}" +# RDEPEND="${DEPEND} +# dev-lua/foo[${LUA_USEDEP}]" +# BDEPEND="virtual/pkgconfig" +# +# lua_src_install() { +# emake LUA_VERSION="$(lua_get_version)" install +# } +# +# src_install() { +# lua_foreach_impl lua_src_install +# } +# @CODE + +case ${EAPI:-0} in + 0|1|2|3|4|5|6) + die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}" + ;; + 7) + ;; + *) + die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" + ;; +esac + +if [[ ! ${_LUA_R0} ]]; then + +if [[ ${_LUA_SINGLE_R0} ]]; then + die 'lua.eclass cannot be used with lua-single.eclass.' +fi + +inherit multibuild lua-utils + +fi + +# @ECLASS-VARIABLE: LUA_COMPAT +# @REQUIRED +# @PRE_INHERIT +# @DESCRIPTION: +# This variable contains a list of Lua implementations the package +# supports. It must be set before the `inherit' call. It has to be +# an array. +# +# Example: +# @CODE +# LUA_COMPAT=( lua5-1 lua5-2 lua5-3 ) +# @CODE +# +# Please note that you can also use bash brace expansion if you like: +# @CODE +# LUA_COMPAT=( lua5-{1..3} ) +# @CODE + +# @ECLASS-VARIABLE: LUA_COMPAT_OVERRIDE +# @USER_VARIABLE +# @DEFAULT_UNSET +# @DESCRIPTION: +# This variable can be used when working with ebuilds to override +# the in-ebuild LUA_COMPAT. It is a string listing all +# the implementations which package will be built for. It need be +# specified in the calling environment, and not in ebuilds. +# +# It should be noted that in order to preserve metadata immutability, +# LUA_COMPAT_OVERRIDE does not affect IUSE nor dependencies. +# The state of LUA_TARGETS is ignored, and all the implementations +# in LUA_COMPAT_OVERRIDE are built. Dependencies need to be satisfied +# manually. +# +# Example: +# @CODE +# LUA_COMPAT_OVERRIDE='lua5-2' emerge -1v dev-lua/foo +# @CODE + +# @ECLASS-VARIABLE: LUA_REQ_USE +# @DEFAULT_UNSET +# @PRE_INHERIT +# @DESCRIPTION: +# The list of USE flags required to be enabled on the chosen Lua +# implementations, formed as a USE-dependency string. It should be valid +# for all implementations in LUA_COMPAT, so it may be necessary to +# use USE defaults. +# This must be set before calling `inherit'. +# +# Example: +# @CODE +# LUA_REQ_USE="deprecated" +# @CODE +# +# It will cause the Lua dependencies to look like: +# @CODE +# lua_targets_luaX-Y? ( dev-lang/lua:X.Y[deprecated] ) +# @CODE + +# @ECLASS-VARIABLE: BUILD_DIR +# @OUTPUT_VARIABLE +# @DEFAULT_UNSET +# @DESCRIPTION: +# The current build directory. In global scope, it is supposed to +# contain an initial build directory; if unset, it defaults to ${S}. +# +# In functions run by lua_foreach_impl(), the BUILD_DIR is locally +# set to an implementation-specific build directory. That path is +# created through appending a hyphen and the implementation name +# to the final component of the initial BUILD_DIR. +# +# Example value: +# @CODE +# ${WORKDIR}/foo-1.3-lua5-1 +# @CODE + +# @ECLASS-VARIABLE: LUA_DEPS +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# This is an eclass-generated Lua dependency string for all +# implementations listed in LUA_COMPAT. +# +# Example use: +# @CODE +# RDEPEND="${LUA_DEPS} +# dev-foo/mydep" +# DEPEND="${RDEPEND}" +# @CODE +# +# Example value: +# @CODE +# lua_targets_lua5-1? ( dev-lang/lua:5.1 ) +# lua_targets_lua5-2? ( dev-lang/lua:5.2 ) +# @CODE + +# @ECLASS-VARIABLE: LUA_REQUIRED_USE +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# This is an eclass-generated required-use expression which ensures at +# least one Lua implementation has been enabled. +# +# This expression should be utilized in an ebuild by including it in +# REQUIRED_USE, optionally behind a use flag. +# +# Example use: +# @CODE +# REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )" +# @CODE +# +# Example value: +# @CODE +# || ( lua_targets_lua5-1 lua_targets_lua5-2 ) +# @CODE + +# @ECLASS-VARIABLE: LUA_USEDEP +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# This is an eclass-generated USE-dependency string which can be used to +# depend on another Lua package being built for the same Lua +# implementations. +# +# Example use: +# @CODE +# RDEPEND="dev-lua/foo[${LUA_USEDEP}]" +# @CODE +# +# Example value: +# @CODE +# lua_targets_lua5-1(-)?,lua_targets_lua5-2(-)? +# @CODE + +if [[ ! ${_LUA_R0} ]]; then + +# @FUNCTION: _lua_validate_useflags +# @INTERNAL +# @DESCRIPTION: +# Enforce the proper setting of LUA_TARGETS, if LUA_COMPAT_OVERRIDE +# is not in effect. If it is, just warn that the flags will be ignored. +_lua_validate_useflags() { + debug-print-function ${FUNCNAME} "${@}" + + if [[ ${LUA_COMPAT_OVERRIDE} ]]; then + if [[ ! ${_LUA_COMPAT_OVERRIDE_WARNED} ]]; then + ewarn "WARNING: LUA_COMPAT_OVERRIDE in effect. The following Lua" + ewarn "implementations will be enabled:" + ewarn + ewarn " ${LUA_COMPAT_OVERRIDE}" + ewarn + ewarn "Dependencies won't be satisfied, and LUA_TARGETS will be ignored." + _LUA_COMPAT_OVERRIDE_WARNED=1 + fi + # we do not use flags with LCO + return + fi + + local i + + for i in "${_LUA_SUPPORTED_IMPLS[@]}"; do + use "lua_targets_${i}" && return 0 + done + + eerror "No Lua implementation selected for the build. Please add one" + eerror "of the following values to your LUA_TARGETS" + eerror "(in make.conf or package.use):" + eerror + eerror "${LUA_COMPAT[@]}" + echo + die "No supported Lua implementation in LUA_TARGETS." +} + +# @FUNCTION: _lua_obtain_impls +# @INTERNAL +# @DESCRIPTION: +# Set up the enabled implementation list. +_lua_obtain_impls() { + _lua_validate_useflags + + if [[ ${LUA_COMPAT_OVERRIDE} ]]; then + MULTIBUILD_VARIANTS=( ${LUA_COMPAT_OVERRIDE} ) + return + fi + + MULTIBUILD_VARIANTS=() + + local impl + for impl in "${_LUA_SUPPORTED_IMPLS[@]}"; do + has "${impl}" "${LUA_COMPAT[@]}" && \ + use "lua_targets_${impl}" && MULTIBUILD_VARIANTS+=( "${impl}" ) + done +} + + +# @FUNCTION: _lua_multibuild_wrapper +# @USAGE: [...] +# @INTERNAL +# @DESCRIPTION: +# Initialize the environment for the Lua implementation selected +# for multibuild. +_lua_multibuild_wrapper() { + debug-print-function ${FUNCNAME} "${@}" + + local -x ELUA LUA + _lua_export "${MULTIBUILD_VARIANT}" ELUA LUA + local -x PATH=${PATH} PKG_CONFIG_PATH=${PKG_CONFIG_PATH} + _lua_wrapper_setup + + "${@}" +} + +# @FUNCTION: lua_copy_sources +# @DESCRIPTION: +# Create a single copy of the package sources for each enabled Lua +# implementation. +# +# The sources are always copied from initial BUILD_DIR (or S if unset) +# to implementation-specific build directory matching BUILD_DIR used by +# lua_foreach_abi(). +lua_copy_sources() { + debug-print-function ${FUNCNAME} "${@}" + + local MULTIBUILD_VARIANTS + _lua_obtain_impls + + multibuild_copy_sources +} + +# @FUNCTION: lua_foreach_impl +# @USAGE: [...] +# @DESCRIPTION: +# Run the given command for each of the enabled Lua implementations. +# If additional parameters are passed, they will be passed through +# to the command. +# +# The function will return 0 status if all invocations succeed. +# Otherwise, the return code from first failing invocation will +# be returned. +# +# For each command being run, ELUA, LUA and BUILD_DIR are set +# locally, and the former two are exported to the command environment. +lua_foreach_impl() { + debug-print-function ${FUNCNAME} "${@}" + + local MULTIBUILD_VARIANTS + _lua_obtain_impls + + multibuild_foreach_variant _lua_multibuild_wrapper "${@}" +} + +_LUA_R0=1 +fi + +# @FUNCTION: _lua_set_globals +# @INTERNAL +# @DESCRIPTION: +# Sets all the global output variables provided by this eclass. +# This function must be called once, in global scope. +_lua_set_globals() { + local deps i LUA_PKG_DEP + + _lua_set_impls + + for i in "${_LUA_SUPPORTED_IMPLS[@]}"; do + _lua_export "${i}" LUA_PKG_DEP + deps+="lua_targets_${i}? ( ${LUA_PKG_DEP} ) " + done + + local flags=( "${_LUA_SUPPORTED_IMPLS[@]/#/lua_targets_}" ) + local optflags=${flags[@]/%/(-)?} + + local requse="|| ( ${flags[*]} )" + local usedep=${optflags// /,} + + if [[ ${LUA_DEPS+1} ]]; then + # IUSE is magical, so we can't really check it + # (but we verify LUA_COMPAT already) + + if [[ ${LUA_DEPS} != "${deps}" ]]; then + eerror "LUA_DEPS have changed between inherits (LUA_REQ_USE?)!" + eerror "Before: ${LUA_DEPS}" + eerror "Now : ${deps}" + die "LUA_DEPS integrity check failed" + fi + + # these two are formality -- they depend on LUA_COMPAT only + if [[ ${LUA_REQUIRED_USE} != ${requse} ]]; then + eerror "LUA_REQUIRED_USE have changed between inherits!" + eerror "Before: ${LUA_REQUIRED_USE}" + eerror "Now : ${requse}" + die "LUA_REQUIRED_USE integrity check failed" + fi + + if [[ ${LUA_USEDEP} != "${usedep}" ]]; then + eerror "LUA_USEDEP have changed between inherits!" + eerror "Before: ${LUA_USEDEP}" + eerror "Now : ${usedep}" + die "LUA_USEDEP integrity check failed" + fi + else + IUSE=${flags[*]} + + LUA_DEPS=${deps} + LUA_REQUIRED_USE=${requse} + LUA_USEDEP=${usedep} + readonly LUA_DEPS LUA_REQUIRED_USE + fi +} + +_lua_set_globals +unset -f _lua_set_globals