This directory contains the master sources for the book "Producing Open Source Software: How to Run a Successful Free Software Project" The book is written in Docbook Lite, a scaled-down version of the Docbook DTD, used by O'Reilly & Associates. This document tells how to compile the book into a human-readable format, like HTML or PDF. Docbook ------- Docbook has a tortured, confusing history. Before you do anything, take a look at Eric Raymond's excellent "Docbook Demystification HOWTO": http://tldp.org/HOWTO/DocBook-Demystification-HOWTO/ It's very short and clears up many things. Compiling --------- 1. Fetch XSL stylesheets for Docbook and place them in tools/xsl The "Docbook Open Repository" on Sourceforge has a large collection of XSL stylesheets that specifically operate on Docbook. Download and install the latest 'docbook-xsl' package from this page: http://sourceforge.net/project/showfiles.php?group_id=21935 Download the latest version of docbook-xsl, unpack it, then rename the unpacked directory to tools/xsl, something like this: $ cd tools $ tar zxvf docbook-xsl-X.YY.Z.tar.gz $ mv docbook-xsl-X.YY.Z xsl The default build process expects to the stylesheets to be in tools/xsl/. 2. Use XSLT to transform the book. XSLT applies an .xsl stylesheet to an .xml file, and produces some new markup document. * Get libxslt, a C library for XSLT, from http://xmlsoft.org/XSLT/. (If you're having trouble finding a source package to compile, try ftp://archive.progeny.com/GNOME/sources/libxslt/1.0/.) Install it: $ tar zxvf libxslt-1.0.22.tar.gz $ cd libxslt-1.0.22 $ ./configure $ ./make # make install (Note: you may discover that you need to install libxml2 first. Find it at ftp://archive.progeny.com/GNOME/sources/libxml2/) If you don't want to compile libxslt, you can just fetch the appropriate OS binary package. * From the book directory, do make all-html This produces a monolithic HTML version in book.html. 3. Make a PDF file. Formatting Objects (FO) is a layout language, kind of like postscript, dvi or css. People are quickly standardizing on it. * Fetch FOP, a java program which converts .fo files into PDF: http://xml.apache.org/fop/index.html There are approximately 17577 ways to install FOP. Rather than describe them all, we will recommend one way. If you've already installed FOP some other way, that's fine, then you can ignore the following recipe: 1. Download the latest from http://www.apache.org/dyn/closer.cgi/xml/fop, for example, fop-0.20.4-bin.tar.gz. Just get a binary distribution, there's no need for the Java source. 2. Unpack it into tools/fop/ $ cd tools $ tar zxvf fop-0.20.4-bin.tar.gz $ mv fop-0.20.4 fop That should be enough. The Makefile will actually invoke tools/bin/run-fop.sh. That script attempts to find FOP already installed on your system, but falls back to the FOP unpacked into tools/fop/ if there's no other FOP available. Of course, to run FOP at all, you also need a Java runtime environment. Try java.sun.com or www.blackdown.org if you don't already have that. Sometimes building the book can use more memory than Java is willing to allocate by default, and you may need to increase the default heap size. With Sun's JVM, this is accomplished by passing the arguments "-Xms100m -Xmx200m" (known to work with versions 1.2.x-1.4.x, and likely different for JVMs from other vendors). To tell fop.sh about these arguments, pass them via the environment variable FOP_OPTS (which is also configurable in your ~/.foprc). $ export FOP_OPTS="-Xms100m -Xmx200m" * If you want images to be included in the PDF, you'll need to use the JIMI image processing library. Grab the latest release from http://java.sun.com/products/jimi/, then cp the jar file into the same place as the FOP jar files: $ cd tools/ $ tar zxvf jimi1_0.tar.Z $ cp Jimi/examples/AppletDemo/JimiProClasses.jar fop/lib/ Poof! You now have PNG support. * From the top directory, do make all-pdf This produces book.pdf. Hacking ------- In addition to everything above, we recommend: 1. Get a nice editing environment for SGML/XML. This isn't strictly required, but it's nice when your editor colorizes things, understands the DTD, tells you what tags you can insert, etc. If you use emacs, we recommend the PSGML major-mode. Most free operating systems package it, or its home page is here: http://www.lysator.liu.se/projects/about_psgml.html If you use vim, you might check out xmledit, at: http://www.vim.org/scripts/script.php?script_id=301 2. Get a validating parser. We recommend nsgmls, a parser written by James Clark: http://www.jclark.com/sp/nsgmls. It's nice to check that the XML you write has matching tags, and follows the DTD correctly. Here is one command you can use to validate your xml: $ SP_CHARSET_FIXED=YES SP_ENCODING=XML nsgmls -wxml \ -mdeclaration/xml.soc -ges \ /path/to/your/declaration/xml.dcl book.xml 3. Read about the DocBook lite tags. See readme-dblite.html file which describes how to write with DocBook Lite.