Blame SOURCES/hostname-rh.patch

4834dd
diff -up hostname/hostname.1.rh hostname/hostname.1
4834dd
--- hostname/hostname.1.rh	2012-12-06 16:18:46.000000000 +0100
4834dd
+++ hostname/hostname.1	2013-03-26 12:39:24.303468313 +0100
4834dd
@@ -84,6 +84,28 @@ complete FQDN of the system is returned
4834dd
 .B "THE FQDN"
4834dd
 below).
4834dd
 
4834dd
+.LP
4834dd
+The function 
4834dd
+.BR gethostname(2)
4834dd
+is used to get the hostname.  When the 
4834dd
+.BR "hostname \-a, \-d, \-f or \-i" 
4834dd
+is called will 
4834dd
+.BR gethostbyname(3)
4834dd
+be called.  The difference in 
4834dd
+.BR gethostname(2)
4834dd
+and
4834dd
+.BR gethostbyname(3)
4834dd
+is that
4834dd
+.BR gethostbyname(3)
4834dd
+is network aware, so it consults 
4834dd
+.IR /etc/nsswitch.conf
4834dd
+and
4834dd
+.IR /etc/host.conf
4834dd
+to decide whether to read information in
4834dd
+.IR /etc/hostname
4834dd
+or
4834dd
+.IR /etc/hosts
4834dd
+
4834dd
 .SS "SET NAME"
4834dd
 When called with one argument or with the
4834dd
 .B \-\-file
4834dd
@@ -109,8 +131,7 @@ command (see
4834dd
 .B "THE FQDN"
4834dd
 below).
4834dd
 .LP
4834dd
-The host name is usually set once at system startup in
4834dd
-.I /etc/init.d/hostname.sh
4834dd
+The host name is usually set once at system startup
4834dd
 (normally by reading the contents of a file which contains
4834dd
 the host name, e.g.
4834dd
 .IR /etc/hostname ).
4834dd
diff -up hostname/Makefile.rh hostname/Makefile
4834dd
--- hostname/Makefile.rh	2012-02-16 16:00:52.000000000 +0100
4834dd
+++ hostname/Makefile	2013-03-26 12:39:24.303468313 +0100
4834dd
@@ -3,30 +3,29 @@ CFLAGS+=-O2 -Wall
4834dd
 # uncomment the following line if you want to install to a different base dir.
4834dd
 #BASEDIR=/mnt/test
4834dd
 
4834dd
+BINDIR:=/bin
4834dd
+
4834dd
 OBJS=hostname.o
4834dd
 
4834dd
 hostname: $(OBJS)
4834dd
 	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) -lnsl
4834dd
-	ln -fs hostname dnsdomainname
4834dd
-	ln -fs hostname domainname
4834dd
-	ln -fs hostname ypdomainname
4834dd
-	ln -fs hostname nisdomainname
4834dd
 
4834dd
 install: hostname
4834dd
 	install -d ${BASEDIR}/usr/share/man/man1
4834dd
-	install -o root -g root -m 0644 hostname.1 ${BASEDIR}/usr/share/man/man1
4834dd
+	install -m 0644 hostname.1 ${BASEDIR}/usr/share/man/man1
4834dd
+
4834dd
 	ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/dnsdomainname.1
4834dd
 	ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/domainname.1
4834dd
 	ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/ypdomainname.1
4834dd
 	ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/nisdomainname.1
4834dd
 	#install -o root -g root -m 0644 hostname.1.fr ${BASEDIR}/usr/share/man/fr/man1/hostname.1
4834dd
 
4834dd
-	install -d ${BASEDIR}/bin
4834dd
-	install -o root -g root -m 0755 hostname ${BASEDIR}/bin
4834dd
-	ln -f hostname ${BASEDIR}/bin/dnsdomainname
4834dd
-	ln -f hostname ${BASEDIR}/bin/domainname
4834dd
-	ln -f hostname ${BASEDIR}/bin/nisdomainname
4834dd
-	ln -f hostname ${BASEDIR}/bin/ypdomainname
4834dd
+	install -d ${BASEDIR}$(BINDIR)
4834dd
+	install -m 0755 hostname ${BASEDIR}$(BINDIR)
4834dd
+	ln -fs hostname ${BASEDIR}$(BINDIR)/dnsdomainname
4834dd
+	ln -fs hostname ${BASEDIR}$(BINDIR)/domainname
4834dd
+	ln -fs hostname ${BASEDIR}$(BINDIR)/nisdomainname
4834dd
+	ln -fs hostname ${BASEDIR}$(BINDIR)/ypdomainname
4834dd
 
4834dd
 clean:
4834dd
 	-rm -f $(OBJS) hostname dnsdomainname domainname nisdomainname ypdomainname