@matheusbsbs / matheus-bagliano / commits / 4739809cd0
Fork 0

Add support for an info version of the user manual

These patches use docbook2x in order to create an info version of the git user manual. No existing Makefile targets (including "all") are touched, so you need to explicitly say make info sudo make install-info to get git.info created and installed. If the info target directory does not already contain a "dir" file, no directory entry is created. This facilitates $(DESTDIR)-based installations. The same could be achieved with sudo make INSTALL_INFO=: install-info explicitly. perl is used for patching up sub-par file and directory information in the Texinfo file. It would be cleaner to place the respective info straight into user-manual.txt or the conversion configurations, but I find myself unable to find out how to do this with Asciidoc/Texinfo. Signed-off-by: David Kastrup <dak@gnu.org>

David Kastrup committed Aug 6, 2007 at 12:22 UTC 4739809cd0ea12a8de006f9f086fdff9285189b8
3 files changed +44 -1
Documentation/Makefile
+23 -1
@@ -44,6 +44,11 @@ INSTALL?=install
44 RM ?= rm -f
45 DOC_REF = origin/man
46
47 +infodir?=$(prefix)/share/info
48 +MAKEINFO=makeinfo
49 +INSTALL_INFO=install-info
50 +DOCBOOK2X_TEXI=docbook2x-texi
51 +
52 -include ../config.mak.autogen
53 -include ../config.mak
54
@@ -67,6 +72,8 @@ man1: $(DOC_MAN1)
72 man5: $(DOC_MAN5)
73 man7: $(DOC_MAN7)
74
75 +info: git.info
76 +
77 install: man
78 $(INSTALL) -d -m755 $(DESTDIR)$(man1dir)
79 $(INSTALL) -d -m755 $(DESTDIR)$(man5dir)
@@ -75,6 +82,14 @@ install: man
82 $(INSTALL) -m644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
83 $(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
84
85 +install-info: info
86 + $(INSTALL) -d -m755 $(DESTDIR)$(infodir)
87 + $(INSTALL) -m644 git.info $(DESTDIR)$(infodir)
88 + if test -r $(DESTDIR)$(infodir)/dir; then \
89 + $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\
90 + else \
91 + echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
92 + fi
93
94 ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
95 $(MAKE) -C ../ GIT-VERSION-FILE
@@ -110,7 +125,7 @@ cmd-list.made: cmd-list.perl $(MAN1_TXT)
125 git.7 git.html: git.txt core-intro.txt
126
127 clean:
113 - $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 howto-index.txt howto/*.html doc.dep
128 + $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 *.texi *.texi+ howto-index.txt howto/*.html doc.dep
129 $(RM) $(cmds_txt) *.made
130
131 %.html : %.txt
@@ -138,6 +153,13 @@ XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
153 user-manual.html: user-manual.xml
154 xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
155
156 +git.info: user-manual.xml
157 + $(RM) $@ $*.texi $*.texi+
158 + $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout >$*.texi+
159 + perl fix-texi.perl <$*.texi+ >$*.texi
160 + $(MAKEINFO) --no-split $*.texi
161 + $(RM) $*.texi $*.texi+
162 +
163 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
164 $(RM) $@+ $@
165 sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
Documentation/fix-texi.perl new
+15
@@ -0,0 +1,15 @@
1 +#!/usr/bin/perl -w
2 +
3 +while (<>) {
4 + if (/^\@setfilename/) {
5 + $_ = "\@setfilename git.info\n";
6 + } elsif (/^\@direntry/) {
7 + print '@dircategory Development
8 +@direntry
9 +* Git: (git). A fast distributed revision control system
10 +@end direntry
11 +'; }
12 + unless (/^\@direntry/../^\@end direntry/) {
13 + print;
14 + }
15 +}
Makefile
+6
@@ -913,6 +913,9 @@ perl/Makefile: perl/Git.pm perl/Makefile.PL GIT-CFLAGS
913 doc:
914 $(MAKE) -C Documentation all
915
916 +info:
917 + $(MAKE) -C Documentation info
918 +
919 TAGS:
920 $(RM) TAGS
921 $(FIND) . -name '*.[hcS]' -print | xargs etags -a
@@ -1005,6 +1008,9 @@ endif
1008 install-doc:
1009 $(MAKE) -C Documentation install
1010
1011 +install-info:
1012 + $(MAKE) -C Documentation install-info
1013 +
1014 quick-install-doc:
1015 $(MAKE) -C Documentation quick-install
1016