public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/musl:master commit in: sys-auth/nss-myhostname/files/, sys-auth/nss-myhostname/
@ 2017-03-29 16:47 Aric Belsito
  0 siblings, 0 replies; only message in thread
From: Aric Belsito @ 2017-03-29 16:47 UTC (permalink / raw
  To: gentoo-commits

commit:     49e02040055a673eefc1e023b2ee34e7b5526daa
Author:     Rasmus Thomsen <rasmus.thomsen <AT> live <DOT> de>
AuthorDate: Wed Mar 29 14:30:52 2017 +0000
Commit:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Wed Mar 29 16:41:40 2017 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=49e02040

sys-auth/nss-myhostname: add ebuild with musl fixes

 sys-auth/nss-myhostname/Manifest                   |  4 ++
 ...tname-Check-for-nss.h-presense-before-use.patch | 53 ++++++++++++++++++++++
 sys-auth/nss-myhostname/metadata.xml               | 22 +++++++++
 sys-auth/nss-myhostname/nss-myhostname-0.3.ebuild  | 41 +++++++++++++++++
 4 files changed, 120 insertions(+)

diff --git a/sys-auth/nss-myhostname/Manifest b/sys-auth/nss-myhostname/Manifest
new file mode 100644
index 0000000..5c37381
--- /dev/null
+++ b/sys-auth/nss-myhostname/Manifest
@@ -0,0 +1,4 @@
+AUX 0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch 1294 SHA256 d984584d03a9837f960669e217d918b17cd67d9b700e2ca65330582a8a6efabe SHA512 871d6df2bd92d7be1db99fc730e3e82f11587b4465676249187deec591bb2315057af7842ad35e01050e3cb66c63c6517ca6241fd95525376f79849252ba9eeb WHIRLPOOL e0fccded9d0cd4f5818a160548b4db9d57629fe7567deaafbb5f3e706285b6152d34d942750a5aa195153af114f4d21961c918c1e4f2489a12cec39e4410f1c9
+DIST nss-myhostname-0.3.tar.gz 330031 SHA256 2ba744ea8d578d1c57c85884e94a3042ee17843a5294434d3a7f6c4d67e7caf2 SHA512 8f14091f887991532bc3cedcdee607c89f403c7869063919c299cdd7ee8207a9759ab9105093bae151a79e08944053598104a59e9987949ee146d742a12e8c34 WHIRLPOOL 9161372c1e5dea6ea925f96fadfbb955786e812a079fea621b3c212bafe6fcbb6a20f6979d3cb474ccba73ce9e2ebdd7d51ef7f994413dcdc20fb0f1572f6d9d
+EBUILD nss-myhostname-0.3.ebuild 1108 SHA256 73798d983c2efb80c56c1e15b1473637a3a90e5d8e327a18014259dbe458d595 SHA512 7bed0928e86f89cd915a5a6bc07d914e4ad008e0336190f5e3658754edfaa43e9aec46bcf423727f3fe2a424785cb3858b9e8324be3dd7647b58e611468a2d3e WHIRLPOOL 175eb725d736263ceba568ac29ecabb0909bfa6e67071fb3f3c3f94710009c53dfd1bccf1c33910813eb7cc102ba98c7caf13b9b7bda898d205a8b848f102a1c
+MISC metadata.xml 1187 SHA256 a8ef0f975bfbb0ef1416b0a93805ce34616cd06db3ab87423213ed77803d7a15 SHA512 deb1bfd5da4994856f51f0394aa6cd3604aec1e64a707e12504a910efa7a6642fcea645fada8209d56e2cd6e748c07c95cc9b149de8fdd5704934b00eebb1587 WHIRLPOOL 33784be2734ed5fa3bca04f4bc41b5c9f1276e2fdc9322a74bcabec27479345e2b2f92b50a0c734c5d11932ffcd6c9273db26abddd561ca3b5c837bc8bde0458

diff --git a/sys-auth/nss-myhostname/files/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch b/sys-auth/nss-myhostname/files/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch
new file mode 100644
index 0000000..82f2574
--- /dev/null
+++ b/sys-auth/nss-myhostname/files/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch
@@ -0,0 +1,53 @@
+From d1345871b992f9a055c968963967e728da1a7ffb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 30 Jan 2016 20:29:06 +0000
+Subject: [PATCH] nss-myhostname: Check for nss.h presense before use
+
+We do not have nss.h on musl e.g. and configury is already checking for
+nss.h presence, use this to define needed data structures if nss.h is
+missing on a given libc implementation on a platform
+
+include stdint.h for uint32_h definition
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ nss-myhostname.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/nss-myhostname.c b/nss-myhostname.c
+index 293166c..6f287f5 100644
+--- a/nss-myhostname.c
++++ b/nss-myhostname.c
+@@ -21,7 +21,27 @@
+ ***/
+ 
+ #include <limits.h>
++#include <stdint.h>
++#ifdef HAVE_NSS_H
+ #include <nss.h>
++#else
++enum nss_status {
++    NSS_STATUS_TRYAGAIN = -2,
++    NSS_STATUS_UNAVAIL,
++    NSS_STATUS_NOTFOUND,
++    NSS_STATUS_SUCCESS,
++    NSS_STATUS_RETURN
++};
++/* Data structure used for the 'gethostbyname4_r' function.  */
++struct gaih_addrtuple
++  {
++    struct gaih_addrtuple *next;
++    char *name;
++    int family;
++    uint32_t addr[4];
++    uint32_t scopeid;
++  };
++#endif
+ #include <sys/types.h>
+ #include <netdb.h>
+ #include <errno.h>
+-- 
+2.7.0
+

diff --git a/sys-auth/nss-myhostname/metadata.xml b/sys-auth/nss-myhostname/metadata.xml
new file mode 100644
index 0000000..3016d78
--- /dev/null
+++ b/sys-auth/nss-myhostname/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+	<email>freedesktop-bugs@gentoo.org</email>
+	<name>Gentoo Freedesktop Project</name>
+</maintainer>
+<longdescription lang="en">
+nss-myhostname is a plugin for the GNU Name Service Switch (NSS) functionality
+of the GNU C Library (glibc) providing host name resolution for the locally
+configured system hostname as returned by gethostname(2). Various software
+relies on an always resolvable local host name. When using dynamic hostnames
+this is usually achieved by patching /etc/hosts at the same time as changing
+the host name. This however is not ideal since it requires a writable /etc
+file system and is fragile because the file might be edited by the
+administrator at the same time. nss-myhostname simply returns all locally
+configure public IP addresses, or -- if none are configured -- the IPv4
+address 127.0.0.2 (wich is on the local loopback) and the IPv6 address ::1
+(which is the local host) for whatever system hostname is configured locally.
+Patching /etc/hosts is thus no longer necessary.
+</longdescription>
+</pkgmetadata>

diff --git a/sys-auth/nss-myhostname/nss-myhostname-0.3.ebuild b/sys-auth/nss-myhostname/nss-myhostname-0.3.ebuild
new file mode 100644
index 0000000..e48d314
--- /dev/null
+++ b/sys-auth/nss-myhostname/nss-myhostname-0.3.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Name Service Switch module for resolving the local hostname"
+HOMEPAGE="http://0pointer.de/lennart/projects/nss-myhostname/"
+SRC_URI="http://0pointer.de/lennart/projects/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+IUSE=""
+
+COMMON_DEPEND=""
+RDEPEND="${COMMON_DEPEND}
+	!>=sys-apps/systemd-197"
+DEPEND="${COMMON_DEPEND}"
+
+src_prepare() {
+	# The documentation in doc/ is just the README file in other formats
+	sed -e 's:SUBDIRS *= *doc:SUBDIRS =:' -i Makefile.{am,in} ||
+		die "sed failed"
+	epatch "${FILESDIR}"/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch
+}
+
+src_configure() {
+	econf --disable-lynx
+}
+
+pkg_postinst() {
+	elog "You must modify your name service switch lookup file to enable"
+	elog "nss-myhostname. To do so, add 'myhostname' to the hosts line in"
+	elog "/etc/nsswitch.conf"
+	elog
+	elog "An example hosts line looks like this:"
+	elog "hosts:      files dns myhostname"
+	elog
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-29 16:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-29 16:47 [gentoo-commits] proj/musl:master commit in: sys-auth/nss-myhostname/files/, sys-auth/nss-myhostname/ Aric Belsito

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox