packages: hostname/hostname-rh.patch (NEW), hostname/hostname.spec (NEW) - ...

arekm arekm at pld-linux.org
Fri Feb 11 08:28:55 CET 2011


Author: arekm                        Date: Fri Feb 11 07:28:55 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- initial from fc

---- Files affected:
packages/hostname:
   hostname-rh.patch (NONE -> 1.1)  (NEW), hostname.spec (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/hostname/hostname-rh.patch
diff -u /dev/null packages/hostname/hostname-rh.patch:1.1
--- /dev/null	Fri Feb 11 08:28:55 2011
+++ packages/hostname/hostname-rh.patch	Fri Feb 11 08:28:50 2011
@@ -0,0 +1,121 @@
+diff -up hostname/hostname.1.rh hostname/hostname.1
+--- hostname/hostname.1.rh	2010-01-15 13:05:22.000000000 +0100
++++ hostname/hostname.1	2010-02-01 21:52:35.000000000 +0100
+@@ -98,6 +98,33 @@ complete FQDN of the system is returned 
+ .B "THE FQDN"
+ below).
+ 
++.LP
++The function 
++.BR gethostname(2)
++is used to get the hostname.  When the 
++.BR "hostname \-a, \-d, \-f or \-i" 
++is called will 
++.BR gethostbyname(3)
++be called.  The difference in 
++.BR gethostname(2)
++and
++.BR gethostbyname(3)
++is that
++.BR gethostbyname(3)
++is network aware, so it consults 
++.IR /etc/nsswitch.conf
++and
++.IR /etc/host.conf
++to decide whether to read information in
++.IR /etc/sysconfig/network
++or
++.IR /etc/hosts
++
++To add another dimension to this,
++the 
++.B hostname 
++is also set when the network interface is brought up.
++
+ .SS "SET NAME"
+ When called with one argument or with the
+ .B \-\-file
+@@ -113,7 +140,7 @@ and
+ use
+ .BR setdomainname (2).
+ Note, that this is effective only until the next reboot.
+-Edit /etc/hostname for permanent change.
++After reboot original names from \fI/etc/hosts\fR are used again. 
+ .LP
+ Note, that only the super-user can change the names.
+ .LP
+@@ -124,10 +151,10 @@ command (see
+ below).
+ .LP
+ The host name is usually set once at system startup in
+-.I /etc/init.d/hostname.sh
++.I /etc/rc.d/rc.sysinit
+ (normally by reading the contents of a file which contains
+ the host name, e.g.
+-.IR /etc/hostname ).
++.IR /etc/sysconfig/network ).
+ 
+ .SS THE FQDN
+ You can't change the FQDN (as returned by
+@@ -227,7 +254,7 @@ Display the short host name. This is the
+ Print version information on standard output and exit successfully.
+ .TP
+ .I "\-v, \-\-verbose"
+-Be verbose and tell what's going on.
++Verbose output was removed.
+ .TP
+ .I "\-y, \-\-yp, \-\-nis"
+ Display the NIS domain name. If a parameter is given (or
+@@ -246,8 +273,7 @@ option in
+ .SH FILES
+ .B /etc/hosts
+ 
+-.B /etc/hostname
+-This file should only contain the hostname and not the full FQDN.
++.B /etc/sysconfig/network
+ .SH AUTHORS
+ Peter Tobias, <tobias at et-inf.fho-emden.de>
+ .br
+diff -up hostname/Makefile.rh hostname/Makefile
+--- hostname/Makefile.rh	2010-01-15 13:05:16.000000000 +0100
++++ hostname/Makefile	2010-02-01 21:47:25.000000000 +0100
+@@ -7,26 +7,28 @@ OBJS=hostname.o
+ 
+ hostname: $(OBJS)
+ 	$(CC) $(CFLAGS) -o $@ $(OBJS) -lnsl
+-	ln -fs hostname dnsdomainname
+-	ln -fs hostname domainname
+-	ln -fs hostname ypdomainname
+-	ln -fs hostname nisdomainname
+ 
+ install: hostname
+ 	install -d ${BASEDIR}/usr/share/man/man1
+-	install -o root -g root -m 0644 hostname.1 ${BASEDIR}/usr/share/man/man1
++	install -m 0644 hostname.1 ${BASEDIR}/usr/share/man/man1
+ 	ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/dnsdomainname.1
+ 	ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/domainname.1
+ 	ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/ypdomainname.1
+ 	ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/nisdomainname.1
+-	install -o root -g root -m 0644 hostname.1.fr ${BASEDIR}/usr/share/man/fr/man1/hostname.1
++	install -d ${BASEDIR}/usr/share/man/fr/man1
++	install -m 0644 hostname.1.fr ${BASEDIR}/usr/share/man/fr/man1/hostname.1
++	ln -fs hostname.1 ${BASEDIR}/usr/share/man/fr/man1/dnsdomainname.1
++	ln -fs hostname.1 ${BASEDIR}/usr/share/man/fr/man1/domainname.1
++	ln -fs hostname.1 ${BASEDIR}/usr/share/man/fr/man1/ypdomainname.1
++	ln -fs hostname.1 ${BASEDIR}/usr/share/man/fr/man1/nisdomainname.1
++
+ 
+ 	install -d ${BASEDIR}/bin
+-	install -o root -g root -m 0755 hostname ${BASEDIR}/bin
+-	ln -f hostname ${BASEDIR}/bin/dnsdomainname
+-	ln -f hostname ${BASEDIR}/bin/domainname
+-	ln -f hostname ${BASEDIR}/bin/nisdomainname
+-	ln -f hostname ${BASEDIR}/bin/ypdomainname
++	install -m 0755 hostname ${BASEDIR}/bin
++	ln -fs hostname ${BASEDIR}/bin/dnsdomainname
++	ln -fs hostname ${BASEDIR}/bin/domainname
++	ln -fs hostname ${BASEDIR}/bin/nisdomainname
++	ln -fs hostname ${BASEDIR}/bin/ypdomainname
+ 
+ clean:
+ 	-rm -f $(OBJS) hostname dnsdomainname domainname nisdomainname ypdomainname

================================================================
Index: packages/hostname/hostname.spec
diff -u /dev/null packages/hostname/hostname.spec:1.1
--- /dev/null	Fri Feb 11 08:28:55 2011
+++ packages/hostname/hostname.spec	Fri Feb 11 08:28:50 2011
@@ -0,0 +1,61 @@
+# $Revision$, $Date$
+Summary:	Utility to set/show the host name or domain name
+Name:		hostname
+Version:	3.05
+Release:	1
+License:	GPL v2+
+Group:		Base
+URL:		http://packages.qa.debian.org/h/hostname.html
+Source0:	ftp://ftp.debian.org/debian/pool/main/h/hostname/%{name}_%{version}.tar.gz
+# Source0-md5:	28f5bf5c4a494b83ca6f106bd472dcb2
+Patch1:		%{name}-rh.patch
+BuildRequires:	iconv
+Conflicts:	net-tools < 1.60-32
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This package provides commands which can be used to display the
+system's DNS name, and to display or set its hostname or NIS domain
+name.
+
+%prep
+%setup -q
+%patch1 -p1 -b .rh
+
+iconv -f iso-8859-1 -t utf-8 -o hostname.tmp hostname.1.fr && mv hostname.tmp hostname.1.fr
+
+%build
+export CFLAGS="$RPM_OPT_FLAGS $CFLAGS"
+%{__make} \
+	CC="%{__cc}" \
+	CFLAGS="%{rpmcppflags} %{rpmcflags}"
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	BASEDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc COPYRIGHT
+%attr(755,root,root) /bin/dnsdomainname
+%attr(755,root,root) /bin/domainname
+%attr(755,root,root) /bin/hostname
+%attr(755,root,root) /bin/nisdomainname
+%attr(755,root,root) /bin/ypdomainname
+%{_mandir}/man1/*.1*
+%lang(fr) %{_mandir}/fr/man1/*.1*
+
+%define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1  2011/02/11 07:28:50  arekm
+- initial from fc
+
================================================================


More information about the pld-cvs-commit mailing list