Package: hostname
Version: 3.14

Hi,

it'd be nice if it was possible to override where binaries and man pages are installed. We need this because on Fedora we install binaries into /usr/bin instead of /bin.

See attached patch.

Thanks.

--
Jiri
>From 64d23bef20fa75545ff1fbe5f9d033d707c39254 Mon Sep 17 00:00:00 2001
From: Jiri Popelka <jpope...@redhat.com>
Date: Wed, 16 Oct 2013 09:58:15 +0200
Subject: [PATCH] Make it possible to install binaries and man pages into
 custom directories.

---
 Makefile | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index aa2ed55..466e808 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,9 @@ CFLAGS+=-O2 -Wall
 # uncomment the following line if you want to install to a different base dir.
 #BASEDIR=/mnt/test
 
+BINDIR:=/bin
+MANDIR:=/usr/share/man
+
 OBJS=hostname.o
 
 hostname: $(OBJS)
@@ -13,20 +16,20 @@ hostname: $(OBJS)
 	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
-	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}/bin
-	install -o root -g root -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
+	install -d ${BASEDIR}$(MANDIR)/man1
+	install -o root -g root -m 0644 hostname.1 ${BASEDIR}$(MANDIR)/man1
+	ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/dnsdomainname.1
+	ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/domainname.1
+	ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/ypdomainname.1
+	ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/nisdomainname.1
+	#install -o root -g root -m 0644 hostname.1.fr ${BASEDIR}$(MANDIR)/fr/man1/hostname.1
+
+	install -d ${BASEDIR}$(BINDIR)
+	install -o root -g root -m 0755 hostname ${BASEDIR}$(BINDIR)
+	ln -fs hostname ${BASEDIR}$(BINDIR)/dnsdomainname
+	ln -fs hostname ${BASEDIR}$(BINDIR)/domainname
+	ln -fs hostname ${BASEDIR}$(BINDIR)/nisdomainname
+	ln -fs hostname ${BASEDIR}$(BINDIR)/ypdomainname
 
 clean:
 	-rm -f $(OBJS) hostname dnsdomainname domainname nisdomainname ypdomainname
-- 
1.8.3.1

Reply via email to