summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Rostovtsev <tetromino@gentoo.org>2012-02-08 21:46:41 +0000
committerAlexandre Rostovtsev <tetromino@gentoo.org>2012-02-08 21:46:41 +0000
commit111ffa6ebde6bcc53e7696b46796ed985d5772d5 (patch)
tree7235f3f84c025539d60b83fa138ee269bef361b0 /sys-auth/nss-myhostname
parentx86 stable per bug 402011 (diff)
downloadgentoo-2-111ffa6ebde6bcc53e7696b46796ed985d5772d5.tar.gz
gentoo-2-111ffa6ebde6bcc53e7696b46796ed985d5772d5.tar.bz2
gentoo-2-111ffa6ebde6bcc53e7696b46796ed985d5772d5.zip
New ebuild for an nss module that ensures the system's hostname is always resolvable.
(Portage version: 2.2.0_alpha84/cvs/Linux x86_64)
Diffstat (limited to 'sys-auth/nss-myhostname')
-rw-r--r--sys-auth/nss-myhostname/ChangeLog11
-rw-r--r--sys-auth/nss-myhostname/metadata.xml19
-rw-r--r--sys-auth/nss-myhostname/nss-myhostname-0.3.ebuild37
3 files changed, 67 insertions, 0 deletions
diff --git a/sys-auth/nss-myhostname/ChangeLog b/sys-auth/nss-myhostname/ChangeLog
new file mode 100644
index 000000000000..83592a8f18d5
--- /dev/null
+++ b/sys-auth/nss-myhostname/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for sys-auth/nss-myhostname
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-auth/nss-myhostname/ChangeLog,v 1.1 2012/02/08 21:46:41 tetromino Exp $
+
+*nss-myhostname-0.3 (08 Feb 2012)
+
+ 08 Feb 2012; Alexandre Rostovtsev <tetromino@gentoo.org>
+ +nss-myhostname-0.3.ebuild, +metadata.xml:
+ New ebuild for an nss module that ensures the system's hostname is always
+ resolvable.
+
diff --git a/sys-auth/nss-myhostname/metadata.xml b/sys-auth/nss-myhostname/metadata.xml
new file mode 100644
index 000000000000..1aba3db38f01
--- /dev/null
+++ b/sys-auth/nss-myhostname/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>freedesktop</herd>
+<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 000000000000..9d7ac8b9493b
--- /dev/null
+++ b/sys-auth/nss-myhostname/nss-myhostname-0.3.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-auth/nss-myhostname/nss-myhostname-0.3.ebuild,v 1.1 2012/02/08 21:46:41 tetromino Exp $
+
+EAPI="4"
+
+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="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+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"
+}
+
+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
+}