reenable noent switch - bug is on lcdproc doc side, add xhtml support (as

subpackage) (#145140)
This commit is contained in:
Ondrej Vasik 2009-03-16 13:59:14 +00:00
parent f1b85f7932
commit 0c27b2a0ca
3 changed files with 204 additions and 4 deletions

172
xmlto-xhtml1.patch Normal file
View File

@ -0,0 +1,172 @@
diff -urNp xmlto-0.0.21-orig/format/xhtml1/dvi xmlto-0.0.21/format/xhtml1/dvi
--- xmlto-0.0.21-orig/format/xhtml1/dvi 1970-01-01 01:00:00.000000000 +0100
+++ xmlto-0.0.21/format/xhtml1/dvi 2009-03-16 12:30:34.000000000 +0100
@@ -0,0 +1,13 @@
+case "$1" in
+stylesheet)
+ if [ "$VERBOSE" -ge 1 ]
+ then
+ echo >&2 "Convert to XSL-FO"
+ fi
+ echo "http://www.antennahouse.com/XSLsample/sample-xsl-xhtml2fo/xhtml2fo.xsl"
+ ;;
+post-process)
+ # Get the FO format script to do the rest
+ sh "$(dirname "$0")/../fo/$(basename "$0")" "$1"
+ ;;
+esac
diff -urNp xmlto-0.0.21-orig/format/xhtml1/fo xmlto-0.0.21/format/xhtml1/fo
--- xmlto-0.0.21-orig/format/xhtml1/fo 1970-01-01 01:00:00.000000000 +0100
+++ xmlto-0.0.21/format/xhtml1/fo 2009-03-16 12:30:34.000000000 +0100
@@ -0,0 +1,12 @@
+case "$1" in
+stylesheet)
+ if [ "$VERBOSE" -ge 1 ]
+ then
+ echo >&2 "Convert to XSL-FO"
+ fi
+ echo "http://www.antennahouse.com/XSLsample/sample-xsl-xhtml2fo/xhtml2fo.xsl"
+ ;;
+post-process)
+ cp "$XSLT_PROCESSED" "$OUTPUT_DIR/$(basename ${XSLT_PROCESSED%.*}).fo"
+ ;;
+esac
diff -urNp xmlto-0.0.21-orig/format/xhtml1/pdf xmlto-0.0.21/format/xhtml1/pdf
--- xmlto-0.0.21-orig/format/xhtml1/pdf 1970-01-01 01:00:00.000000000 +0100
+++ xmlto-0.0.21/format/xhtml1/pdf 2009-03-16 12:30:34.000000000 +0100
@@ -0,0 +1,13 @@
+case "$1" in
+stylesheet)
+ if [ "$VERBOSE" -ge 1 ]
+ then
+ echo >&2 "Convert to XSL-FO"
+ fi
+ echo "http://www.antennahouse.com/XSLsample/sample-xsl-xhtml2fo/xhtml2fo.xsl"
+ ;;
+post-process)
+ # Get the FO format script to do the rest
+ sh "$(dirname "$0")/../fo/$(basename "$0")" "$1"
+ ;;
+esac
diff -urNp xmlto-0.0.21-orig/format/xhtml1/ps xmlto-0.0.21/format/xhtml1/ps
--- xmlto-0.0.21-orig/format/xhtml1/ps 1970-01-01 01:00:00.000000000 +0100
+++ xmlto-0.0.21/format/xhtml1/ps 2009-03-16 12:30:34.000000000 +0100
@@ -0,0 +1,13 @@
+case "$1" in
+stylesheet)
+ if [ "$VERBOSE" -ge 1 ]
+ then
+ echo >&2 "Convert to XSL-FO"
+ fi
+ echo "http://www.antennahouse.com/XSLsample/sample-xsl-xhtml2fo/xhtml2fo.xsl"
+ ;;
+post-process)
+ # Get the FO format script to do the rest
+ sh "$(dirname "$0")/../fo/$(basename "$0")" "$1"
+ ;;
+esac
diff -urNp xmlto-0.0.21-orig/format/xhtml1/txt xmlto-0.0.21/format/xhtml1/txt
--- xmlto-0.0.21-orig/format/xhtml1/txt 1970-01-01 01:00:00.000000000 +0100
+++ xmlto-0.0.21/format/xhtml1/txt 2009-03-16 12:30:34.000000000 +0100
@@ -0,0 +1,27 @@
+if [ -x /usr/bin/w3m ]
+then
+ CONVERT=/usr/bin/w3m
+ ARGS="-T text/html -dump"
+elif [ -x /usr/bin/lynx ]
+then
+ CONVERT=/usr/bin/lynx
+ ARGS="-force_html -dump -nolist -width=72"
+elif [ -x /usr/bin/links ]
+then
+ CONVERT=/usr/bin/links
+ ARGS="-dump"
+else
+ echo >&2 "No way to convert HTML to text found."
+ exit 1
+fi
+
+case "$1" in
+post-process)
+ if [ "$VERBOSE" -ge 1 ]
+ then
+ echo >&2 "Convert HTML to ASCII"
+ fi
+ ${CONVERT} ${ARGS} ${POSTARGS} ${XSLT_PROCESSED} > \
+ "$OUTPUT_DIR/$(basename ${XSLT_PROCESSED%.*}).txt"
+ ;;
+esac
diff -urNp xmlto-0.0.21-orig/Makefile.am xmlto-0.0.21/Makefile.am
--- xmlto-0.0.21-orig/Makefile.am 2008-01-17 12:33:44.000000000 +0100
+++ xmlto-0.0.21/Makefile.am 2009-03-16 12:49:27.000000000 +0100
@@ -28,6 +28,11 @@ nobase_pkgdata_DATA = format/docbook/dvi
format/fo/pcl \
format/fo/svg \
format/fo/txt \
+ format/xhtml1/dvi \
+ format/xhtml1/fo \
+ format/xhtml1/pdf \
+ format/xhtml1/ps \
+ format/xhtml1/txt \
xmlto.mak
EXTRA_DIST = xmlto.spec \
@@ -56,6 +61,11 @@ EXTRA_DIST = xmlto.spec \
format/fo/pcl \
format/fo/svg \
format/fo/txt \
+ format/xhtml1/dvi \
+ format/xhtml1/fo \
+ format/xhtml1/pdf \
+ format/xhtml1/ps \
+ format/xhtml1/txt \
doc/xmlto.xml \
doc/xmlif.xml \
xmlto.mak \
diff -urNp xmlto-0.0.21-orig/Makefile.in xmlto-0.0.21/Makefile.in
--- xmlto-0.0.21-orig/Makefile.in 2008-05-30 15:57:32.000000000 +0200
+++ xmlto-0.0.21/Makefile.in 2009-03-16 12:50:52.000000000 +0100
@@ -208,6 +208,11 @@ nobase_pkgdata_DATA = format/docbook/dvi
format/fo/pcl \
format/fo/svg \
format/fo/txt \
+ format/xhtml1/dvi \
+ format/xhtml1/fo \
+ format/xhtml1/pdf \
+ format/xhtml1/ps \
+ format/xhtml1/txt \
xmlto.mak
EXTRA_DIST = xmlto.spec \
@@ -236,6 +241,11 @@ EXTRA_DIST = xmlto.spec \
format/fo/pcl \
format/fo/svg \
format/fo/txt \
+ format/xhtml1/dvi \
+ format/xhtml1/fo \
+ format/xhtml1/pdf \
+ format/xhtml1/ps \
+ format/xhtml1/txt \
doc/xmlto.xml \
doc/xmlif.xml \
xmlto.mak \
diff -urNp xmlto-0.0.21-orig/xmlto.in xmlto-0.0.21/xmlto.in
--- xmlto-0.0.21-orig/xmlto.in 2009-03-16 14:22:58.000000000 +0100
+++ xmlto-0.0.21/xmlto.in 2009-03-16 12:27:49.000000000 +0100
@@ -351,12 +351,15 @@ 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 --shell $INPUT_FILE 2> /dev/null | head -n 3 |tail -n 1 | cut -f 4 -d " " )
case $(echo $rootel) in
fo:root)
SOURCE_FORMAT="fo"
;;
+html)
+ SOURCE_FORMAT="xhtml1"
+ ;;
esac
[ "$VERBOSE" -ge 1 ] && echo >&2 "Source format: ${SOURCE_FORMAT} / root element: ${rootel} "

View File

@ -8,8 +8,8 @@ diff -urNp xmlto-0.0.21-orig/xmlto.in xmlto-0.0.21/xmlto.in
- echo >&2 "xmllint >/dev/null --xinclude --postvalid \"$INPUT_FILE\""
- xmllint >/dev/null --xinclude --postvalid "$INPUT_FILE" 2>"${VALIDATION}"
+ echo >&2 \
+ "xmllint >/dev/null --nonet --xinclude --postvalid \"$INPUT_FILE\""
+ xmllint >/dev/null --nonet --xinclude --postvalid \
+ "xmllint >/dev/null --nonet --xinclude --postvalid --noent \"$INPUT_FILE\""
+ xmllint >/dev/null --nonet --xinclude --postvalid --noent \
+ "$INPUT_FILE" 2>"${VALIDATION}"
xmllint_status=$?
if [ $xmllint_status -ne 0 ]

View File

@ -1,7 +1,7 @@
Summary: A tool for converting XML files to various formats
Name: xmlto
Version: 0.0.21
Release: 8%{?dist}
Release: 9%{?dist}
#xmlto is released under GPLv2+ license, xmlif under GPL+ license
License: GPLv2+ and GPL+
Group: Applications/System
@ -13,6 +13,7 @@ Source0: https://fedorahosted.org/releases/x/m/%{name}/%{name}-%{version}.tar.bz
Patch0: xmlto-stringparam.patch
Patch1: xmlto-libpaper.patch
Patch2: xmlto-xmllintoptions.patch
Patch3: xmlto-xhtml1.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -44,11 +45,25 @@ Requires: xmlto = %{version}-%{release}
This subpackage contains xmlto backend scripts which do require
PassiveTeX/TeX for functionality.
%package xhtml
Group: Applications/System
License: GPLv2+
Summary: A set of xmlto backends for xhtml1 source format
# For functionality we need stylesheets xhtml2fo-style-xsl
Requires: xhtml2fo-style-xsl
# We require main package
Requires: xmlto = %{version}-%{release}
%description xhtml
This subpackage contains xmlto backend scripts for processing
xhtml1 source format.
%prep
%setup -q
%patch0 -p1 -b .stringparam
%patch1 -p1 -b .libpapercleanup
%patch2 -p1 -b .xmllintoptions
%patch3 -p1 -b .xhtml1
%build
%configure
@ -73,6 +88,9 @@ rm -rf $RPM_BUILD_ROOT
%exclude %{_datadir}/xmlto/format/fo/dvi
%exclude %{_datadir}/xmlto/format/fo/ps
%exclude %{_datadir}/xmlto/format/fo/pdf
%exclude %dir %{_datadir}/xmlto/format/xhtml1/
%exclude %{_datadir}/xmlto/format/xhtml1
%files tex
%defattr(-,root,root,-)
@ -80,8 +98,18 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/xmlto/format/fo/ps
%{_datadir}/xmlto/format/fo/pdf
%files xhtml
%defattr(-,root,root,-)
%dir %{_datadir}/xmlto/format/xhtml1/
%{_datadir}/xmlto/format/xhtml1
%changelog
* Mon Mar 02 2009 Ondrej Vasik <ovasik@redhat.com> - 0.0.21-7
* Mon Mar 16 2009 Ondrej Vasik <ovasik@redhat.com> - 0.0.21-9
- reenable noent switch - bug is on lcdproc side
- add xhtml support(subpackage) (#145140)
* Mon Mar 02 2009 Ondrej Vasik <ovasik@redhat.com> - 0.0.21-8
- temporarily disable noent switch - blocks lcdproc doc build
(#488093)