All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Documentation: allow installing man pages to a user defined directory
@ 2017-04-20 18:57 Herton R. Krzesinski
  2017-04-20 21:50 ` Jonathan Corbet
  0 siblings, 1 reply; 2+ messages in thread
From: Herton R. Krzesinski @ 2017-04-20 18:57 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: linux-doc, linux-kernel, herton

Documentation/DocBook/Makefile hard codes the prefixed path to which you
can install the built man pages (/usr/local prefix). That's unfortunate
since the user may want to install to another prefix or location (for
example, a distribution packaging the man pages may want to install to a
random temporary location in the build process).

Be flexible and allow the prefixed path to which we install man pages to be
changed with the INSTALL_MAN_PATH environment variable (and use the same
default as other similar variables like INSTALL_HDR_PATH).

Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
---
 Documentation/DocBook/Makefile | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index 164c1c7..47578e4 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -62,11 +62,14 @@ MAN := $(patsubst %.xml, %.9, $(BOOKS))
 mandocs: $(MAN)
 	find $(obj)/man -name '*.9' | xargs gzip -nf
 
+# Default location for installed man pages
+export INSTALL_MAN_PATH = $(objtree)/usr
+
 installmandocs: mandocs
-	mkdir -p /usr/local/man/man9/
+	mkdir -p $(INSTALL_MAN_PATH)/man/man9/
 	find $(obj)/man -name '*.9.gz' -printf '%h %f\n' | \
 		sort -k 2 -k 1 | uniq -f 1 | sed -e 's: :/:' | \
-		xargs install -m 644 -t /usr/local/man/man9/
+		xargs install -m 644 -t $(INSTALL_MAN_PATH)/man/man9/
 
 # no-op for the DocBook toolchain
 epubdocs:
@@ -238,7 +241,9 @@ dochelp:
 	@echo  '  psdocs          - Postscript'
 	@echo  '  xmldocs         - XML DocBook'
 	@echo  '  mandocs         - man pages'
-	@echo  '  installmandocs  - install man pages generated by mandocs'
+	@echo  '  installmandocs  - install man pages generated by mandocs to INSTALL_MAN_PATH'; \
+	 echo  '                    (default: $(INSTALL_MAN_PATH))'; \
+	 echo  ''
 	@echo  '  cleandocs       - clean all generated DocBook files'
 	@echo
 	@echo  '  make DOCBOOKS="s1.xml s2.xml" [target] Generate only docs s1.xml s2.xml'
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Documentation: allow installing man pages to a user defined directory
  2017-04-20 18:57 [PATCH] Documentation: allow installing man pages to a user defined directory Herton R. Krzesinski
@ 2017-04-20 21:50 ` Jonathan Corbet
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Corbet @ 2017-04-20 21:50 UTC (permalink / raw)
  To: Herton R. Krzesinski; +Cc: linux-doc, linux-kernel

On Thu, 20 Apr 2017 15:57:28 -0300
"Herton R. Krzesinski" <herton@redhat.com> wrote:

> Documentation/DocBook/Makefile hard codes the prefixed path to which you
> can install the built man pages (/usr/local prefix). That's unfortunate
> since the user may want to install to another prefix or location (for
> example, a distribution packaging the man pages may want to install to a
> random temporary location in the build process).
> 
> Be flexible and allow the prefixed path to which we install man pages to be
> changed with the INSTALL_MAN_PATH environment variable (and use the same
> default as other similar variables like INSTALL_HDR_PATH).

Applied, thanks.

Of course, the DocBook-based man-page generation is fading away, and we
haven't managed to put together a replacement quite yet.  Soon, I hope...

jon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-20 21:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-20 18:57 [PATCH] Documentation: allow installing man pages to a user defined directory Herton R. Krzesinski
2017-04-20 21:50 ` Jonathan Corbet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.