14

I am trying to install Git on Mac OS X Leopard. I'm trying to avoid the MacPorts/Fink route. I'm also trying to avoid the installer on Google because I've gotten very far on my own, but if I have to I'll go ahead and download the installer.

Anyway, I have Git installed. /usr/local/bin/git. The problem is that none of the documentation installed, and the Makefile never bothered to tell me that. So now I have Git sitting around waiting to be used as I try to install the manpages for it.

For some awful reason, the manpages are maintained as text files, which are to be processed by the AsciiDoc program, which I promptly installed. But AsciiDoc converts these text files to XML.

Then Git uses another program called xmlto to convert the XML that AsciiDoc spits out to manpages (I think - I haven't gotten that far yet). The problem is that I get this error whenever it starts that step (first line is output from make, rest is error):

 XMLTO git-apply.1 I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd /Users/chrislutz/prog/sources/git-1.6.3.1/Documentation/git-apply.xml:2: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" D DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" 

So basically it just goes through every file and gives me that error for all of them.

I did try at one point to download the file http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd, put it in the directory, and then changed all the references in the XML files to the file in the directory, but this gave me more and stranger errors. If I got a regular solution to work, it might still give me those stranger errors, which means the whole thing is screwed and that I'll just use the Google installer.

However, I've gotten (stumbled) this far on my own, and I feel like this is one last step before a sigh of relief and the chance to use Git. So I want to make a last-ditch effort to understand what's wrong. And "last-ditch effort" means "Ask Stack Overflow."

So if anyone could give me any insight as to what that error means and why it's occuring (and what I might be able to do to fix it), that would be awesome. If not, I'll try the Google installer.

8 Answers 8

12

I recently installed git-1.6.4.2 on CentOS 5.3. Building git was no trouble, but attempting to install the accompanying docs produced pain at every step. The versions of xmlto and asciidoc from the yum repos were old, so I built them from source. Then xmlto (by way of xmllint) complained about missing DocBook 4.5, and I finally managed to get those in manually.

Getting this far, the doc build trundles happily along until

 DB2TEXI user-manual.texi /bin/sh: line 1: docbook2x-texi: command not found make[1]: *** [user-manual.texi] Error 127

But docbook2x is installed! Ah, the command is different:

$ rpm -q --filesbypkg docbook2x | grep bin.\*texi docbook2x /usr/bin/db2x_docbook2texi docbook2x /usr/bin/db2x_texixml

Even trying to run it manually, I still find no joy:

$ db2x_docbook2texi user-manual.xml --encoding=UTF-8 --to-stdout >user-manual.texi++ docbook2texi:/book: no description for directory entry /usr/bin/db2x_texixml:-::node: fatal error: node belongs to a different file Died at /usr/bin/db2x_texixml line 959.

The bottom of INSTALL mentions a couple of handy make targets: quick-install-man and quick-install-html. It turns, for example, out that

$ make prefix=/usr/local quick-install-man

is equivalent to

$ ./Documentation/install-doc-quick.sh origin/man /usr/local/share/man

That has a couple of problems: we need a git repo to use these targets, and the heads of the man and html branches may not correspond to the version you're installing.

So, a quick-and-dirty bootstrap:

tar xfz git-1.6.4.2.tar.gz cd git-1.6.4.2 make prefix=/usr/local all sudo make prefix=/usr/local install # (1) cd .. git clone git://git.kernel.org/pub/scm/git/git.git cd git git checkout v1.6.4.2 # (2) # (3) ./Documentation/install-doc-quick.sh \ c8b9e605d51dd2f0c7ce6a363df31171af16534c \ /usr/local/share/man # (4) ./Documentation/install-doc-quick.sh \ 35b47ca5285a4059792ba937f8e09b2ab4a7adf4 \ /usr/local/share/doc/git-doc git init --help # (5)

Notes:

  1. At this point, git will live in /usr/local/bin.
  2. Now you'll have the same tree as the previous step on a detached head.
  3. The SHA-1 comes from the last 1.6.4.2 commit in git log origin/man.
  4. Same as above, except from origin/html.
  5. Profit!
Sign up to request clarification or add additional context in comments.

Comments

9

Maybe not the answer you want, but you could just download the git-manpages-*.tar.gz and git-html-*.tar.gz that are published along with the source. They're published because the asciidoc toolchain is known to be a bit fragile, and a considerable effort to get everything installed and arranged.

You'd need, I believe, possibly a whole pack of docbook support files. Maybe some stylesheets as well... although if you have xmlto installed you should have got all these.

2 Comments

At this point, the answer I want is the answer that works best. I didn't want to have to reinstall Git just to get the manpages, and this worked perfectly. I wish I had checked their index sooner. In short, thank you!
araqnid, the name of the HTML documentation archive is actually git-htmldocs-*.tar.gz, not git-html-*tar.gz. (See kernel.org/pub/software/scm/git/.) Perhaps the Git repository maintainers renamed the files since you wrote your answer.
4

I was driven to this question when I googled for "docbook2x-texi: command not found" because I had this issue while building git 1.8.2.1 obtained from the git repository, with:

make prefix=/my_prefix/git all doc info 

So, following http://git-scm.com/book/en/Getting-Started-Installing-Git I launched:

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel 

but for the make to complete I had to install the next packages:

yum install asciidoc xmlto docbook2X 

As pointed out by the most read answer, the last provides the db2x_docbook2texicommand but not the needed docbook2x-texi. Nevertheless, a simple symbolic link solved the issue:

ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi 

Now, the make was successful and I got to install git with:

make prefix=/my_prefix/git install install-doc install-html install-info 

This workaround was tested under Scientific Linux 6.1 (Carbon).

2 Comments

Thankyou, this is very helpful. On Mac OS X 10.5.8, the paths would be ln -s /usr/local/bin/db2x_docbook2texi /usr/local/bin/docbook2x-texi
Thank you, thank you! The symbolic link you mentioned allowed Git to be installed on my CentOS 6.x.
3

Wincent Colaiuta maintains a very useful knowledge base at wincent.com/wiki which is an excellent source of information on git on Mac OS X.

In particular, see these two articles:

1 Comment

It's kind of depressing to know how close I was. I got all the way to the last step on my own and then gave up.
2

I just found this nice solution to the Git manpages chain problem on OS X. For convenience, here it is (replace: git-manpages-1.6.6.tar.bz2 with your version of git, and /usr/local/ to wherever your git is installed):

$ curl -O http://kernel.org/pub/software/scm/git/git-manpages-1.6.6.tar.bz2 $ sudo tar xvf git-manpages-1.6.6.tar.bz2 -C /usr/local/man 

Then, (as Boblet points out), check for the git manpath:

echo $MANPATH 

and adjust if necessary:

Comments

0

Random thought; where are your Git manpages installed? I’m guessing in /usr/local/git/man. If so, check that this is in your $MANPATH:

echo $MANPATH 

If you don’t have the git manpath in there, add this text via TextMate or vi or something to wherever you’ve got your $PATH (eg in ~/.bash_profile);

export MANPATH=/usr/local/git/man:$MANPATH 

Alternatively just use this command from the shell:

echo 'export MANPATH=/usr/local/git/man:$MANPATH' >> ~/.bash_profile 

Just had this problem myself after doing the Hivelogic Snow Leopard install, so HTH

Comments

0

If you're working from a clone of the git source repository, you can do something like this:

git archive origin/man | sudo tar -x -C /usr/local/share/man 

Found at http://johnreilly.tumblr.com/post/41241198/installing-git-man-pages - I've been using it for some time now, and it Just Works very well.

Comments

0

I was having a similar build issue on Cygwin earlier this week (failure on attempt to load network entity), and through a bit of hunting I was able to find that the problem was the lack of an xml-catalog. On Cygwin there's a script named build-docbook-catalog. The tool was probably trying to run automatically, but when I ran it manually, it was failing due to the /etc/xml directory not existing.

The source for build-docbook-catalog is probably here, but I can't confirm that right now since I don't have Windows or Cygwin available.

I realize that this question has been long since answered, but I did stumble upon this page while looking for an answer to my problem, so hopefully this saves some time for someone else.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.