Skip to contentSkip to conversation

yp-tools: new package

PATCH Superseded Jonathan Ben-Avraham 2 participants 4 messages Dec 23, 2015 – Dec 29, 2015

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 yp-tools: new package

From: Jonathan Ben Avraham <[email protected]>

Adds the yp-tools package that provides various NIS (yp) utilities. Runtime tested on arch arm. Built on i586.

---
 package/Config.in                                  |    1 +
 ...0000-remove-Wcast-align-from-configure.ac.patch |   18 +++++
 package/yp-tools/Config.in                         |   21 ++++++
 package/yp-tools/mapv4v6addr.h                     |   69 ++++++++++++++++++++
 package/yp-tools/yp-tools.hash                     |    2 +
 package/yp-tools/yp-tools.mk                       |   25 +++++++
 6 files changed, 136 insertions(+)
 create mode 100644 package/yp-tools/0000-remove-Wcast-align-from-configure.ac.patch
 create mode 100644 package/yp-tools/Config.in
 create mode 100644 package/yp-tools/mapv4v6addr.h
 create mode 100644 package/yp-tools/yp-tools.hash
 create mode 100644 package/yp-tools/yp-tools.mk
package/Config.in +1 -0
index de0ad5e..fb83c85 100644
@@ -1462,6 +1462,7 @@ endif
 	source "package/xinetd/Config.in"
 	source "package/xl2tp/Config.in"
 	source "package/xtables-addons/Config.in"
+	source "package/yp-tools/Config.in"
 	source "package/znc/Config.in"
 
 endmenu
package/yp-tools/0000-remove-Wcast-align-from-configure.ac.patch new file +18 -0
new file mode 100644
index 0000000..f374e12
@@ -0,0 +1,18 @@
+Remove "-Wcast-align" from the compiler warnings for compilation on arm arch.
+A patch to fix the cast-align warning was submitted to the package maintainer
+on December 16, 2015.
+
+Signed-off-by: Jonathan Ben Avraham <[email protected]>
+
+--- a/configure.ac	2015-04-16 13:08:34.000000000 +0300
++++ b/configure.ac	2015-12-23 18:38:55.358622278 +0200
+@@ -56,7 +56,7 @@
+ AM_PROG_CC_C_O
+ dnl If we're using gcc, we want warning flags
+ dnl test -n "$GCC" && WARNFLAGS="-Wall"
+-test -n "$GCC" && WARNFLAGS="-W -Wall -Wbad-function-cast -Wcast-align -Winline -Wnested-externs -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Werror"
++test -n "$GCC" && WARNFLAGS="-W -Wall -Wbad-function-cast -Winline -Wnested-externs -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Werror"
+ AC_SUBST(WARNFLAGS)
+ AC_PROG_CPP
+ AC_ISC_POSIX
+
package/yp-tools/Config.in new file +21 -0
new file mode 100644
index 0000000..dfd8203
@@ -0,0 +1,21 @@
+config BR2_PACKAGE_YP_TOOLS
+	bool "yp-tools"
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC # needs rpcsvc/nis.h
+	depends on BR2_USE_MMU
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT
+	select BR2_PACKAGE_RPCBIND # runtime
+	help
+	  The yp-tools package contains the programs domainname,
+	  nisdomainname, ypcat, ypchfn, ypchsh, ypdomainname, ypmatch,
+	  yppoll, ypset, ypwhich and yppasswd. yp-tools 3.x is a port of
+	  yp-tools 2.x to support IPv6. For this reason, it is now
+	  linked against TI-RPC. Additional, it contians a nss_nis6
+	  plugin for glibc to enable NIS lookups on clients for passwd,
+	  group, etc.
+
+	  https://github.com/thkukuk/yp-tools
+
+comment "yp-tools needs a toolchain w/ threads, RPC"
+	depends on BR2_USE_MMU
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_HAS_NATIVE_RPC
package/yp-tools/mapv4v6addr.h new file +69 -0

69 lines not on this page · raw message

package/yp-tools/yp-tools.hash new file +2 -0
new file mode 100644
index 0000000..2fdac72
@@ -0,0 +1,2 @@
+# Computed locally
+sha256 ba026ed7438fb14b82f08acbb2c1191f0d0d8031d77c1d870569ae9116ad4109 yp-tools-yp-tools-3_4.tar.gz
package/yp-tools/yp-tools.mk new file +25 -0
new file mode 100644
index 0000000..7be49ce
@@ -0,0 +1,25 @@
+################################################################################
+#
+# yp-tools
+#
+################################################################################
+
+YP_TOOLS_VERSION = yp-tools-3_4
+YP_TOOLS_SITE = $(call github,thkukuk,yp-tools,$(YP_TOOLS_VERSION))
+YP_TOOLS_LICENSE = GPLv2+
+YP_TOOLS_LICENSE_FILES = COPYING
+YP_TOOLS_AUTORECONF = YES
+YP_TOOLS_DEPENDENCIES = host-pkgconf
+YP_TOOLS_PRE_CONFIGURE_HOOKS += YP_TOOLS_LOCAL_MAPV4V6ADDR_H
+
+# mapv4v6addr.h isn't always available, depending on your build, but
+# nis-hosts.c only needs it for a single, inline function.  So drop a copy
+# here rather than playing games with the include path that would
+# potentially lead to cross-compilation issues.
+
+define YP_TOOLS_LOCAL_MAPV4V6ADDR_H
+	$(INSTALL) -D -m 0644 $(TOPDIR)/package/yp-tools/mapv4v6addr.h \
+		$(STAGING_DIR)/usr/include/resolv/mapv4v6addr.h
+endef
+
+$(eval $(autotools-package))
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 yp-tools: new package

Jonathan,

The patch title is wrong: it's a v2, not a v1. Also, there was no changelog below the "---" sign to help understand what has changed.

Quoted 6 lines · Jonathan Ben-Avraham

From: Jonathan Ben Avraham <[email protected]>

Adds the yp-tools package that provides various NIS (yp) utilities. Runtime tested on arch arm. Built on i586.

I tried to build this configuration:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2015.11-rc1-71-g90d1299.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_4_7=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_INET_RPC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_YP_TOOLS=y
# BR2_TARGET_ROOTFS_TAR is not set

and it fails to build with:

yp_get_default_domain.c:23:24: fatal error: rpcsvc/nis.h: No such file or directory

package/yp-tools/yp-tools.mk line 23

Quoted 11 lines
package/yp-tools/yp-tools.mk new file +11 -0
+YP_TOOLS_PRE_CONFIGURE_HOOKS += YP_TOOLS_LOCAL_MAPV4V6ADDR_H
+
+# mapv4v6addr.h isn't always available, depending on your build, but
+# nis-hosts.c only needs it for a single, inline function.  So drop a copy
+# here rather than playing games with the include path that would
+# potentially lead to cross-compilation issues.
+
+define YP_TOOLS_LOCAL_MAPV4V6ADDR_H
+	$(INSTALL) -D -m 0644 $(TOPDIR)/package/yp-tools/mapv4v6addr.h \
+		$(STAGING_DIR)/usr/include/resolv/mapv4v6addr.h
+endef

Instead of doing this "complicated" installation of a header file, just patch nis-tools.c to not include <mapv4v6addr.h> and instead put a copy of the needed function at the top of this file.

I would have changed it myself before applying, but since there is a build failure, it's up to you to fix it :-)

Also, you have:

select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT

but you don't depend on the gettext package, so you don't have the guarantee that it will be built before yp-tools.

Could you look into those issues and send an updated version?

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 yp-tools: new package

Quoted 10 lines · Thomas Petazzoni

Date: Mon, 28 Dec 2015 22:58:21 +0100
From: Thomas Petazzoni <[email protected]>
To: Jonathan Ben-Avraham <[email protected]>
Cc: buildroot at busybox.net
Subject: Re: [Buildroot] [PATCH 1/1 v1] yp-tools: new package

Jonathan,

The patch title is wrong: it's a v2, not a v1. Also, there was no changelog below the "---" sign to help understand what has changed.

Hi Thomas,
Do you mean a git-generated change log from the previous version of the patch to the current version of the patch?

Quoted 27 lines · Jonathan Ben-Avraham
Quoted 6 lines

From: Jonathan Ben Avraham <[email protected]>

Adds the yp-tools package that provides various NIS (yp) utilities. Runtime tested on arch arm. Built on i586.

I tried to build this configuration:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2015.11-rc1-71-g90d1299.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_4_7=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_INET_RPC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_YP_TOOLS=y
# BR2_TARGET_ROOTFS_TAR is not set

Quoted 4 lines

and it fails to build with:

yp_get_default_domain.c:23:24: fatal error: rpcsvc/nis.h: No such file or directory

What would be a good set of configs to test before submitting patches?

Quoted 16 lines

package/yp-tools/yp-tools.mk line 23

Quoted 11 lines
package/yp-tools/yp-tools.mk new file +11 -0
+YP_TOOLS_PRE_CONFIGURE_HOOKS += YP_TOOLS_LOCAL_MAPV4V6ADDR_H
+
+# mapv4v6addr.h isn't always available, depending on your build, but
+# nis-hosts.c only needs it for a single, inline function.  So drop a copy
+# here rather than playing games with the include path that would
+# potentially lead to cross-compilation issues.
+
+define YP_TOOLS_LOCAL_MAPV4V6ADDR_H
+	$(INSTALL) -D -m 0644 $(TOPDIR)/package/yp-tools/mapv4v6addr.h \
+		$(STAGING_DIR)/usr/include/resolv/mapv4v6addr.h
+endef

Instead of doing this "complicated" installation of a header file, just patch nis-tools.c to not include <mapv4v6addr.h> and instead put a copy of the needed function at the top of this file.

Quoted 2 lines

I would have changed it myself before applying, but since there is a build failure, it's up to you to fix it :-)

Ok.

Quoted 4 lines

Also, you have:

select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT

Quoted 9 lines

but you don't depend on the gettext package, so you don't have the guarantee that it will be built before yp-tools.

Could you look into those issues and send an updated version?

Thanks a lot!

Thomas

- yba

Signature · 3 lines
  9590 8E58 D30D 1660 C349  673D B205 4FC4 B8F5 B7F9  ~. .~  Tk Open Systems
=}-------- Jonathan Ben-Avraham ("yba") ----------ooO--U--Ooo------------{=
mailto:yba at tkos.co.il tel:+972.52.486.3386 http://tkos.co.il skype:benavrhm
#3 lore raw

PATCH 1/1 yp-tools: new package

Jonathan,

Quoted 2 lines · Jonathan Ben Avraham

Do you mean a git-generated change log from the previous version of the patch to the current version of the patch?

Git cannot generate such a changelog, only a human can describe the changes between two iterations of a patch (or patch series).

See
https://buildroot.org/downloads/manual/manual.html#submitting-patches
for details, and especially the section "21.5.2. Patch revision changelog".

Quoted 6 lines
Quoted 4 lines

and it fails to build with:

yp_get_default_domain.c:23:24: fatal error: rpcsvc/nis.h: No such file or directory

What would be a good set of configs to test before submitting patches?

Depends on what you want to test. From my point of view, testing with at least
http://autobuild.buildroot.org/toolchains/configs/br-arm-full.config is a strict minimum. It's a uClibc configuration for ARM, with all toolchain features enabled. If your package doesn't build with this one, it's really a no-go (and your package currently doesn't build with this one).

Then, if you don't have any toolchain feature dependency, you may want to try with
http://autobuild.buildroot.org/toolchains/configs/br-arm-basic.config,
which is the same as above, except that things like RPC, wchar, locales and al. are disabled.

If you want to verify that your package builds for noMMU platforms, you can use
http://autobuild.buildroot.org/toolchains/configs/bfin-linux-uclibc.config.

If you want to verify that your package builds without shared library support, you can use:
http://autobuild.buildroot.org/toolchains/configs/br-arm-full-static.config.

If you want to verify that your package builds without thread support, you can use:
http://autobuild.buildroot.org/toolchains/configs/br-arm-full-nothread.config.

If you want to verify that your package builds with the musl C library, you can use:
http://autobuild.buildroot.org/toolchains/configs/br-arm-cortex-a9-musl.config.

If you want to verify that your package builds with gcc 5.x, you can use:
http://autobuild.buildroot.org/toolchains/configs/br-arm-cortex-a9-glibc.config.

However, it is pointless to test *all* those combinations every time you submit a package: the autobuilder infrastructure will do it for you. However, building with the first one (ARM/uClibc/all features) is definitely something that should be tested before submitting a patch.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com