From dfbd8ebea09ffe0928618d23a27ac0678d714a9c Mon Sep 17 00:00:00 2001 From: Ondrej Vasik Date: Mar 24 2009 15:03:10 +0000 Subject: Added changes to NEWS and ChangeLog, xmllint and xsltproc now checked at build time in configure, checking for missing xmllint and xsltproc in xmlto document processing git-svn-id: https://svn.fedorahosted.org/svn/xmlto@41 eb1b79c1-ba03-4820-82f3-b60cf523859b --- diff --git a/ChangeLog b/ChangeLog index 5c0e9d0..ffd4165 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,16 +1,32 @@ 2009-03-16 Ondrej Vasik * configure.in: Make tools/program paths detection - automated, new options for hardcoding those paths - and for selection of default backend - * format/xhtml1: new backends for xhtml1 source format + automated, could be overriden by envvar settings + passed to configure script. Added option for + choosing default backend and webbrowser (for + requirements) + * format/xhtml1: new backends for xhtml1 source format, + supports output formats awt, dvi, fo, mif, pcl, pdf, + ps, svg and txt + * format/*: use configured tools paths, autodetect + missing tools, correctly exit if tool is not + available * xmlto.in: fixed libpaper cleaning up(deb #491390), fixed --stringparam option functionality, xmllint validity check now uses --noent option (deb #516253), added some messages to easier detection of troubles, - use xhtml1 source format + use xhtml1 source format, consolidated error codes + (see docs), check for missing fop/dblatex and fallback + to passivetex if not found * xmlto.spec.in: split package, two subpackages added: tex subpackage for backends with passivetex requirements, - xhtml subpackage for xhtml1 source format. + xhtml subpackage for xhtml1 source format + * doc/xmlto.xml: fixed compilation warnings, documented + exit error codes and changes + * doc/xmlif.xml: fixed compilation warnings + * xmlif/* : now licensed under GPLv2+ + * various files: fixed wrong FSF address + * FAQ: Fixed obsolete informations + * Makefile.am: indentation and consolidation fixes 2008-06-20 Ondrej Vasik * configure.in: Version 0.0.21 (stable). diff --git a/NEWS b/NEWS index bf1baed..3de1341 100644 --- a/NEWS +++ b/NEWS @@ -2,17 +2,26 @@ Xmlto news ---------- 0.0.22 (stable) - added experimental support for xhtml1 source format - (output formats are dvi, fo, pdf, ps, txt) + (output formats are awt, dvi, fo, mif, pcl, pdf, ps, + svg, txt) - create tex and xhtml subpackage in spec file to reduce requirements for main package - - automated detection of programs path, new configure - options for hardcoding paths when programs not present - in configure time + - automated detection of programs path in configure, + program/utility path could be passed to configure by + variable, allowed selection of default backend and + default webbrowser (just for requirements at the moment) + - check for missing tools/programs, fail if tool is not + available - fixed libpaper cleaning up(debian #491390) - xmllint validity check now with noent option(debian #516253) - fixed --stringparam option - - added some messages to easier detection of troubles + - added some messages to easier detection of troubles, + used different error codes for various situations(see + docs) + - fixed FSF addresses, xmlif now licensed under GPLv2+ + (was GPL+, various indentation fixes, fixed documentation + compilation warnings 0.0.21 (stable) - added experimental support for dblatex(needs installed diff --git a/configure.in b/configure.in index 876f771..175a729 100644 --- a/configure.in +++ b/configure.in @@ -42,6 +42,12 @@ AC_PATH_PROG([PAPERCONF], [paperconf], [paperconf]) AC_ARG_VAR([LOCALE], [Name and path of the `locale' program.]) AC_PATH_PROG([LOCALE], [locale], [locale]) +AC_ARG_VAR([XMLLINT], [Name and path of the `xmllint' program.]) +AC_PATH_PROG([XMLLINT], [xmllint], [xmllint]) + +AC_ARG_VAR([XSLTPROC], [Name and path of the `xsltproc' program.]) +AC_PATH_PROG([XSLTPROC], [xsltproc], [xsltproc]) + dnl dnl toolchains dnl diff --git a/xmlto.in b/xmlto.in index 184bbb3..66423b3 100755 --- a/xmlto.in +++ b/xmlto.in @@ -120,6 +120,8 @@ XSLTOPTS= SEARCHPATH= PAPERCONF_PATH=@PAPERCONF@ LOCALE_PATH=@LOCALE@ +XMLLINT_PATH=@XMLLINT@ +XSLTPROC_PATH=@XSLTPROC@ # Try to setup papersize using libpaper first ... if [ -n "`which "$PAPERCONF_PATH" 2>/dev/null`" ] @@ -227,15 +229,15 @@ PDFXMLTEX_PATH=@PDFXMLTEX@ #check if we could use fop/dblatex backend as default(if not, use passivetex) if [ x"$USE_BACKEND" = xFOP ] && [ -z "`which "$FOP_PATH" 2>/dev/null`" ] then - echo >&2 Warning: fop not found or not executable. - echo >&2 Using default backend... + echo >&2 "@PACKAGE@: Warning: fop not found or not executable." + echo >&2 "@PACKAGE@: Using default backend..." USE_BACKEND=DEFAULT fi if [ x"$USE_BACKEND" = xDBLATEX ] && \ [ -z "`which "$DBLATEX_PATH" 2>/dev/null`" ] then - echo >&2 Warning: dblatex not found or not executable. - echo >&2 Using default backend... + echo >&2 "@PACKAGE@: Warning: dblatex not found or not executable." + echo >&2 "@PACKAGE@: Using default backend..." USE_BACKEND=DEFAULT fi @@ -405,7 +407,7 @@ esac # sed -e 's/^]*?>//g' -e 's/^]*>//g' -e 's/^<\([^ ]*\).*$/\1/') # Seems reasonable fix the file command and teach it to identify the DTD/Schema but this is faster to write: -rootel=$(echo "xpath *" | xmllint --shell $INPUT_FILE 2> /dev/null | head -n 3 |tail -n 1 | cut -f 4 -d " " ) +rootel=$(echo "xpath *" | "$XMLLINT_PATH" --shell "$INPUT_FILE" 2> /dev/null | head -n 3 |tail -n 1 | cut -f 4 -d " " ) case $(echo $rootel) in fo:root) @@ -435,7 +437,7 @@ then fi # Ask the format script what stylesheet to use. -XSLT_PROCESSOR=xsltproc # We only know about xsltproc right now. +XSLT_PROCESSOR="$XSLTPROC_PATH" # We only know about xsltproc right now. export XSLT_PROCESSOR export W3M_PATH export LINKS_PATH @@ -484,21 +486,30 @@ cd "$XSLT_PROCESSED_DIR" # Validate the input if [ "$SKIP_VALIDATION" -eq 0 ] && [ "$SOURCE_FORMAT" != "fo" ] then - VALIDATION="${XSLT_PROCESSED_DIR}/validation-errors" - [ "$VERBOSE" -ge 1 ] && \ - echo >&2 \ - "xmllint --noout --nonet --xinclude --postvalid --noent \"$INPUT_FILE\"" - xmllint --noout --nonet --xinclude --postvalid --noent \ - "$INPUT_FILE" 2>"${VALIDATION}" - xmllint_status=$? - if [ $xmllint_status -ne 0 ] + #do we have xmllint validation tool? + if [ -z "`which "$XMLLINT_PATH" 2>/dev/null`" ] then - echo >&2 "xmlto: input does not validate (status ${xmllint_status})" - echo >&2 "xmlto: Fix input document syntax or use --skip-validation option" - cat >&2 "${VALIDATION}" - exit $(($xmllint_status + 10)) + echo >&2 "@PACKAGE@: xmllint validation tool not found or not executable." + echo >&2 "@PACKAGE@: Skipping validation... " \ + "Please make sure xmllint is installed." + else + VALIDATION="${XSLT_PROCESSED_DIR}/validation-errors" + + [ "$VERBOSE" -ge 1 ] && \ + echo >&2 \ + "$XMLLINT_PATH --noout --nonet --xinclude --postvalid --noent \"$INPUT_FILE\"" + "$XMLLINT_PATH" --noout --nonet --xinclude --postvalid --noent "$INPUT_FILE" 2>"${VALIDATION}" + xmllint_status=$? + + if [ $xmllint_status -ne 0 ] + then + echo >&2 "@PACKAGE@: $INPUT_FILE does not validate (status ${xmllint_status})" + echo >&2 "@PACKAGE@: Fix document syntax or use --skip-validation option" + cat >&2 "${VALIDATION}" + exit $(($xmllint_status + 10)) + fi + rm -f "${VALIDATION}" fi - rm -f "${VALIDATION}" fi if [ -z "${STYLESHEET}" ] @@ -506,6 +517,14 @@ then # No stylesheet: no XSL-T processing to do. XSLT_PROCESSED="$INPUT_FILE" else + + #do we have xsltproc tool? + if [ -z "`which "$XSLTPROC_PATH" 2>/dev/null`" ] + then + echo >&2 "@PACKAGE@: Can't continue, xsltproc tool not found or not executable." + exit 3 + fi + [ "$VERBOSE" -ge 1 ] && echo >&2 "Stylesheet: ${STYLESHEET}" XSLT_PROCESSED="$XSLT_PROCESSED_DIR/$(basename "${INPUT_FILE%.*}").proc" @@ -523,14 +542,14 @@ else XSLTOPTS="$XSLTPARAMS $XSLTOPTS" [ "$VERBOSE" -ge 1 ] && \ - echo -e >&2 "xsltproc${XSLTOPTS} ${XSLTSHOWPATH}\\\\\n -o \"$XSLT_PROCESSED\" \\\\\n $STYLESHEET \\\\\n \"$INPUT_FILE\"" + echo -e >&2 "$XSLTPROC_PATH ${XSLTOPTS} ${XSLTSHOWPATH}\\\\\n -o \"$XSLT_PROCESSED\" \\\\\n $STYLESHEET \\\\\n \"$INPUT_FILE\"" if [ -z "$XSLTWITHPATH" ] then - xsltproc $XSLTOPTS -o "$XSLT_PROCESSED" "$STYLESHEET" "$INPUT_FILE" + "$XSLTPROC_PATH" $XSLTOPTS -o "$XSLT_PROCESSED" "$STYLESHEET" "$INPUT_FILE" else - xsltproc $XSLTOPTS $XSLTWITHPATH "$XSLTPATH" -o "$XSLT_PROCESSED" \ - "$STYLESHEET" "$INPUT_FILE" + "$XSLTPROC_PATH" $XSLTOPTS $XSLTWITHPATH "$XSLTPATH" \ + -o "$XSLT_PROCESSED" "$STYLESHEET" "$INPUT_FILE" fi if [ $? == 4 ] @@ -538,7 +557,7 @@ else XSLTOPTS="${XSLTOPTS} --catalogs" [ "$VERBOSE" -ge 1 ] && \ echo >&2 "No XML Catalogs? Trying again with --catalogs.." - xsltproc $XSLTOPTS -o "$XSLT_PROCESSED" "$STYLESHEET" "$INPUT_FILE" + "$XSLTPROC_PATH" $XSLTOPTS -o "$XSLT_PROCESSED" "$STYLESHEET" "$INPUT_FILE" fi if [ $? -gt 0 ]