Gentoo Archives: gentoo-commits

From: Aric Belsito <lluixhi@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: sys-auth/nss-myhostname/files/, sys-auth/nss-myhostname/
Date: Wed, 29 Mar 2017 16:47:57
Message-Id: 1490805700.49e02040055a673eefc1e023b2ee34e7b5526daa.lluixhi@gentoo
1 commit: 49e02040055a673eefc1e023b2ee34e7b5526daa
2 Author: Rasmus Thomsen <rasmus.thomsen <AT> live <DOT> de>
3 AuthorDate: Wed Mar 29 14:30:52 2017 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Wed Mar 29 16:41:40 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=49e02040
7
8 sys-auth/nss-myhostname: add ebuild with musl fixes
9
10 sys-auth/nss-myhostname/Manifest | 4 ++
11 ...tname-Check-for-nss.h-presense-before-use.patch | 53 ++++++++++++++++++++++
12 sys-auth/nss-myhostname/metadata.xml | 22 +++++++++
13 sys-auth/nss-myhostname/nss-myhostname-0.3.ebuild | 41 +++++++++++++++++
14 4 files changed, 120 insertions(+)
15
16 diff --git a/sys-auth/nss-myhostname/Manifest b/sys-auth/nss-myhostname/Manifest
17 new file mode 100644
18 index 0000000..5c37381
19 --- /dev/null
20 +++ b/sys-auth/nss-myhostname/Manifest
21 @@ -0,0 +1,4 @@
22 +AUX 0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch 1294 SHA256 d984584d03a9837f960669e217d918b17cd67d9b700e2ca65330582a8a6efabe SHA512 871d6df2bd92d7be1db99fc730e3e82f11587b4465676249187deec591bb2315057af7842ad35e01050e3cb66c63c6517ca6241fd95525376f79849252ba9eeb WHIRLPOOL e0fccded9d0cd4f5818a160548b4db9d57629fe7567deaafbb5f3e706285b6152d34d942750a5aa195153af114f4d21961c918c1e4f2489a12cec39e4410f1c9
23 +DIST nss-myhostname-0.3.tar.gz 330031 SHA256 2ba744ea8d578d1c57c85884e94a3042ee17843a5294434d3a7f6c4d67e7caf2 SHA512 8f14091f887991532bc3cedcdee607c89f403c7869063919c299cdd7ee8207a9759ab9105093bae151a79e08944053598104a59e9987949ee146d742a12e8c34 WHIRLPOOL 9161372c1e5dea6ea925f96fadfbb955786e812a079fea621b3c212bafe6fcbb6a20f6979d3cb474ccba73ce9e2ebdd7d51ef7f994413dcdc20fb0f1572f6d9d
24 +EBUILD nss-myhostname-0.3.ebuild 1108 SHA256 73798d983c2efb80c56c1e15b1473637a3a90e5d8e327a18014259dbe458d595 SHA512 7bed0928e86f89cd915a5a6bc07d914e4ad008e0336190f5e3658754edfaa43e9aec46bcf423727f3fe2a424785cb3858b9e8324be3dd7647b58e611468a2d3e WHIRLPOOL 175eb725d736263ceba568ac29ecabb0909bfa6e67071fb3f3c3f94710009c53dfd1bccf1c33910813eb7cc102ba98c7caf13b9b7bda898d205a8b848f102a1c
25 +MISC metadata.xml 1187 SHA256 a8ef0f975bfbb0ef1416b0a93805ce34616cd06db3ab87423213ed77803d7a15 SHA512 deb1bfd5da4994856f51f0394aa6cd3604aec1e64a707e12504a910efa7a6642fcea645fada8209d56e2cd6e748c07c95cc9b149de8fdd5704934b00eebb1587 WHIRLPOOL 33784be2734ed5fa3bca04f4bc41b5c9f1276e2fdc9322a74bcabec27479345e2b2f92b50a0c734c5d11932ffcd6c9273db26abddd561ca3b5c837bc8bde0458
26
27 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
28 new file mode 100644
29 index 0000000..82f2574
30 --- /dev/null
31 +++ b/sys-auth/nss-myhostname/files/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch
32 @@ -0,0 +1,53 @@
33 +From d1345871b992f9a055c968963967e728da1a7ffb Mon Sep 17 00:00:00 2001
34 +From: Khem Raj <raj.khem@×××××.com>
35 +Date: Sat, 30 Jan 2016 20:29:06 +0000
36 +Subject: [PATCH] nss-myhostname: Check for nss.h presense before use
37 +
38 +We do not have nss.h on musl e.g. and configury is already checking for
39 +nss.h presence, use this to define needed data structures if nss.h is
40 +missing on a given libc implementation on a platform
41 +
42 +include stdint.h for uint32_h definition
43 +
44 +Signed-off-by: Khem Raj <raj.khem@×××××.com>
45 +---
46 +Upstream-Status: Pending
47 +
48 + nss-myhostname.c | 20 ++++++++++++++++++++
49 + 1 file changed, 20 insertions(+)
50 +
51 +diff --git a/nss-myhostname.c b/nss-myhostname.c
52 +index 293166c..6f287f5 100644
53 +--- a/nss-myhostname.c
54 ++++ b/nss-myhostname.c
55 +@@ -21,7 +21,27 @@
56 + ***/
57 +
58 + #include <limits.h>
59 ++#include <stdint.h>
60 ++#ifdef HAVE_NSS_H
61 + #include <nss.h>
62 ++#else
63 ++enum nss_status {
64 ++ NSS_STATUS_TRYAGAIN = -2,
65 ++ NSS_STATUS_UNAVAIL,
66 ++ NSS_STATUS_NOTFOUND,
67 ++ NSS_STATUS_SUCCESS,
68 ++ NSS_STATUS_RETURN
69 ++};
70 ++/* Data structure used for the 'gethostbyname4_r' function. */
71 ++struct gaih_addrtuple
72 ++ {
73 ++ struct gaih_addrtuple *next;
74 ++ char *name;
75 ++ int family;
76 ++ uint32_t addr[4];
77 ++ uint32_t scopeid;
78 ++ };
79 ++#endif
80 + #include <sys/types.h>
81 + #include <netdb.h>
82 + #include <errno.h>
83 +--
84 +2.7.0
85 +
86
87 diff --git a/sys-auth/nss-myhostname/metadata.xml b/sys-auth/nss-myhostname/metadata.xml
88 new file mode 100644
89 index 0000000..3016d78
90 --- /dev/null
91 +++ b/sys-auth/nss-myhostname/metadata.xml
92 @@ -0,0 +1,22 @@
93 +<?xml version="1.0" encoding="UTF-8"?>
94 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
95 +<pkgmetadata>
96 +<maintainer type="project">
97 + <email>freedesktop-bugs@g.o</email>
98 + <name>Gentoo Freedesktop Project</name>
99 +</maintainer>
100 +<longdescription lang="en">
101 +nss-myhostname is a plugin for the GNU Name Service Switch (NSS) functionality
102 +of the GNU C Library (glibc) providing host name resolution for the locally
103 +configured system hostname as returned by gethostname(2). Various software
104 +relies on an always resolvable local host name. When using dynamic hostnames
105 +this is usually achieved by patching /etc/hosts at the same time as changing
106 +the host name. This however is not ideal since it requires a writable /etc
107 +file system and is fragile because the file might be edited by the
108 +administrator at the same time. nss-myhostname simply returns all locally
109 +configure public IP addresses, or -- if none are configured -- the IPv4
110 +address 127.0.0.2 (wich is on the local loopback) and the IPv6 address ::1
111 +(which is the local host) for whatever system hostname is configured locally.
112 +Patching /etc/hosts is thus no longer necessary.
113 +</longdescription>
114 +</pkgmetadata>
115
116 diff --git a/sys-auth/nss-myhostname/nss-myhostname-0.3.ebuild b/sys-auth/nss-myhostname/nss-myhostname-0.3.ebuild
117 new file mode 100644
118 index 0000000..e48d314
119 --- /dev/null
120 +++ b/sys-auth/nss-myhostname/nss-myhostname-0.3.ebuild
121 @@ -0,0 +1,41 @@
122 +# Copyright 1999-2014 Gentoo Foundation
123 +# Distributed under the terms of the GNU General Public License v2
124 +
125 +EAPI="4"
126 +
127 +inherit eutils
128 +
129 +DESCRIPTION="Name Service Switch module for resolving the local hostname"
130 +HOMEPAGE="http://0pointer.de/lennart/projects/nss-myhostname/"
131 +SRC_URI="http://0pointer.de/lennart/projects/${PN}/${P}.tar.gz"
132 +
133 +LICENSE="LGPL-2.1+"
134 +SLOT="0"
135 +KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
136 +IUSE=""
137 +
138 +COMMON_DEPEND=""
139 +RDEPEND="${COMMON_DEPEND}
140 + !>=sys-apps/systemd-197"
141 +DEPEND="${COMMON_DEPEND}"
142 +
143 +src_prepare() {
144 + # The documentation in doc/ is just the README file in other formats
145 + sed -e 's:SUBDIRS *= *doc:SUBDIRS =:' -i Makefile.{am,in} ||
146 + die "sed failed"
147 + epatch "${FILESDIR}"/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch
148 +}
149 +
150 +src_configure() {
151 + econf --disable-lynx
152 +}
153 +
154 +pkg_postinst() {
155 + elog "You must modify your name service switch lookup file to enable"
156 + elog "nss-myhostname. To do so, add 'myhostname' to the hosts line in"
157 + elog "/etc/nsswitch.conf"
158 + elog
159 + elog "An example hosts line looks like this:"
160 + elog "hosts: files dns myhostname"
161 + elog
162 +}