Commits

Katsunori FUJIWARA committed 5845d2f

introduce "java_envs"/"fop_envs" files for flexibility

current configuration for java/fop by "Makefile.vars" forces related
libraries to:

- be placed under "$(JAVA_LIB)"
- be named as fixed (e.g.: "saxon65.jar")

this prevents package based system from building document artifacts.

"java_envs" and "fop_envs" allows users to configure more flexibly.

  • Participants
  • Parent commits 93154fb

Comments (0)

Files changed (6)

 .run
 .validated-00book.xml
 Makefile.vars
+fop_envs
+java_envs
 build
 en/all-ids.dat
 en/complete.xml
 
 build/$(LINGUA)/pdf/hgbook.pdf: build/$(LINGUA)/source/hgbook.xml stylesheets/fo.xsl stylesheets/$(LINGUA)/fo.xsl
 	mkdir -p build/$(LINGUA)/pdf
-	java -classpath $(JAVA_LIB)/saxon65.jar:$(JAVA_LIB)/saxon65-dbxsl.jar:$(JAVA_LIB)/xml-commons-resolver-1.2.jar:$(JAVA_LIB) \
+	. java_envs \
 	    com.icl.saxon.StyleSheet \
 	    -x org.apache.xml.resolver.tools.ResolvingXMLReader \
 	    -y org.apache.xml.resolver.tools.ResolvingXMLReader \
 	    build/$(LINGUA)/source/hgbook.xml \
 	    stylesheets/$(LINGUA)/fo.xsl \
 	    fop1.extensions=1
-
-	(cd build/$(LINGUA)/source && $(FOP_HOME)/fop.sh -c $(FOP_HOME)/conf/userconfig.xml hgbook.fo ../pdf/hgbook.pdf)
+	(cd build/$(LINGUA)/source && . ../../../fop_envs hgbook.fo ../pdf/hgbook.pdf)
 endif
 
 $(LINGUA)/figs/%.png: $(LINGUA)/figs/%.svg 

Makefile.vars.tmpl

 PO4A_HOME=/home/dongsheng/vcs/svn/i18n-zh/trunk/lib/po4a
 PO4A_LIB=$(PO4A_HOME)/lib
 
-# saxon65.jar, saxon65-dbxsl.jar, xml-commons-resolver-1.2.jar: Only for pdf format !
-JAVA_LIB=/home/dongsheng/vcs/svn/i18n-zh/trunk/lib/share/java
-
-# fop (>= 0.9.6): Only for pdf format !
-FOP_HOME=/home/dongsheng/vcs/svn/i18n-zh/trunk/lib/fop
-
 # docbook-xsl (>= 1.74.3): Only for ePub format !
 DB2EPUB=/home/dongsheng/vcs/svn/i18n-zh/trunk/lib/docbook/docbook-xsl/epub/bin/dbtoepub
   care about it.
 
   For pdf output, we need use the xsl extensions (docbook-xsl-saxon), so we must
-  create file $JAVA_LIB/CatalogManager.properties like this:
+  create file "CatalogManager.properties" like this:
 
       catalogs=/etc/xml/catalog
       relative-catalogs=true
       catalog-class-name=org.apache.xml.resolver.Resolver
       verbosity=1
 
-6. Create Makefile.vars
-  Please create your Makefile.vars from Makefile.vars.tmpl .
+  This file will be pointed by "java_envs" described below.
+
+6. Create "Makefile.vars", "java_envs" and "fop_envs"
+  Please create your customized files from each templates:
+
+    - "Makefile.vars" from "Makefile.vars.tmpl"
+    - "java_envs" from "java_envs.tmpl"(for PDF only)
+    - "fop_envs" from "fop_envs.tmpl"(for PDF only)
 
 7. Make
   Run 'make' for more details, for example:
+#### specify which java command you want to invoke,
+#### and your custom options if needed(e.g.: "-c conf/userconfig.xml")
+FOP=/path/to/your/fop
+# FOP="/path/to/your/fop -c conf/userconfig.xml"
+
+#### if you use "fop" command already installed on your system,
+#### you may have to specify CLASSPATH for libraries which "fop" requires.
+#### if so, please specify CLASSPATH explicitly here
+# CLASSPATH=......
+# export CLASSPATH
+
+########################################
+
+#### to show configurations on compilation
+echo "#### DEBUG: ${FOP} $*"
+
+exec ${FOP} $*
+#### path to JARS of "saxon"
+SAXON_JARS=/usr/share/java/saxon.jar:/usr/share/java/saxon-jdom.jar
+
+#### path to JARS of "docbook-xsl-saxon"
+DOCBOOK_XSL_JARS=/usr/share/java/docbook-xsl-saxon.jar
+
+#### path to JARS of "xml-commons-resolver-1.1"
+RESOLVER_JARS=/usr/share/java/xml-commons-resolver-1.1.jar
+
+#### path to the directory containing "CatalogManager.properties"
+#### (ATTENTION: not "CatalogManager.properties" itself)
+CATALOGMANAGER_PATH=/path/to/directory
+
+#### concatenation of above paths (and your custom classpath, if needed)
+CLASSPATH=${SAXON_JARS}:${DOCBOOK_XSL_JARS}:${RESOLVER_JARS}:${CATALOGMANAGER_PATH}
+
+#### specify which java command you want to invoke (and your custom options)
+JAVA=java
+
+########################################
+
+#### to show configurations on compilation
+echo "#### DEBUG: ${JAVA} -classpath ${CLASSPATH} $*"
+
+exec ${JAVA} -classpath ${CLASSPATH} $*