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
|
#!/bin/bash
#
# Copyright (C) 2012-2020 SUSE, LLC
#
# Authors:
# Frank Sundermeyer <fsundermeyer at opensuse dot org>
# Thomas Schraitle <toms at opensuse dot org>
#
#
# Customized fop executable for DAPS
# Command line switches for FOP
#------------------------------
#
# enable quiet mode, unless --debug is used
[[ 1 != "$DEBUG" ]] && FOP_DEFAULT_CMD_OPTIONS="-q"
# Get the first 2 digits from the version number
# 1.0 -> 10, 1.0.1 -> 10
FOP_VERSION=$(fop -version 2>/dev/null | cut -d " " -f 3 | tr -d ".")
FOP_VERSION=${FOP_VERSION:0:2}
# Other fop command-line options can be set with FOP_OPTIONS in the
# daps config
#FOP_CONFIG_FILE=${FOP_CONFIG_FILE:-"/etc/daps/fop/fop-daps.xml"}
if [[ -n $FOP_CONFIG_FILE ]]; then
FOP_CMD_SWITCHES="$FOP_DEFAULT_CMD_OPTIONS -c $FOP_CONFIG_FILE $FOP_CMD_OPTIONS"
else
FOP_CMD_SWITCHES="$FOP_DEFAULT_CMD_OPTIONS $FOP_CMD_OPTIONS"
fi
# override the following by exporting FOP_STACKSIZE / FOP_MEMORY
# with different values
#
# set java thread stack size
FOP_STACKSIZE=${FOP_STACKSIZE:-"-Xss2048K"}
# set initial/maximum java heap size
FOP_MEMORY=${FOP_MEMORY:-"-Xms256m -Xmx2048m"} # min - max
# Default JAVA/FOP setup for FOP needed by DAPS
# ----------------------------------------------
# do not change
# To add additional flags/jars/options use
#
# FOP_JAVA_FLAGS
# FOP_JAVA_JARS
# FOP_JAVA_OPTIONS
#
# in the config. These values will be used in addition to the default values
# specified below
#
FOP_DEFAULT_JAVA_FLAGS="-Djavax.xml.transform.URIResolver=org.apache.xml.resolver.tools.CatalogResolver -Djava.util.logging.config.file=${DAPSROOT}/etc/fop/fop_logging.properties"
FOP_DEFAULT_JAVA_JARS="batik-all avalon-framework"
FOP_DEFAULT_JAVA_OPTIONS="$FOP_MEMORY $FOP_STACKSIZE"
# Call /usr/bin/fop
#
ADDITIONAL_FLAGS="$FOP_DEFAULT_JAVA_FLAGS $FOP_JAVA_FLAGS" \
ADDITIONAL_JARS="$FOP_DEFAULT_JAVA_JARS $FOP_JAVA_JARS" \
ADDITIONAL_OPTIONS="$FOP_DEFAULT_JAVA_OPTIONS $FOP_JAVA_OPTIONS" \
fop $FOP_CMD_SWITCHES "$@"
|