/usr/share/boost-build/tools/fop.jam is in libboost1.46-dev 1.46.1-7ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | # Copyright (C) 2003-2004 Doug Gregor and Dave Abrahams. Distributed
# under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# This module defines rules to handle generation of PDF and
# PostScript files from XSL Formatting Objects via Apache FOP
import os ;
import generators ;
import common ;
import errors ;
import boostbook ;
generators.register-standard fop.render.pdf : FO : PDF ;
generators.register-standard fop.render.ps : FO : PS ;
rule init ( fop-command ? : java-home ? : java ? )
{
fop-command = [ common.get-invocation-command fop : fop : $(fop-command)
: [ modules.peek : FOP_DIR ] ] ;
.FOP_COMMAND = $(fop-command) ;
.FOP_SETUP = ;
# JAVA_HOME is the location that java was installed to.
if $(java-home)
{
.FOP_SETUP += [ common.variable-setting-command JAVA_HOME : $(java-home) ] ;
}
# JAVACMD is the location that of the java executable, useful for a
# non-standard java installation, where the executable isn't at
# $JAVA_HOME/bin/java.
if $(java)
{
.FOP_SETUP += [ common.variable-setting-command JAVACMD : $(java) ] ;
}
# Make sure the fop command is executed from within the directory where it's located.
# DPG: I can't see how this could ever be correct, because it
# messes up path names that are used in the command.
# if $(.FOP_COMMAND:D)
# {
# .FOP_SETUP = $(.FOP_SETUP)"
# cd "$(.FOP_COMMAND:D) ;
# }
}
local rule find-by-absolute-path ( target )
{
# Mask off any vars by these names that may be hanging around in
# outer dynamic scopes.
local LOCATE SEARCH ;
# simulate the target binding process to find the target
local found = [ on $(target) GLOB $(LOCATE) (SEARCH) : $(target:G=) ] ;
if $(found)
{
# Re-LOCATE the target with an absolute path if it isn't
# already absolute.
local found-dir = $(found[1]:D) ;
local cwd = [ PWD ] ;
local absolute-dir = $(found-dir:R=$(cwd)) ;
# Translate cygwin paths to Windows iff the user is running on
# cygwin but using a Windows FOP. We detect a Windows FOP by
# looking to see if FOP_COMMAND ends with ".bat"
if [ os.name ] = CYGWIN && [ MATCH .*\\.([Bb][Aa][Tt])$ : $(.FOP_COMMAND) ]
{
absolute-dir = "`cygpath --windows '$(absolute-dir)'`" ;
}
LOCATE on $(target) = $(absolute-dir) ;
}
}
rule render.pdf ( source : target : properties * )
{
find-by-absolute-path $(source) ;
find-by-absolute-path $(target) ;
}
rule render.ps ( source : target : properties * )
{
find-by-absolute-path $(source) ;
find-by-absolute-path $(target) ;
}
actions render.pdf
{
$(.FOP_SETUP) $(.FOP_COMMAND) $(>) $(<)
}
actions render.ps
{
$(.FOP_SETUP) $(.FOP_COMMAND) $(>) -ps $(<)
}
|