From a02204eadeaffaeb9137c7b2af181f25ad5fe576 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 14 Sep 2017 09:22:55 -0700 Subject: ypbind-mt: Upgrade to 2.4 Fix build with musl along the way Signed-off-by: Khem Raj Signed-off-by: Martin Jansa Signed-off-by: Joe MacDonald --- .../0001-dns_hosts-Fix-build-with-musl.patch | 67 ++++++++++++++++++++++ .../recipes-support/nis/ypbind-mt_1.38.bb | 58 ------------------- .../recipes-support/nis/ypbind-mt_2.4.bb | 62 ++++++++++++++++++++ 3 files changed, 129 insertions(+), 58 deletions(-) create mode 100644 meta-networking/recipes-support/nis/ypbind-mt/0001-dns_hosts-Fix-build-with-musl.patch delete mode 100644 meta-networking/recipes-support/nis/ypbind-mt_1.38.bb create mode 100644 meta-networking/recipes-support/nis/ypbind-mt_2.4.bb (limited to 'meta-networking/recipes-support') diff --git a/meta-networking/recipes-support/nis/ypbind-mt/0001-dns_hosts-Fix-build-with-musl.patch b/meta-networking/recipes-support/nis/ypbind-mt/0001-dns_hosts-Fix-build-with-musl.patch new file mode 100644 index 0000000000..643b0a9405 --- /dev/null +++ b/meta-networking/recipes-support/nis/ypbind-mt/0001-dns_hosts-Fix-build-with-musl.patch @@ -0,0 +1,67 @@ +From 5452961750275b1e3f7c95e9528338f0ee0357ad Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 14 Sep 2017 09:17:35 -0700 +Subject: [PATCH] dns_hosts: Fix build with musl + +Add NETDB_* defines which are not available in musl +remove need for sys/cdefs.h by remove __P +Add _GNU_SOURCE for missing u_char definition + +Signed-off-by: Khem Raj +--- +Upstream-Status: Pending + + lib/Makefile.am | 2 +- + lib/dns_hosts.c | 9 ++++++++- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/lib/Makefile.am b/lib/Makefile.am +index 977a8db..35cb5b3 100644 +--- a/lib/Makefile.am ++++ b/lib/Makefile.am +@@ -8,7 +8,7 @@ + noinst_LIBRARIES = libcompat.a + noinst_HEADERS = ypbind3_binding.h + +-AM_CFLAGS = -D_REENTRANT=1 @WARNFLAGS@ ++AM_CFLAGS = -D_GNU_SOURCE -D_REENTRANT=1 @WARNFLAGS@ + AM_CPPFLAGS = -I$(srcdir) @TIRPC_CFLAGS@ @NSL_CFLAGS@ -DLOCALEDIR=\"$(localedir)\" + + libcompat_a_SOURCES = dns_hosts.c res_options.h ypbind3_binding_dup.c \ +diff --git a/lib/dns_hosts.c b/lib/dns_hosts.c +index fd421fd..6067879 100644 +--- a/lib/dns_hosts.c ++++ b/lib/dns_hosts.c +@@ -64,6 +64,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -84,6 +85,12 @@ extern struct hostent *_gethtbyaddr(const char *, int, int); + #ifndef LOG_AUTH + # define LOG_AUTH 0 + #endif ++#ifndef NETDB_SUCCESS ++# define NETDB_SUCCESS 0 ++#endif ++#ifndef NETDB_INTERNAL ++# define NETDB_INTERNAL -1 ++#endif + + #define MULTI_PTRS_ARE_ALIASES 1 /* XXX - experimental */ + +@@ -101,7 +108,7 @@ static char hostbuf[8*1024]; + static struct in_addr host_addr; + + #ifdef RESOLVSORT +-static void addrsort __P((char **, int)); ++static void addrsort (char **, int); + #endif + + #if PACKETSZ > 1024 +-- +2.14.1 + diff --git a/meta-networking/recipes-support/nis/ypbind-mt_1.38.bb b/meta-networking/recipes-support/nis/ypbind-mt_1.38.bb deleted file mode 100644 index b9c0aa700a..0000000000 --- a/meta-networking/recipes-support/nis/ypbind-mt_1.38.bb +++ /dev/null @@ -1,58 +0,0 @@ -# This package builds the NIS ypbind daemon -# The source package is utils/net/NIS/ypbind-mt -# -require nis.inc - -DESCRIPTION = " \ -Multithreaded NIS bind service (ypbind-mt). \ -ypbind-mt is a complete new implementation of a NIS \ -binding daemon for Linux. It has the following \ -features. Supports ypbind protocol V1 and V2. \ -Uses threads for better response. Supports multiple \ -domain bindings. Supports /var/yp/binding/* file \ -for Linux libc 4/5 and glibc 2.x. Supports a list \ -of known secure NIS server (/etc/yp.conf) Binds to \ -the server which answered as first. \ -\ -This is the final IPv4-only version of ypbind-mt. \ -" -HOMEPAGE = "http://www.linux-nis.org/nis/ypbind-mt/index.html" -DEPENDS = " \ - yp-tools \ - ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ - " -RDEPENDS_${PN} += "yp-tools" - -# ypbind-mt now provides all the functionality of ypbind -# and is used in place of it. -PROVIDES += "ypbind" - -SRC_URI = "http://www.linux-nis.org/download/ypbind-mt/${BP}.tar.bz2 \ - file://ypbind.init \ - file://ypbind.service \ -" -SRC_URI[md5sum] = "094088c0e282fa7f3b3dd6cc51d0a4e1" -SRC_URI[sha256sum] = "1930ce19f6ccfe10400f3497b31867f71690d2bcd3f5b575199fa915559b7746" - -inherit systemd update-rc.d - -SYSTEMD_SERVICE_${PN} = "ypbind.service" -INITSCRIPT_NAME = "ypbind" -INITSCRIPT_PARAMS = "start 44 3 5 . stop 70 0 1 2 6 ." - -CACHED_CONFIGUREVARS = "ac_cv_prog_STRIP=/bin/true" - -do_install_append () { - install -d ${D}${sysconfdir}/init.d - install -d ${D}${sysconfdir}/rcS.d - - install -m 0755 ${WORKDIR}/ypbind.init ${D}${sysconfdir}/init.d/ypbind - - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/ypbind.service ${D}${systemd_unitdir}/system -} - - -RPROVIDES_${PN} += "${PN}-systemd" -RREPLACES_${PN} += "${PN}-systemd" -RCONFLICTS_${PN} += "${PN}-systemd" diff --git a/meta-networking/recipes-support/nis/ypbind-mt_2.4.bb b/meta-networking/recipes-support/nis/ypbind-mt_2.4.bb new file mode 100644 index 0000000000..9822f455ec --- /dev/null +++ b/meta-networking/recipes-support/nis/ypbind-mt_2.4.bb @@ -0,0 +1,62 @@ +# This package builds the NIS ypbind daemon +# The source package is utils/net/NIS/ypbind-mt +# +require nis.inc + +DESCRIPTION = " \ +Multithreaded NIS bind service (ypbind-mt). \ +ypbind-mt is a complete new implementation of a NIS \ +binding daemon for Linux. It has the following \ +features. Supports ypbind protocol V1 and V2. \ +Uses threads for better response. Supports multiple \ +domain bindings. Supports /var/yp/binding/* file \ +for Linux libc 4/5 and glibc 2.x. Supports a list \ +of known secure NIS server (/etc/yp.conf) Binds to \ +the server which answered as first. \ +\ +This is the final IPv4-only version of ypbind-mt. \ +" +HOMEPAGE = "http://www.linux-nis.org/nis/ypbind-mt/index.html" +DEPENDS = " \ + yp-tools \ + ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ + " +DEPENDS_append_libc-musl = " bsd-headers nss" +RDEPENDS_${PN} += "yp-tools" + +# ypbind-mt now provides all the functionality of ypbind +# and is used in place of it. +PROVIDES += "ypbind" + +SRC_URI = "http://www.linux-nis.org/download/ypbind-mt/${BP}.tar.bz2 \ + file://ypbind.init \ + file://ypbind.service \ + file://0001-dns_hosts-Fix-build-with-musl.patch \ + " +SRC_URI[md5sum] = "1aeccd0d11c064d5d59c56941bca682b" +SRC_URI[sha256sum] = "a2e1fa8fc992a12b289c229e00e38c20d59070c3bcf08babf40c692515c340e0" + +inherit systemd update-rc.d + +SYSTEMD_SERVICE_${PN} = "ypbind.service" +INITSCRIPT_NAME = "ypbind" +INITSCRIPT_PARAMS = "start 44 3 5 . stop 70 0 1 2 6 ." + +CACHED_CONFIGUREVARS = "ac_cv_prog_STRIP=/bin/true" + +CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/nss3" + +do_install_append () { + install -d ${D}${sysconfdir}/init.d + install -d ${D}${sysconfdir}/rcS.d + + install -m 0755 ${WORKDIR}/ypbind.init ${D}${sysconfdir}/init.d/ypbind + + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/ypbind.service ${D}${systemd_unitdir}/system +} + + +RPROVIDES_${PN} += "${PN}-systemd" +RREPLACES_${PN} += "${PN}-systemd" +RCONFLICTS_${PN} += "${PN}-systemd" -- cgit 1.2.3-korg