rpms/nss-myhostname/devel nss-myhostname.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Lennart Poettering lennart at fedoraproject.org
Sat May 23 22:01:04 UTC 2009


Author: lennart

Update of /cvs/pkgs/rpms/nss-myhostname/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16451

Modified Files:
	.cvsignore sources 
Added Files:
	nss-myhostname.spec 
Log Message:
initial commit


--- NEW FILE nss-myhostname.spec ---
Summary: glibc plugin for local system host name resolution
Name: nss-myhostname
Version: 0.2
Release: 2%{?dist}
License: LGPLv2+
URL: http://0pointer.de/lennart/projects/nss-myhostname/
Group: System Environment/Libraries
Source: http://0pointer.de/lennart/projects/nss-myhostname/nss-myhostname-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires: /sbin/ldconfig /bin/sh /bin/sed 

%description
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). A lot of software relies on that the local host name
is resolvable via DNS to an IPv4 or IPv6 address. When using dynamic
hostnames this is usually achieved by patching /etc/hosts which
however is suboptimal since it requires a writable /etc file system
and is fragile because the file might also be edited by the
administrator. nss-myhostname simply returns 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/hostname is thus no longer necessary.

%prep
%setup -q

%build
%configure --prefix=/usr --libdir=/%{_lib}
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
rm -rf $RPM_BUILD_ROOT//usr/share/doc/nss-myhostname

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/ldconfig
# sed-fu to add myhostname to the hosts line of /etc/nsswitch.conf
if [ -f /etc/nsswitch.conf ] ; then
        sed -i.bak -e '
                /^hosts:/ !b
                /\<myhostname\>/ b
                s/[[:blank:]]*$/ myhostname/
                ' /etc/nsswitch.conf
fi

%preun
# sed-fu to remove myhostname from the hosts line of /etc/nsswitch.conf
if [ "$1" -eq 0 -a -f /etc/nsswitch.conf ] ; then
        sed -i.bak -e '
                /^hosts:/ !b
                s/[[:blank:]]\+myhostname\>//
                ' /etc/nsswitch.conf
fi

%postun -p /sbin/ldconfig

%files
%defattr(-, root, root)
%doc README
%doc LICENSE
/%{_lib}/*

%changelog
* Thu Mar 19 2009 - Lennart Poettering <lpoetter at redhat.com> - 0.2-2
- Add missing dependencies

* Mon Oct 27 2008 - Lennart Poettering <lpoetter at redhat.com> - 0.2-1
- Initial packaging


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/nss-myhostname/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- .cvsignore	10 May 2009 19:17:18 -0000	1.1
+++ .cvsignore	23 May 2009 22:00:33 -0000	1.2
@@ -0,0 +1 @@
+nss-myhostname-0.2.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/nss-myhostname/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	10 May 2009 19:17:18 -0000	1.1
+++ sources	23 May 2009 22:00:33 -0000	1.2
@@ -0,0 +1 @@
+11410773db548fb50c05d996163ec1ae  nss-myhostname-0.2.tar.gz




More information about the fedora-extras-commits mailing list