From ce7435f64d785e7d499a7c5ffab011aa09c03ac0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 24 2017 09:06:30 +0000 Subject: import rh-maven35-maven-doxia-1.7-2.2.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..919ecc4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/doxia-1.7-source-release.zip diff --git a/.rh-maven35-maven-doxia.metadata b/.rh-maven35-maven-doxia.metadata new file mode 100644 index 0000000..6a59178 --- /dev/null +++ b/.rh-maven35-maven-doxia.metadata @@ -0,0 +1 @@ +1971646a8a4b22cce7973889765fb69349c61cbe SOURCES/doxia-1.7-source-release.zip diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-Fix-itext-dependency.patch b/SOURCES/0001-Fix-itext-dependency.patch new file mode 100644 index 0000000..8a40277 --- /dev/null +++ b/SOURCES/0001-Fix-itext-dependency.patch @@ -0,0 +1,245 @@ +From 71a78088dff0081a290a860a184166bf993d04bf Mon Sep 17 00:00:00 2001 +From: Stanislav Ochotnicky +Date: Mon, 29 Apr 2013 11:37:12 +0200 +Subject: [PATCH 1/4] Fix itext dependency + +--- + doxia-modules/doxia-module-itext/pom.xml | 2 +- + .../apache/maven/doxia/module/itext/ITextFont.java | 16 ++--- + .../apache/maven/doxia/module/itext/ITextSink.java | 6 +- + .../apache/maven/doxia/module/itext/ITextUtil.java | 69 +--------------------- + .../doxia/module/itext/ITextSinkTestCase.java | 22 ------- + 5 files changed, 13 insertions(+), 102 deletions(-) + +diff --git a/doxia-modules/doxia-module-itext/pom.xml b/doxia-modules/doxia-module-itext/pom.xml +index 94f94f3..8293f04 100644 +--- a/doxia-modules/doxia-module-itext/pom.xml ++++ b/doxia-modules/doxia-module-itext/pom.xml +@@ -58,7 +58,7 @@ under the License. + + com.lowagie + itext +- 1.4 ++ 2.1.7 + + + +diff --git a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextFont.java b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextFont.java +index 2cc8ef1..5dfc882 100644 +--- a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextFont.java ++++ b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextFont.java +@@ -24,7 +24,7 @@ import java.awt.Color; + import com.lowagie.text.ExceptionConverter; + import com.lowagie.text.Font; + import com.lowagie.text.FontFactory; +-import com.lowagie.text.markup.MarkupTags; ++import com.lowagie.text.html.Markup; + import com.lowagie.text.pdf.BaseFont; + + /** +@@ -38,16 +38,16 @@ import com.lowagie.text.pdf.BaseFont; + public class ITextFont + { + /** A normal font style */ +- public static final String NORMAL = MarkupTags.CSS_VALUE_NORMAL; ++ public static final String NORMAL = Markup.CSS_VALUE_NORMAL; + + /** A bold font style */ +- public static final String BOLD = MarkupTags.CSS_VALUE_BOLD; ++ public static final String BOLD = Markup.CSS_VALUE_BOLD; + + /** A italic font style */ +- public static final String ITALIC = MarkupTags.CSS_VALUE_ITALIC; ++ public static final String ITALIC = Markup.CSS_VALUE_ITALIC; + + /** An underline font style */ +- public static final String UNDERLINE = MarkupTags.CSS_VALUE_UNDERLINE; ++ public static final String UNDERLINE = Markup.CSS_VALUE_UNDERLINE; + + /** A default font name */ + public static final String DEFAULT_FONT_NAME = FontFactory.HELVETICA; +@@ -262,7 +262,7 @@ public class ITextFont + { + Font font = getCurrentFont(); + +- return String.valueOf( font.color().getBlue() ); ++ return String.valueOf( font.getColor().getBlue() ); + } + + /** +@@ -274,7 +274,7 @@ public class ITextFont + { + Font font = getCurrentFont(); + +- return String.valueOf( font.color().getGreen() ); ++ return String.valueOf( font.getColor().getGreen() ); + } + + /** +@@ -286,7 +286,7 @@ public class ITextFont + { + Font font = getCurrentFont(); + +- return String.valueOf( font.color().getRed() ); ++ return String.valueOf( font.getColor().getRed() ); + } + + /** +diff --git a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java +index 2847413..c85f81f 100644 +--- a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java ++++ b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java +@@ -1232,9 +1232,9 @@ public class ITextSink + try + { + Image image = Image.getInstance( new URL( urlName ) ); +- image.scaleToFit( ITextUtil.getDefaultPageSize().width() / 2, ITextUtil.getDefaultPageSize().height() / 2 ); +- width = image.plainWidth(); +- height = image.plainHeight(); ++ image.scaleToFit( ITextUtil.getDefaultPageSize().getWidth() / 2, ITextUtil.getDefaultPageSize().getHeight() / 2 ); ++ width = image.getPlainWidth(); ++ height = image.getPlainHeight(); + } + catch ( BadElementException e ) + { +diff --git a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextUtil.java b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextUtil.java +index 4363413..141646c 100644 +--- a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextUtil.java ++++ b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextUtil.java +@@ -22,9 +22,6 @@ package org.apache.maven.doxia.module.itext; + import com.lowagie.text.DocumentException; + import com.lowagie.text.PageSize; + import com.lowagie.text.Rectangle; +-import com.lowagie.text.xml.XmlToHtml; +-import com.lowagie.text.xml.XmlToPdf; +-import com.lowagie.text.xml.XmlToRtf; + + import java.io.InputStream; + import java.io.OutputStream; +@@ -77,7 +74,7 @@ public class ITextUtil + if ( currentField.getType().equals( Rectangle.class ) ) + { + Rectangle fPageSize = (Rectangle) currentField.get( null ); +- if ( ( rect.width() == fPageSize.width() ) && ( rect.height() == fPageSize.height() ) ) ++ if ( ( rect.getWidth() == fPageSize.getWidth() ) && ( rect.getHeight() == fPageSize.getHeight() ) ) + { + return currentField.getName(); + } +@@ -114,68 +111,4 @@ public class ITextUtil + + return false; + } +- +- /** +- * Parse an iText XML from the specified InputStream, writing an Pdf document +- * specified OutputStream. +- * +- * @param is the InputStream from which the XML is read. +- * @param os the OutputStream to which the result as Pdf is written. +- * @see com.lowagie.text.xml.XmlToPdf +- */ +- public static void writePdf( InputStream is, OutputStream os ) +- { +- try +- { +- XmlToPdf x = new XmlToPdf(); +- +- x.parse( is, os ); +- } +- catch ( DocumentException e ) +- { +- throw new RuntimeException( "DocumentException : " + e.getMessage(), e ); +- } +- } +- +- /** +- * Parse an iText XML from the specified InputStream, writing an rtf document +- * specified OutputStream. +- * +- * @param is the InputStream from which the XML is read. +- * @param os the OutputStream to which the result as RTF is written. +- * @see com.lowagie.text.xml.XmlToRtf +- */ +- public static void writeRtf( InputStream is, OutputStream os ) +- { +- try +- { +- XmlToRtf x = new XmlToRtf(); +- x.parse( is, os ); +- } +- catch ( DocumentException e ) +- { +- throw new RuntimeException( "DocumentException : " + e.getMessage(), e ); +- } +- } +- +- /** +- * Parse an iText XML from the specified InputStream, writing an html document +- * specified OutputStream. +- * +- * @param is the InputStream from which the XML is read. +- * @param os the OutputStream to which the result as Html is written. +- * @see com.lowagie.text.xml.XmlToHtml +- */ +- public static void writeHtml( InputStream is, OutputStream os ) +- { +- try +- { +- XmlToHtml x = new XmlToHtml(); +- x.parse( is, os ); +- } +- catch ( DocumentException e ) +- { +- throw new RuntimeException( "DocumentException : " + e.getMessage(), e ); +- } +- } + } +diff --git a/doxia-modules/doxia-module-itext/src/test/java/org/apache/maven/doxia/module/itext/ITextSinkTestCase.java b/doxia-modules/doxia-module-itext/src/test/java/org/apache/maven/doxia/module/itext/ITextSinkTestCase.java +index 6bcd2be..a9674a0 100644 +--- a/doxia-modules/doxia-module-itext/src/test/java/org/apache/maven/doxia/module/itext/ITextSinkTestCase.java ++++ b/doxia-modules/doxia-module-itext/src/test/java/org/apache/maven/doxia/module/itext/ITextSinkTestCase.java +@@ -81,20 +81,6 @@ public class ITextSinkTestCase + } + + /** +- * Test PDF generation +- * +- * @throws Exception +- */ +- public void testGeneratingPDFFromITextXml() +- throws Exception +- { +- File f = new File( getBasedir(), "src/test/resources/itext/itext.xml" ); +- +- ITextUtil.writePdf( new FileInputStream( f ), +- new FileOutputStream( getGeneratedFile( "test_itext", "pdf" ) ) ); +- } +- +- /** + * Generate a pdf and a rtf from the standart test model. + * + * @throws Exception if any +@@ -107,11 +93,6 @@ public class ITextSinkTestCase + SinkTestDocument.generate( sink ); + + sink.close(); +- +- ITextUtil.writePdf( new FileInputStream( getGeneratedFile( "test_model", "xml" ) ), +- new FileOutputStream( getGeneratedFile( "test_model", "pdf" ) ) ); +- ITextUtil.writeRtf( new FileInputStream( getGeneratedFile( "test_model", "xml" ) ), +- new FileOutputStream( getGeneratedFile( "test_model", "rtf" ) ) ); + } + + /** +@@ -148,8 +129,5 @@ public class ITextSinkTestCase + + sink.flush(); + sink.close(); +- +- ITextUtil.writePdf( new FileInputStream( getGeneratedFile( "empty_anchor", "xml" ) ), +- new FileOutputStream( getGeneratedFile( "empty_anchor", "pdf" ) ) ); + } + } +-- +2.5.5 + diff --git a/SOURCES/0002-Update-to-Plexus-Container-1.5.5.patch b/SOURCES/0002-Update-to-Plexus-Container-1.5.5.patch new file mode 100644 index 0000000..3a208ca --- /dev/null +++ b/SOURCES/0002-Update-to-Plexus-Container-1.5.5.patch @@ -0,0 +1,100 @@ +From 6a3583cafd46194b6c2c5f4db061f72f16d014ef Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Wed, 6 Nov 2013 12:46:26 +0100 +Subject: [PATCH 2/4] Update to Plexus Container 1.5.5 + +--- + .../java/org/apache/maven/doxia/module/AbstractIdentityTest.java | 3 ++- + .../test/java/org/apache/maven/doxia/sink/impl/AbstractSinkTest.java | 5 +++-- + .../test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java | 3 ++- + pom.xml | 2 +- + 4 files changed, 8 insertions(+), 5 deletions(-) + +diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java +index 2f4f495..540461d 100644 +--- a/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java ++++ b/doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java +@@ -33,6 +33,7 @@ import org.apache.maven.doxia.parser.Parser; + import org.apache.maven.doxia.sink.Sink; + import org.apache.maven.doxia.sink.impl.SinkTestDocument; + import org.apache.maven.doxia.sink.impl.TextSink; ++import org.codehaus.plexus.DefaultPlexusContainer; + import org.codehaus.plexus.util.IOUtil; + + /** +@@ -107,7 +108,7 @@ public abstract class AbstractIdentityTest + writer = new StringWriter(); + sink = new TextSink( writer ); + Parser parser = createParser(); +- parser.enableLogging( new PlexusLoggerWrapper( getContainer().getLogger() ) ); ++ parser.enableLogging( new PlexusLoggerWrapper( ( ( DefaultPlexusContainer )getContainer() ).getLogger() ) ); + parser.parse( reader, sink ); + String actual = writer.toString(); + +diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/AbstractSinkTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/AbstractSinkTest.java +index a67a114..3ac8734 100644 +--- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/AbstractSinkTest.java ++++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/AbstractSinkTest.java +@@ -28,6 +28,7 @@ import org.apache.maven.doxia.logging.PlexusLoggerWrapper; + import org.apache.maven.doxia.sink.Sink; + import org.apache.maven.doxia.sink.SinkEventAttributes; + import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet; ++import org.codehaus.plexus.DefaultPlexusContainer; + import org.codehaus.plexus.util.IOUtil; + import org.custommonkey.xmlunit.Diff; + import org.custommonkey.xmlunit.XMLUnit; +@@ -59,7 +60,7 @@ public abstract class AbstractSinkTest + + testWriter.reset(); + sink = createSink( testWriter ); +- sink.enableLogging( new PlexusLoggerWrapper( getContainer().getLogger() ) ); ++ sink.enableLogging( new PlexusLoggerWrapper( ( ( DefaultPlexusContainer )getContainer() ).getLogger() ) ); + } + + /** +@@ -809,7 +810,7 @@ public abstract class AbstractSinkTest + + testWriter.reset(); + sink = createSink( testWriter ); +- sink.enableLogging( new PlexusLoggerWrapper( getContainer().getLogger() ) ); ++ sink.enableLogging( new PlexusLoggerWrapper( ( ( DefaultPlexusContainer )getContainer() ).getLogger() )); + + comment = "-"; + sink.comment( comment ); +diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java b/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java +index 5f9108e..88db2b4 100644 +--- a/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java ++++ b/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java +@@ -31,6 +31,7 @@ import junit.framework.AssertionFailedError; + + import org.apache.maven.doxia.parser.Parser; + ++import org.codehaus.plexus.DefaultPlexusContainer; + import org.codehaus.plexus.PlexusTestCase; + import org.codehaus.plexus.logging.Logger; + +@@ -96,7 +97,7 @@ public abstract class AbstractXmlValidator + public void testValidateFiles() + throws Exception + { +- final Logger logger = getContainer().getLoggerManager().getLoggerForComponent( Parser.ROLE ); ++ final Logger logger = ( ( DefaultPlexusContainer )getContainer() ).getLoggerManager().getLoggerForComponent( Parser.ROLE ); + + for ( Iterator> it = getTestDocuments().entrySet().iterator(); it.hasNext(); ) + { +diff --git a/pom.xml b/pom.xml +index 134f8b8..fcf4f32 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -180,7 +180,7 @@ under the License. + + org.codehaus.plexus + plexus-container-default +- 1.0-alpha-30 ++ 1.5.5 + + + org.codehaus.plexus +-- +2.5.5 + diff --git a/SOURCES/0003-Disable-tests-which-rely-on-ordering-in-set.patch b/SOURCES/0003-Disable-tests-which-rely-on-ordering-in-set.patch new file mode 100644 index 0000000..3e69d59 --- /dev/null +++ b/SOURCES/0003-Disable-tests-which-rely-on-ordering-in-set.patch @@ -0,0 +1,61 @@ +From 6e1707a4bdea698f62fac215b6bca646bf14e4b4 Mon Sep 17 00:00:00 2001 +From: Michal Srb +Date: Wed, 26 Mar 2014 09:58:20 +0100 +Subject: [PATCH 3/4] Disable tests which rely on ordering in set + +--- + .../test/java/org/apache/maven/doxia/sink/impl/AbstractSinkTest.java | 3 +++ + .../java/org/apache/maven/doxia/module/fo/FoAggregateSinkTest.java | 2 ++ + 2 files changed, 5 insertions(+) + +diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/AbstractSinkTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/AbstractSinkTest.java +index 3ac8734..707cdf1 100644 +--- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/AbstractSinkTest.java ++++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/AbstractSinkTest.java +@@ -452,6 +452,7 @@ public abstract class AbstractSinkTest + * invoked on the current sink, produces the same result as + * {@link #getFigureBlock getFigureBlock}( source, caption ). + */ ++ /* + public void testFigure() throws Exception + { + String source = "figure.jpg"; +@@ -511,6 +512,7 @@ public abstract class AbstractSinkTest + * invoked on the current sink, produces the same result as + * {@link #getTableBlock getTableBlock}( cell, caption ). + */ ++ /* + public void testTable() throws Exception + { + String cell = "cell"; +@@ -544,6 +546,7 @@ public abstract class AbstractSinkTest + assertEquals( "Wrong table!", expected, actual ); + } + } ++ */ + + /** + * Checks that the sequence [paragraph(), text( text ), +diff --git a/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoAggregateSinkTest.java b/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoAggregateSinkTest.java +index 847c341..729357b 100644 +--- a/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoAggregateSinkTest.java ++++ b/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoAggregateSinkTest.java +@@ -164,6 +164,7 @@ public class FoAggregateSinkTest + /** + * Test of figureGraphics method, of class FoAggregateSink. + */ ++ /* + public void testFigureGraphics() throws Exception + { + try +@@ -187,6 +188,7 @@ public class FoAggregateSinkTest + Diff diff = XMLUnit.compareXML( wrapXml( expected ), wrapXml( actual ) ); + assertTrue( "Wrong figure!", diff.identical() ); + } ++ */ + + /** + * Test of anchor method, of class FoAggregateSink. +-- +2.5.5 + diff --git a/SOURCES/0004-Port-to-fop-2.0.patch b/SOURCES/0004-Port-to-fop-2.0.patch new file mode 100644 index 0000000..c09b624 --- /dev/null +++ b/SOURCES/0004-Port-to-fop-2.0.patch @@ -0,0 +1,157 @@ +From b72bf32dbabf4c18cf48bdbc344227fb0b2d5110 Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Mon, 17 Aug 2015 17:15:05 +0200 +Subject: [PATCH 4/4] Port to fop-2.0 + +--- + doxia-modules/doxia-module-fo/pom.xml | 2 +- + .../org/apache/maven/doxia/module/fo/FoUtils.java | 58 ++++++---------------- + 2 files changed, 16 insertions(+), 44 deletions(-) + +diff --git a/doxia-modules/doxia-module-fo/pom.xml b/doxia-modules/doxia-module-fo/pom.xml +index e66c736..6d261c8 100644 +--- a/doxia-modules/doxia-module-fo/pom.xml ++++ b/doxia-modules/doxia-module-fo/pom.xml +@@ -85,7 +85,7 @@ under the License. + + org.apache.xmlgraphics + fop +- 0.95 ++ 2.0 + + + log4j +diff --git a/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java b/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java +index 0e7efc1..c398eaf 100644 +--- a/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java ++++ b/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java +@@ -24,6 +24,7 @@ import java.io.File; + import java.io.FileOutputStream; + import java.io.IOException; + import java.io.OutputStream; ++import java.net.URI; + import java.util.Date; + + import javax.xml.transform.Result; +@@ -38,6 +39,7 @@ import org.apache.fop.apps.FOPException; + import org.apache.fop.apps.FOUserAgent; + import org.apache.fop.apps.Fop; + import org.apache.fop.apps.FopFactory; ++import org.apache.fop.apps.FopFactoryBuilder; + import org.apache.fop.apps.MimeConstants; + import org.apache.maven.doxia.document.DocumentModel; + import org.codehaus.plexus.util.IOUtil; +@@ -52,28 +54,11 @@ import org.codehaus.plexus.util.StringUtils; + */ + public class FoUtils + { +- /** To reuse the FopFactory **/ +- private static final FopFactory FOP_FACTORY = FopFactory.newInstance(); +- + /** To reuse the TransformerFactory **/ + private static final TransformerFactory TRANSFORMER_FACTORY = TransformerFactory.newInstance(); + +- /** +- * Converts an FO file to a PDF file using FOP. +- * +- * @param fo the FO file, not null. +- * @param pdf the target PDF file, not null. +- * @param resourceDir The base directory for relative path resolution, could be null. +- * If null, defaults to the parent directory of fo. +- * @param documentModel the document model to add PDF metadatas like author, title and keywords, could be null. +- * @throws javax.xml.transform.TransformerException In case of a conversion problem. +- * @since 1.1.1 +- */ +- public static void convertFO2PDF( File fo, File pdf, String resourceDir, DocumentModel documentModel ) +- throws TransformerException +- { +- FOUserAgent foUserAgent = getDefaultUserAgent( fo, resourceDir ); + ++ private static void prepareUserAgent( FOUserAgent foUserAgent, DocumentModel documentModel ) { + if ( documentModel != null && documentModel.getMeta() != null ) + { + // http://xmlgraphics.apache.org/fop/embedding.html#user-agent +@@ -113,8 +98,6 @@ public class FoUtils + { + foUserAgent.setCreationDate( new Date() ); + } +- +- convertFO2PDF( fo, pdf, resourceDir, foUserAgent ); + } + + /** +@@ -124,16 +107,13 @@ public class FoUtils + * @param pdf the target PDF file, not null. + * @param resourceDir The base directory for relative path resolution, could be null. + * If null, defaults to the parent directory of fo. +- * @param foUserAgent the FOUserAgent to use. +- * May be null, in which case a default user agent will be used. ++ * @param documentModel the document model to add PDF metadatas like author, title and keywords, could be null. + * @throws javax.xml.transform.TransformerException In case of a conversion problem. + * @since 1.1.1 + */ +- public static void convertFO2PDF( File fo, File pdf, String resourceDir, FOUserAgent foUserAgent ) ++ public static void convertFO2PDF( File fo, File pdf, String resourceDir, DocumentModel documentModel ) + throws TransformerException + { +- FOUserAgent userAgent = ( foUserAgent == null ? getDefaultUserAgent( fo, resourceDir ) : foUserAgent ); +- + OutputStream out = null; + try + { +@@ -149,7 +129,11 @@ public class FoUtils + Result res = null; + try + { +- Fop fop = FOP_FACTORY.newFop( MimeConstants.MIME_PDF, userAgent, out ); ++ URI baseURI = getBaseURI( fo, resourceDir ); ++ FopFactory fopFactory = new FopFactoryBuilder( baseURI ).build(); ++ FOUserAgent userAgent = fopFactory.newFOUserAgent(); ++ prepareUserAgent( userAgent, documentModel ); ++ Fop fop = fopFactory.newFop( MimeConstants.MIME_PDF, userAgent, out ); + res = new SAXResult( fop.getDefaultHandler() ); + } + catch ( FOPException e ) +@@ -193,34 +177,22 @@ public class FoUtils + } + + /** +- * Returns a base URL to be used by the FOUserAgent. ++ * Returns a base URI. + * + * @param fo the FO file. + * @param resourceDir the resource directory. +- * @return String. ++ * @return URI. + */ +- private static String getBaseURL( File fo, String resourceDir ) ++ private static URI getBaseURI( File fo, String resourceDir ) + { +- String url = null; +- + if ( resourceDir == null ) + { +- url = "file:///" + fo.getParent() + "/"; ++ return fo.getParentFile().toURI(); + } + else + { +- url = "file:///" + resourceDir + "/"; ++ return new File( resourceDir + "/" ).toURI(); + } +- +- return url; +- } +- +- private static FOUserAgent getDefaultUserAgent( File fo, String resourceDir ) +- { +- FOUserAgent foUserAgent = FOP_FACTORY.newFOUserAgent(); +- foUserAgent.setBaseURL( getBaseURL( fo, resourceDir ) ); +- +- return foUserAgent; + } + + private FoUtils() +-- +2.5.5 + diff --git a/SPECS/maven-doxia.spec b/SPECS/maven-doxia.spec new file mode 100644 index 0000000..009daae --- /dev/null +++ b/SPECS/maven-doxia.spec @@ -0,0 +1,520 @@ +%{?scl:%scl_package maven-doxia} +%{!?scl:%global pkg_name %{name}} + +%bcond_without itext +%bcond_without markdown +%bcond_without fop + +Name: %{?scl_prefix}maven-doxia +Version: 1.7 +Release: 2.2%{?dist} +Epoch: 0 +Summary: Content generation framework +License: ASL 2.0 +URL: http://maven.apache.org/doxia/ + +Source0: http://repo2.maven.org/maven2/org/apache/maven/doxia/doxia/%{version}/doxia-%{version}-source-release.zip + +# Build against iText 2.x +# https://issues.apache.org/jira/browse/DOXIA-53 +Patch1: 0001-Fix-itext-dependency.patch + +# Accepted upstream: DOXIA-504, https://issues.apache.org/jira/browse/DOXIA-504 +Patch2: 0002-Update-to-Plexus-Container-1.5.5.patch + +# Don't run bad tests which rely on ordering in set (they fail with Java 8) +Patch3: 0003-Disable-tests-which-rely-on-ordering-in-set.patch + +# Not upstreamable due to higher Java version of fop's dependencies +Patch4: 0004-Port-to-fop-2.0.patch + +BuildArch: noarch + +BuildRequires: %{?scl_prefix}maven-local +BuildRequires: %{?scl_prefix}mvn(commons-configuration:commons-configuration) +BuildRequires: %{?scl_prefix}mvn(commons-lang:commons-lang) +BuildRequires: %{?scl_prefix}mvn(junit:junit) +BuildRequires: %{?scl_prefix}mvn(org.apache.httpcomponents:httpclient) +BuildRequires: %{?scl_prefix}mvn(org.apache.httpcomponents:httpcore) +BuildRequires: %{?scl_prefix}mvn(org.apache.maven.doxia:doxia-core) +BuildRequires: %{?scl_prefix}mvn(org.apache.maven.doxia:doxia-core::tests:) +BuildRequires: %{?scl_prefix}mvn(org.apache.maven.doxia:doxia-logging-api) +BuildRequires: %{?scl_prefix}mvn(org.apache.maven.doxia:doxia-module-apt) +BuildRequires: %{?scl_prefix}mvn(org.apache.maven.doxia:doxia-modules:pom:) +BuildRequires: %{?scl_prefix}mvn(org.apache.maven.doxia:doxia-module-xhtml) +BuildRequires: %{?scl_prefix}mvn(org.apache.maven.doxia:doxia:pom:) +BuildRequires: %{?scl_prefix}mvn(org.apache.maven.doxia:doxia-sink-api) +BuildRequires: %{?scl_prefix}mvn(org.apache.maven.doxia:doxia-test-docs) +BuildRequires: %{?scl_prefix}mvn(org.apache.maven:maven-parent:pom:) +%if %{with fop} +BuildRequires: mvn(org.apache.xmlgraphics:fop) +%endif +BuildRequires: %{?scl_prefix}mvn(org.codehaus.modello:modello-maven-plugin) +BuildRequires: %{?scl_prefix}mvn(org.codehaus.plexus:plexus-component-annotations) +BuildRequires: %{?scl_prefix}mvn(org.codehaus.plexus:plexus-component-metadata) +BuildRequires: %{?scl_prefix}mvn(org.codehaus.plexus:plexus-container-default) +BuildRequires: %{?scl_prefix}mvn(org.codehaus.plexus:plexus-utils) +BuildRequires: %{?scl_prefix}mvn(xerces:xercesImpl) +BuildRequires: %{?scl_prefix}mvn(xmlunit:xmlunit) +%if %{with itext} +BuildRequires: mvn(com.lowagie:itext) +%endif +%if %{with markdown} +BuildRequires: mvn(org.pegdown:pegdown) +%endif + + +%description +Doxia is a content generation framework which aims to provide its +users with powerful techniques for generating static and dynamic +content. Doxia can be used to generate static sites in addition to +being incorporated into dynamic content generation systems like blogs, +wikis and content management systems. + +%package core +Summary: Core module for %{pkg_name} + +%description core +This package provides %{summary}. + +%package logging-api +Summary: Logging-api module for %{pkg_name} + +%description logging-api +This package provides %{summary}. + +%package module-apt +Summary: APT module for %{pkg_name} + +%description module-apt +This package provides %{summary}. + +%package module-confluence +Summary: Confluence module for %{pkg_name} + +%description module-confluence +This package provides %{summary}. + +%package module-docbook-simple +Summary: Simplified DocBook module for %{pkg_name} + +%description module-docbook-simple +This package provides %{summary}. + +%package module-fml +Summary: FML module for %{pkg_name} + +%description module-fml +This package provides %{summary}. + +%if %{with fop} + +%package module-fo +Summary: FO module for %{pkg_name} + +%description module-fo +This package provides %{summary}. +%endif + +%if %{with itext} + +%package module-itext +Summary: iText module for %{pkg_name} + +%description module-itext +This package provides %{summary}. +%endif + +%if %{with markdown} + +%package module-markdown +Summary: Markdown module for %{pkg_name} + +%description module-markdown +This package provides %{summary}. +%endif + +%package module-latex +Summary: Latex module for %{pkg_name} + +%description module-latex +This package provides %{summary}. + +%package module-rtf +Summary: RTF module for %{pkg_name} + +%description module-rtf +This package provides %{summary}. + +%package modules +Summary: Doxia modules for several markup languages. + +%description modules +This package provides %{summary}. + +%package module-twiki +Summary: TWiki module for %{pkg_name} + +%description module-twiki +This package provides %{summary}. + +%package module-xdoc +Summary: XDoc module for %{pkg_name} + +%description module-xdoc +This package provides %{summary}. + +%package module-xhtml +Summary: XHTML module for %{pkg_name} + +%description module-xhtml +This package provides %{summary}. + +%package sink-api +Summary: Sink-api module for %{pkg_name} + +%description sink-api +This package provides %{summary}. + +%package tests +Summary: Tests for %{pkg_name} + +%description tests +This package provides %{summary}. + +%package test-docs +Summary: Test-docs module for %{pkg_name} + +%description test-docs +This package provides %{summary}. + +%package javadoc +Summary: Javadoc for %{pkg_name} + +%description javadoc +API documentation for %{pkg_name}. + +%prep +%setup -q -n doxia-%{version} +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 + +# we don't have clirr-maven-plugin +%pom_remove_plugin org.codehaus.mojo:clirr-maven-plugin pom.xml + +# complains +%pom_remove_plugin :apache-rat-plugin + +# use java 5 generics in modello plugin +%pom_xpath_inject "pom:plugin[pom:artifactId[text()='modello-maven-plugin']]"\ +"/pom:executions/pom:execution/pom:configuration" \ +"true" doxia-modules/doxia-module-fml/pom.xml + +# requires network +rm doxia-core/src/test/java/org/apache/maven/doxia/util/XmlValidatorTest.java + +%mvn_package :::tests: tests + +%if %{without itext} +%pom_disable_module doxia-module-itext doxia-modules +%endif +%if %{without markdown} +%pom_disable_module doxia-module-markdown doxia-modules +%endif +%if %{without fop} +%pom_disable_module doxia-module-fo doxia-modules +%endif + +%build +%mvn_build -s + +%install +%mvn_install + +%files -f .mfiles-doxia +%dir %{_javadir}/%{pkg_name} +%doc LICENSE NOTICE + +%files core -f .mfiles-doxia-core + +%files logging-api -f .mfiles-doxia-logging-api +%doc LICENSE NOTICE + +%files module-apt -f .mfiles-doxia-module-apt + +%files module-confluence -f .mfiles-doxia-module-confluence + +%files module-docbook-simple -f .mfiles-doxia-module-docbook-simple + +%files module-fml -f .mfiles-doxia-module-fml +%if %{with fop} + +%files module-fo -f .mfiles-doxia-module-fo +%endif +%if %{with itext} + +%files module-itext -f .mfiles-doxia-module-itext +%endif +%if %{with markdown} + +%files module-markdown -f .mfiles-doxia-module-markdown +%endif + +%files module-latex -f .mfiles-doxia-module-latex + +%files module-rtf -f .mfiles-doxia-module-rtf + +%files modules -f .mfiles-doxia-modules + +%files module-twiki -f .mfiles-doxia-module-twiki + +%files module-xdoc -f .mfiles-doxia-module-xdoc + +%files module-xhtml -f .mfiles-doxia-module-xhtml + +%files sink-api -f .mfiles-doxia-sink-api + +%files test-docs -f .mfiles-doxia-test-docs + +%files tests -f .mfiles-tests +%doc LICENSE NOTICE + +%files javadoc -f .mfiles-javadoc +%doc LICENSE NOTICE + +%changelog +* Thu Jun 22 2017 Michael Simacek - 0:1.7-2.2 +- Mass rebuild 2017-06-22 + +* Wed Jun 21 2017 Java Maintainers - 0:1.7-2.1 +- Automated package import and SCL-ization + +* Tue Feb 07 2017 Michael Simacek - 0:1.7-2 +- Add conditional for fop + +* Mon May 02 2016 Michael Simacek - 0:1.7-1 +- Update to upstream version 1.7 + +* Thu Feb 04 2016 Fedora Release Engineering - 0:1.6-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Aug 18 2015 Michael Simacek - 0:1.6-4 +- Port to fop-2.0 +- Cleanup bundled class from sitetools + +* Wed Jun 17 2015 Fedora Release Engineering - 0:1.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri Mar 20 2015 Mikolaj Izdebski - 0:1.6-2 +- Rebuild for fop update + +* Thu Jul 17 2014 Mikolaj Izdebski - 0:1.6-1 +- Update to upstream version 1.6 + +* Wed Jun 11 2014 Michael Simacek - 0:1.5-7 +- Change BR classworlds to plexus-classworlds + +* Sat Jun 07 2014 Fedora Release Engineering - 0:1.5-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon May 12 2014 Mikolaj Izdebski - 0:1.5-5 +- Build-require pegdown >= 1.4.2-2 + +* Wed Mar 26 2014 Michal Srb - 0:1.5-4 +- Disable bad tests which rely on ordering in set + +* Tue Mar 04 2014 Stanislav Ochotnicky - 0:1.5-3 +- Use Requires: java-headless rebuild (#1067528) + +* Wed Feb 19 2014 Mikolaj Izdebski - 0:1.5-2 +- Fix unowned directory + +* Tue Dec 10 2013 Michael Simacek - 0:1.5-1 +- Update to upstream version 1.5 +- Move back RenderingContext.java that was moved to doxia-sitetools which + doesn't have a release yet + +* Thu Dec 5 2013 Mikolaj Izdebski - 0:1.4-6 +- BuildRequire plexus-containers-container-default 1.5.5-14 +- Resolves: rhbz#1036584 + +* Mon Nov 25 2013 Stanislav Ochotnicky - 0:1.4-5 +- Rebuild after itext versioned jar fixed + +* Thu Nov 7 2013 Mikolaj Izdebski - 0:1.4-4 +- Port to Commons Collections 1.10 + +* Wed Nov 6 2013 Mikolaj Izdebski - 0:1.4-3 +- Enable tests + +* Sat Aug 03 2013 Fedora Release Engineering - 0:1.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Apr 29 2013 Michal Srb - 0:1.4-1 +- Update to upstream version 1.4 +- Enable markdown module +- Remove unneeded patch + +* Tue Apr 23 2013 Stanislav Ochotnicky - 0:1.3-3 +- Remove ant-nodeps BuildRequires + +* Mon Apr 8 2013 Mikolaj Izdebski - 0:1.3-2 +- Conditionally disable itext module + +* Tue Mar 19 2013 Michal Srb - 0:1.3-1 +- Update to upstream version 1.3 +- Remove temporary dependencies on subpackages + +* Thu Feb 7 2013 Mikolaj Izdebski - 0:1.2-9 +- Remove runtime requirement on POM: httpcomponents-project + +* Wed Feb 06 2013 Java SIG - 0:1.2-9 +- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild +- Replace maven BuildRequires with maven-local + +* Thu Dec 20 2012 Stanislav Ochotnicky - 0:1.2-8 +- Add httpcomponents-project to doxia-core requires + +* Thu Dec 20 2012 Mikolaj Izdebski - 0:1.2-7 +- Temporarly require all subpackages in the main package + +* Wed Dec 19 2012 Michal Srb +- Splitted into multiple subpackages (Resolves: #888710) + +* Mon Dec 10 2012 Michal Srb - 0:1.2-5 +- Migrated to plexus-components-component-default (Resolves: #878553) +- Removed custom depmap and its occurrence in spec file +- Fixed various rpmlint warnings + +* Thu Jul 19 2012 Fedora Release Engineering - 0:1.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jan 9 2012 Stanislav Ochotnicky - 0:1.2-3 +- Remove plexus-xmlrpc from BR +- Update patches to work without plexus-maven-plugin + +* Fri May 6 2011 Stanislav Ochotnicky - 0:1.2-2 +- Add forgotten missing requires + +* Fri May 6 2011 Stanislav Ochotnicky - 0:1.2-1 +- Update to latest upstream (1.2) +- Use maven 3 to build +- Remove version limits on BR/R (not valid anymore anyway) +- Remove "assert" patch (no explanation for it's existence) + +* Tue Feb 22 2011 Stanislav Ochotnicky - 0:1.1.4-3 +- Change oro to jakarta-oro in BR/R + +* Tue Feb 08 2011 Fedora Release Engineering - 0:1.1.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Dec 23 2010 Stanislav Ochotnicky - 0:1.1.4-1 +- Update to 1.1.4 +- Migrate from tomca5 to tomca6 +- Versionless jars and javadocs +- Remove old skip-plugin patch +- Replace add-default-role-hint patch with remove-plexus-component patch +- Rename few jakarta BRs/Rs to apache names + +* Tue Sep 7 2010 Stanislav Ochotnicky - 0:1.1.3-1 +- New bugfix version +- Fix javadoc generation error +- Use %%{_mavenpomdir} macro +- Update BRs to latest maven plugin names +- Use new plexus-containers components +- Remove/update old patches + +* Tue May 25 2010 Alexander Kurtakov 0:1.1.2-3 +- Update for transitional maven state. +- Install doxia-modules pom. + +* Wed May 5 2010 Mary Ellen Foster 0:1.1.2-2 +- Add BuildRequirement on fop + +* Fri Feb 12 2010 Mary Ellen Foster 0:1.1.2-1 +- Update to 1.1.2 +- Add update_maven_depmap to post and postun +- Temporarily disable javadoc until maven2-plugin-javadoc is rebuilt against + the new doxia + +* Mon Dec 21 2009 Alexander Kurtakov 0:1.0-0.8.a10.4 +- BR maven2-plugin-plugin. + +* Mon Dec 21 2009 Alexander Kurtakov 0:1.0-0.8.a10.3 +- BR maven2-plugin-assembly. + +* Mon Dec 21 2009 Alexander Kurtakov 0:1.0-0.8.a10.2 +- BR maven-surefire-provider-junit. + +* Tue Sep 01 2009 Andrew Overholt 0:1.0-0.8.a10.1 +- Add tomcat5 BR + +* Tue Sep 01 2009 Andrew Overholt 0:1.0-0.8.a10 +- Add tomcat5-servlet-2.4-api BR + +* Tue Sep 01 2009 Andrew Overholt 0:1.0-0.7.a10 +- Fix plexus-cli BR version + +* Mon Aug 31 2009 Andrew Overholt 0:1.0-0.6.a10 +- Add itext and plexus-cli BRs + +* Wed Aug 26 2009 Andrew Overholt 0:1.0-0.5.a10 +- Update to 1.0 alpha 10 courtesy of Deepak Bhole +- Remove gcj support +- Add patch to build against iText 2.x (with back-ported XML classes) + +* Sat Jul 25 2009 Fedora Release Engineering - 0:1.0-0.4.a7.2.10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 0:1.0-0.3.a7.2.10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Aug 13 2008 Deepak Bhole 1.0-0.2.a7.2.10 +- Fix broken release tag + +* Wed Aug 13 2008 Deepak Bhole 1.0-0.2.a7.2.9 +- Build for ppc64 + +* Wed Jul 9 2008 Tom "spot" Callaway 1.0-0.2.a7.2.8 +- drop repotag + +* Thu May 29 2008 Tom "spot" Callaway 1.0-0.2.a7.2jpp.7 +- fix license tag + +* Thu Feb 28 2008 Deepak Bhole 1.0-0.2.a7.2jpp.6 +- Rebuild + +* Fri Sep 21 2007 Deepak Bhole 1.0-0.1.a7.3jpp.5 +- Build with maven +- ExcludeArch ppc64 + +* Sat Sep 01 2007 Deepak Bhole 0:1.0-0.1.a7.3jpp.4 +- Rebuild without maven (fpr initial ppc build) + +* Tue Mar 20 2007 Deepak Bhole 0:1.0-0.1.a7.3jpp.3 +- Added switch to ignore failures for the time being + +* Tue Mar 20 2007 Deepak Bhole 0:1.0-0.1.a7.3jpp.2 +- Build with maven + +* Tue Feb 27 2007 Tania Bento 0:1.0-0.1.a7.3jpp.1 +- Fixed %%Release. +- Fixed %%BuildRoot. +- Removed %%Vendor. +- Removed %%Distribution. +- Removed %%post and %%postun sections for javadoc. +- Fixed instructios on how to generate source drop. +- Fixed %%Summary. +- Added gcj support option. +- Marked configuration file as %%config(noreplace) in %%files section. + +* Tue Oct 17 2006 Deepak Bhole 1.0-0.a7.3jpp +- Update for maven2 9jpp + +* Fri Jun 23 2006 Deepak Bhole - 0:1.0-0.a7.2jpp +- Fix versions in the depmap + +* Wed Mar 15 2006 Deepak Bhole - 0:1.0-0.a7.1jpp +- Initial build