Skip to contentSkip to conversation

yp-tools: new package

PATCH New Jonathan Ben-Avraham 1 participant 2 messages Jan 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 yp-tools: new package

From: Jonathan Ben Avraham <[email protected]>

Adds the yp-tools package that provides various NIS (yp) utilities.

This patch is a complete re-work of previous yp-tools patches submitted by the same author in December 2015.

Previous versions of this patch have been removed from patchwork.
---
Not changed:
- I retained the mapv4v6addr.h in its entirety rather than patching nis-hosts.c as per TP's request. The reason for this is that the two files have different licensing, as explained in the comments in yp-tools.mk. I think that patching an BSD-style licensed file in in its entirety, with it's copyright and license, into a GPLv2 file is not correct policy, and extracting the map_v4v6_address from mapv4v6addr.h without the copyright and license notice is a clear violation of license.

Changes v2 -> v3:
- At TP's request, I added the 0000-remove-Wcast-align-from-configure\
.ac.patch to squelch the -Wcast-align warning that causes the ARM build to fail, instead of the original 0001-Change-do_ypcall_tr-\
param-resp-to-ypresp_val.patch that actually fixed the bug. My personal opinion is that it would have been better to leave the fix rather than to squelch the warning.

- Added Kmake comment to the Config.in regarding glibc dependency.

- Added a patch to linux-pam.mk to enable NIS support if yp-tools is selected.

- Performed menuconfig UI testing and build testing for absolute minimal configurations using the following toolchains:
- br-arm-basic-2015.11-rc1
- br-arm-full-2015.11-rc1
- br-arm-cortex-a9-musl-2015.11-rc1
- br-arm11-full-nothread-2015.11-rc1
- br-arm-full-static-2015.11-rc1
- ia32-2012.09-62-i686-pc-linux-gnu-i386-linux
- crosstool-ng GCC 5.1 arm-mxs-linux-gnueabihf
---

---
 package/Config.in                                  |    1 +
 ...0000-remove-Wcast-align-from-configure.ac.patch |   18 +++++
 package/yp-tools/Config.in                         |   15 +++++
 package/yp-tools/mapv4v6addr.h                     |   69 ++++++++++++++++++++
 package/yp-tools/yp-tools.hash                     |    2 +
 package/yp-tools/yp-tools.mk                       |   28 ++++++++
 6 files changed, 133 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 442021f..f3b4812 100644
@@ -1476,6 +1476,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 +15 -0
new file mode 100644
index 0000000..c04d1fe
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_YP_TOOLS
+	bool "yp-tools"
+	depends on BR2_TOOLCHAIN_USES_GLIBC # rpcsvc/nis.h
+	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.
+
+	  https://github.com/thkukuk/yp-tools
+
+comment "yp-tools needs an (e)glibc toolchain with rpcsvc/nis.h"
+	depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_MUSL
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 +28 -0
new file mode 100644
index 0000000..670045b
@@ -0,0 +1,28 @@
+################################################################################
+#
+# 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
+
+# If mapv4v6addr.h is not otherwise available we provide it here. It provides a
+# single function, map_v4v6_address is needed by a single yp-tools file,
+# nis-hosts.c. This mapv4v6addr.h code has BSD style licensing, whereas yp-tools
+# has GPLv2 licensing. In order not to confuse the licensing we maintain
+# mapv4v6addr.h as a separate file rather than patching the entire file with
+# it's copyright and license notice into nis-hosts.c, which is licensed under
+# GPLv2.
+
+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 v3 2/2 linux-pam: enable nis support if yp-tools selected

From: Jonathan Ben Avraham <[email protected]>

Enable the NIS support in linux-pam when the yp-tools package is selected.

---
 package/linux-pam/linux-pam.mk |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
package/linux-pam/linux-pam.mk +8 -1
index 26b627e..3d860d2 100644
@@ -11,7 +11,6 @@ LINUX_PAM_INSTALL_STAGING = YES
 LINUX_PAM_CONF_OPTS = \
 	--disable-prelude \
 	--disable-isadir \
-	--disable-nis \
 	--disable-db \
 	--disable-regenerate-docu \
 	--enable-securedir=/lib/security \
@@ -21,6 +20,14 @@ LINUX_PAM_AUTORECONF = YES
 LINUX_PAM_LICENSE = BSD-3c
 LINUX_PAM_LICENSE_FILES = Copyright
 
+ifeq ($(BR2_PACKAGE_YP_TOOLS),y)
+LINUX_PAM_CONF_OPTS += \
+	--enable-nis
+else
+LINUX_PAM_CONF_OPTS += \
+	--disable-nis
+endif
+
 ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
 LINUX_PAM_DEPENDENCIES += gettext
 LINUX_PAM_MAKE_OPTS += LIBS=-lintl
Signature · 1 line
1.7.9.5