From 4ab60aa8d42a46be6968480988e8a8b62cea13f02ea3ab9ae8914c35c84b4b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Sat, 4 May 2024 02:10:05 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main xmlgraphics-batik revision 8be133fab5c464f0137b6eb81cd20f51 --- .gitattributes | 23 ++ 0001-Fix-imageio-codec-lookup.patch | 25 ++ batik-build.tar.xz | 3 + batik-src-1.17.tar.gz | 3 + xmlgraphics-batik-nolinksinjavadoc.patch | 12 + xmlgraphics-batik.changes | 329 ++++++++++++++++++++++ xmlgraphics-batik.security.policy | 4 + xmlgraphics-batik.spec | 334 +++++++++++++++++++++++ 8 files changed, 733 insertions(+) create mode 100644 .gitattributes create mode 100644 0001-Fix-imageio-codec-lookup.patch create mode 100644 batik-build.tar.xz create mode 100644 batik-src-1.17.tar.gz create mode 100644 xmlgraphics-batik-nolinksinjavadoc.patch create mode 100644 xmlgraphics-batik.changes create mode 100644 xmlgraphics-batik.security.policy create mode 100644 xmlgraphics-batik.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/0001-Fix-imageio-codec-lookup.patch b/0001-Fix-imageio-codec-lookup.patch new file mode 100644 index 0000000..23fd81f --- /dev/null +++ b/0001-Fix-imageio-codec-lookup.patch @@ -0,0 +1,25 @@ +From 02e469f660450b37300984ad7ac258dfa0111baa Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Fri, 27 Nov 2015 15:35:57 +0100 +Subject: [PATCH] Fix imageio codec lookup + +--- + .../java/org/apache/batik/transcoder/image/PNGTranscoder.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/batik-transcoder/src/main/java/org/apache/batik/transcoder/image/PNGTranscoder.java b/batik-transcoder/src/main/java/org/apache/batik/transcoder/image/PNGTranscoder.java +index c25804e..7ea8c26 100644 +--- a/batik-transcoder/src/main/java/org/apache/batik/transcoder/image/PNGTranscoder.java ++++ b/batik-transcoder/src/main/java/org/apache/batik/transcoder/image/PNGTranscoder.java +@@ -116,7 +116,7 @@ public class PNGTranscoder extends ImageTranscoder { + "org.apache.batik.ext.awt.image.codec.png.PNGTranscoderInternalCodecWriteAdapter"); + if (adapter == null) { + adapter = getWriteAdapter( +- "org.apache.batik.transcoder.image.PNGTranscoderImageIOWriteAdapter"); ++ "org.apache.batik.ext.awt.image.codec.imageio.PNGTranscoderImageIOWriteAdapter"); + } + if (adapter == null) { + throw new TranscoderException( +-- +2.17.0 + diff --git a/batik-build.tar.xz b/batik-build.tar.xz new file mode 100644 index 0000000..7a73559 --- /dev/null +++ b/batik-build.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ced40cc9700c67da74db56a647c8c5e6fc9498bb0462372c113c387190bd767 +size 10132 diff --git a/batik-src-1.17.tar.gz b/batik-src-1.17.tar.gz new file mode 100644 index 0000000..730ef62 --- /dev/null +++ b/batik-src-1.17.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:555a9b1cbfa2cc7cd69b35cb46ad28e8a06befb1d5d2465de56ef3f1ddbbc11e +size 13578640 diff --git a/xmlgraphics-batik-nolinksinjavadoc.patch b/xmlgraphics-batik-nolinksinjavadoc.patch new file mode 100644 index 0000000..dc557f4 --- /dev/null +++ b/xmlgraphics-batik-nolinksinjavadoc.patch @@ -0,0 +1,12 @@ +--- batik-1.10/build.xml 2018-05-11 14:00:20.000000000 +0200 ++++ batik-1.10/build.xml 2019-01-20 07:21:04.538559085 +0100 +@@ -2435,9 +2435,6 @@ + + + +- +- +- + + + diff --git a/xmlgraphics-batik.changes b/xmlgraphics-batik.changes new file mode 100644 index 0000000..21ac244 --- /dev/null +++ b/xmlgraphics-batik.changes @@ -0,0 +1,329 @@ +------------------------------------------------------------------- +Fri Mar 1 19:02:03 UTC 2024 - Fridrich Strba + +- Upgrade to version 1.17 + * BATIK-1346: Allow configuration of rhino whitelist + * BATIK-1347: Switch to empty whitelist for rhino (CVE-2022-44730) + * BATIK-1349: Block loading external resource by default + (CVE-2022-44729) +- Upgrade to version 1.16 + * Java 8 or later is minimum runtime required + * BATIK-1338: Block loading jar inside svg (CVE-2022-41704, + bsc#1204704) + * BATIK-1345: Restrict what java classes can be run thru rhino + (CVE-2022-42890, bsc#1204709) +- Removed patch: + * xmlgraphics-batik-nosourcetarget.patch + + not needed since Java 8 compatibility is now the default + +------------------------------------------------------------------- +Thu Feb 29 07:18:22 UTC 2024 - Fridrich Strba + +- Allow building with this spec-file on systems that don't have the + mvn_install_pom macros defined and release version requirement + of javapackages-local +- Require the xmlgraphics-commons, xml-commons-apis a rhino by their + names, since they are on the classpath by their location in the + scripts. Require them in the subpackages that contain the scripts. +- Require javapackages-tools in subpackages that contain scripts + created by jpackage_script macro. The scripts need functions from + javapackages-tools + +------------------------------------------------------------------- +Wed Feb 21 10:55:53 UTC 2024 - Gus Kenion + +- Use %patch -P N instead of deprecated %patchN. + +------------------------------------------------------------------- +Wed Oct 25 15:07:46 UTC 2023 - Fridrich Strba + +- Build with source and target levels 8 +- Added patch: + * xmlgraphics-batik-nosourcetarget.patch + + do not hardcode source/target 1.7 + +------------------------------------------------------------------- +Wed Jun 28 14:27:24 UTC 2023 - Fridrich Strba + +- Remove the optional dependency on jython + * fixes new build cycles + +------------------------------------------------------------------- +Fri Sep 23 07:28:24 UTC 2022 - Fridrich Strba + +- Upgrade to version 1.15 + * BATIK-1260: Java 11 module error + * BATIK-1321: Remove Xerces + * BATIK-1299: Batik-all jar has all classes so should not pull + other jars also + * BATIK-1329: Remove xalan + * BATIK-1331, bsc#1203674, CVE-2022-38398: Jar url should be + blocked by DefaultExternalResourceSecurity + * BATIK-1333, bsc#1203673, CVE-2022-38648: Block external resource + before calling fop + * BATIK-1335, bsc#1203672, CVE-2022-40146: Jar url should be + blocked by DefaultScriptSecurity + +------------------------------------------------------------------- +Sun Mar 20 07:25:00 UTC 2022 - Fridrich Strba + +- Build with source/target levels 8 + +------------------------------------------------------------------- +Tue Feb 2 17:56:50 UTC 2021 - Jan Engelhardt + +- Set buildshell to bash for "<<<". + +------------------------------------------------------------------- +Sun Jan 24 17:54:37 UTC 2021 - Fridrich Strba + +- Upgrade to version 1.14 + * Fixes bsc#1182748, CVE-2020-11987 + * BATIK-1284: Dont load DTDs in NodePickerPanel + * BATIK-1292: Remove console message "About to transcoder source + of type: ..." + +------------------------------------------------------------------- +Tue Jun 16 13:00:51 UTC 2020 - Fridrich Strba + +- Upgrade to version 1.13 + * Fixes bsc#1172961, CVE-2019-17566 + * BATIK-1276: Allow blocking of external resources + * BATIK-1275: Refactor shared resources. + +------------------------------------------------------------------- +Fri Apr 3 09:26:49 UTC 2020 - Fridrich Strba + +- Upgrade to version 1.12 + * Java 7 or later is minimum runtime required + * BATIK-1203: ImageTagRegistry forgets to reinitialize cache + * BATIK-1251: Correct policy file in Squiggle + * BATIK-1253: build.sh referenced from build.xml + * BATIK-1257: Rasterizer - insufficient permissions when + transcoding to PDF + * BATIK-1272: Update Xerces to 2.12 + * BATIK-1232: Zip release should use mvn jars + * BATIK-1233: Add policy file for batik-rasterizer + * BATIK-1234: Tools cannot be run using java -jar xxx.jar when + built with Maven + * BATIK-1240: Java 11 compile error + * BATIK-1249: Fix Java 11 module error +- Remove the *.script files and generate the scripts using the + %%jpackage_script macro +- Generate an ant build system from the maven poms and use it for + the first phase build +- Removed patches: + * xmlgraphics-batik-manifests.patch + + The manifests are now generated in the first phase build + * xmlgraphics-batik-policy.patch + + We override the policy setting by granting all rights to + svgbrowser and to rasterizer + * xmlgraphics-batik-securitymanager.patch + + Integrated upstream + +------------------------------------------------------------------- +Mon Mar 16 13:43:43 UTC 2020 - Fridrich Strba + +- Modified patch: + * xmlgraphics-batik-manifests.patch + + Extend the bundle manifest so that it is useful for eclipse + +------------------------------------------------------------------- +Sun Jan 20 20:35:14 UTC 2019 - Fridrich Strba + +- Upgrade to version 1.10 + * BATIK-906: Should never use Error to report runtime errors + * BATIK-1123: Missing import of ImportInfo class + * BATIK-1125: Rasterizer fails with base64 embedded png + * BATIK-1140: Show line numbers on exception + * BATIK-1142: Remove e.printStackTrace for BridgeException in + SVGAbstractTranscoder + * BATIK-1157: Wrong value for default JPEG quality in + documentation + * BATIK-1170: Incorrect ColorConvertOp alpha handling breaks + masking + * BATIK-1196: Run batik tests from junit + * BATIK-1197: Make jython and rhino optional + * BATIK-1198: TIFF transcoder looks for invalid class name for its + WriteAdapter + * BATIK-1200: ImagingOpException: Unable to transform src image + * BATIK-1204: Remove hashtable + * BATIK-1212: Show real error on URL failure + * BATIK-1216: Compile error on Java 10 + * BATIK-1222: Only call DOMImplementation in deserialization +- Split the css-jar into a separate package +- Install maven pom files. +- Added patches: + * 0001-Fix-imageio-codec-lookup.patch + + PNG transcoder looks for invalid class name for its + WriteAdapter + * xmlgraphics-batik-nolinksinjavadoc.patch + + Fix javadoc generation by not loading URL links. +- Modified patch: + * xmlgraphics-batik-manifests.patch + + Add Bundle-SymbolicName and Bundle-Version manifest entries + + Add targets for jar files produced by maven build and not + produced by the ant one. Produce them when target jars is + called. + +------------------------------------------------------------------- +Wed Nov 7 20:47:58 UTC 2018 - Fridrich Strba + +- Do not depend on a particular xml-commons-apis provider. + +------------------------------------------------------------------- +Wed Jul 11 10:21:58 UTC 2018 - fstrba@suse.com + +- Added patch: + * xmlgraphics-batik-securitymanager.patch + + Fix build with jdk11 + + Replace use of SecurityManager::checkSystemClipboardAccess + by check for AWTPermission("accessClipboard") +- Run fdupes on relevant directories + +------------------------------------------------------------------- +Fri May 19 15:45:22 UTC 2017 - tchvatal@suse.com + +- Version update to batik 1.9: + * No obvious upstream changelog +- Refresh patch xmlgraphics-batik-manifests.patch +- Refresh patch xmlgraphics-batik-policy.patch + +------------------------------------------------------------------- +Fri May 19 11:09:42 UTC 2017 - vsistek@suse.com + +- Add BuildRequires: javapackages-local (for maven conversions) + +------------------------------------------------------------------- +Mon Mar 20 15:16:57 UTC 2017 - sknorr@suse.com + +- Needed as a dependency for FOP 2.1 (FATE#322405) + +------------------------------------------------------------------- +Fri Mar 4 14:05:13 UTC 2016 - fvogt@suse.com + +- Update to batik-1.8: + batik-src-1.7.zip -> batik-src-1.8.tar.gz +- Update xmlgraphics-batik-manifests.patch +- Refresh xmlgraphics-batik-policy.patch + +------------------------------------------------------------------- +Mon Dec 8 13:03:34 UTC 2014 - tchvatal@suse.com + +- spec-cleanify + +------------------------------------------------------------------- +Fri Dec 5 12:39:52 UTC 2014 - p.drouand@gmail.com + +- Use javapackages-tools instead of java-devel + +------------------------------------------------------------------- +Fri Jun 27 11:17:48 UTC 2014 - tchvatal@suse.com + +- Specify targets to build on sle11. + +------------------------------------------------------------------- +Thu Sep 12 19:08:45 UTC 2013 - tchvatal@suse.com + +- Kill javadoc to remove unresolvables. + +------------------------------------------------------------------- +Mon Sep 9 11:06:29 UTC 2013 - tchvatal@suse.com + +- Move from jpackage-utils to javapackage-tools + +------------------------------------------------------------------- +Fri Apr 5 09:00:58 UTC 2013 - idonmez@suse.com + +- Add Source URL, see https://en.opensuse.org/SourceUrls + +------------------------------------------------------------------- +Wed Nov 3 08:56:40 UTC 2010 - mvyskocil@suse.cz + +- merge with xmlgraphics-batik-1.7-5.jpp5.src.rpm + +------------------------------------------------------------------- +Tue Mar 30 11:20:58 UTC 2010 - mvyskocil@suse.cz + +- enable batik-all.jar to ensure swingx (-> netbeans) build + +------------------------------------------------------------------- +Tue Nov 3 19:09:07 UTC 2009 - coolo@novell.com + +- updated patches to apply with fuzz=0 + +------------------------------------------------------------------- +Mon Aug 31 15:08:12 CEST 2009 - ro@suse.de + +- fix archive compression + +------------------------------------------------------------------- +Wed May 15 08:33:00 CET 2008 - toms@suse.de + +- Fixed errors in build by correction build.xml.patch: + Replaced target="1.5" with target="1.4" +- Cleaned up SPEC file a bit + +------------------------------------------------------------------- +Wed Mar 5 12:05:40 CET 2008 - toms@suse.de + +- Fixed BuildRequires + +------------------------------------------------------------------- +Fri Feb 29 09:20:30 CET 2008 - toms@suse.de + +- Removed from samples/tests/spec/fonts/ directory due to license issues: + fontAltGlyph.svg, fontAltGlyph3.svg, fontChoice.svg, fontDecorations.svg, + fontGlyphChoice.svg, fontGlyphsBoth.svg, fontGlyphsChildSVG.svg, + fontGlyphsD.svg, fontKerning.svg, fontStyling.svg and + samples/tests/spec/scripting/textcontent/missing-glpyh.svg + +------------------------------------------------------------------- +Tue Jan 29 15:13:23 CET 2008 - toms@suse.de + +- Added additional source and created subpackage -javadoc + +------------------------------------------------------------------- +Mon Jan 28 08:33:41 CET 2008 - toms@suse.de + +- Reorganised installation directory: Installed all jar files under + %{_javadir} and created link from %{_datadir}/%{name} +- Corrected *sh.in files + +------------------------------------------------------------------- +Wed Aug 29 14:54:05 CEST 2007 - toms@suse.de + +- Removed samples/tests/spec/scripting/textcontent/missing-glpyh.svg + due to license issues + +------------------------------------------------------------------- +Tue Aug 21 13:35:07 CEST 2007 - toms@suse.de + +- Updated to version 1.7 + Removed samples/fonts directory + +------------------------------------------------------------------- +Wed May 23 16:42:59 CEST 2007 - toms@suse.de + +- Corrected sh files (missing #), improved SPEC file + +------------------------------------------------------------------- +Fri Mar 30 14:49:53 CEST 2007 - toms@suse.de + +- Removed samples subdirectory + +------------------------------------------------------------------- +Fri Mar 30 11:01:57 CEST 2007 - toms@suse.de + +- Added unzip to BuildRequires + +------------------------------------------------------------------- +Thu Mar 29 16:37:26 CEST 2007 - toms@suse.de + +- Corrected *-sh files + +------------------------------------------------------------------- +Thu Mar 29 15:38:02 CEST 2007 - toms@suse.de + +- First inital version of 1.6 + diff --git a/xmlgraphics-batik.security.policy b/xmlgraphics-batik.security.policy new file mode 100644 index 0000000..5c2387a --- /dev/null +++ b/xmlgraphics-batik.security.policy @@ -0,0 +1,4 @@ +grant { + permission java.security.AllPermission; +}; + diff --git a/xmlgraphics-batik.spec b/xmlgraphics-batik.spec new file mode 100644 index 0000000..de8aef4 --- /dev/null +++ b/xmlgraphics-batik.spec @@ -0,0 +1,334 @@ +# +# spec file for package xmlgraphics-batik +# +# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2000-2008, JPackage Project +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{!?mvn_install_pom:%global mvn_install_pom install -pm 0644} +%define _buildshell /bin/bash +%global classpath xmlgraphics-batik:rhino:xml-commons-apis:xml-commons-apis-ext:xmlgraphics-commons +Name: xmlgraphics-batik +Version: 1.17 +Release: 0 +Summary: Scalable Vector Graphics for Java +License: Apache-2.0 +Group: Productivity/Graphics/Vector Editors +URL: https://xml.apache.org/batik/ +Source0: http://archive.apache.org/dist/xmlgraphics/batik/source/batik-src-%{version}.tar.gz +Source1: batik-build.tar.xz +Source7: %{name}.security.policy +Patch0: %{name}-nolinksinjavadoc.patch +Patch1: 0001-Fix-imageio-codec-lookup.patch +BuildRequires: ant +BuildRequires: fdupes +BuildRequires: java-devel >= 1.8 +BuildRequires: javapackages-local +BuildRequires: rhino >= 1.6 +BuildRequires: xml-commons-apis >= 1.3.03 +BuildRequires: xmlgraphics-commons +Requires: %{name}-css = %{version}-%{release} +Obsoletes: batik < %{version}-%{release} +Provides: batik = %{version}-%{release} +BuildArch: noarch + +%description +Batik is a Java(tm) technology based toolkit for applications that want +to use images in the Scalable Vector Graphics (SVG) format for various +purposes, such as viewing, generation or manipulation. + +%package css +Summary: Batik CSS engine +Group: Productivity/Graphics/Vector Editors +Requires: %{name} = %{version}-%{release} +Obsoletes: batik-css < %{version}-%{release} +Provides: batik-css = %{version}-%{release} + +%description css +CSS component of the Apache Batik SVG manipulation and rendering library. + +%package squiggle +Summary: Batik SVG browser +Group: Productivity/Graphics/Vector Editors +Requires: %{name} = %{version}-%{release} +Requires: javapackages-tools +Requires: rhino +Requires: xml-commons-apis +Requires: xmlgraphics-commons +Obsoletes: batik-squiggle < %{version}-%{release} +Provides: batik-squiggle = %{version}-%{release} + +%description squiggle +The Squiggle SVG Browser lets you view SVG file, zoom, pan and rotate +in the content and select text items in the image and much more. + +%package svgpp +Summary: Batik SVG pretty printer +Group: Productivity/Graphics/Vector Editors +Requires: %{name} = %{version}-%{release} +Requires: javapackages-tools +Requires: rhino +Requires: xml-commons-apis +Requires: xmlgraphics-commons +Obsoletes: batik-svgpp < %{version}-%{release} +Provides: batik-svgpp = %{version}-%{release} + +%description svgpp +The SVG Pretty Printer lets developers "pretty-up" their SVG files and +get their tabulations and other cosmetic parameters in order. It can +also be used to modify the DOCTYPE declaration on SVG files. + +%package ttf2svg +Summary: Batik SVG font converter +Group: Productivity/Graphics/Vector Editors +Requires: %{name} = %{version}-%{release} +Requires: javapackages-tools +Requires: rhino +Requires: xml-commons-apis +Requires: xmlgraphics-commons +Obsoletes: batik-ttf2svg < %{version}-%{release} +Provides: batik-ttf2svg = %{version}-%{release} + +%description ttf2svg +The SVG Font Converter lets developers convert character ranges from +the True Type Font format to the SVG Font format to embed in SVG +documents. This allows SVG document to be fully self-contained be +rendered exactly the same on all systems. + +%package rasterizer +Summary: Batik SVG rasterizer +Group: Productivity/Graphics/Vector Editors +Requires: %{name} = %{version}-%{release} +Requires: javapackages-tools +Requires: rhino +Requires: xml-commons-apis +Requires: xmlgraphics-commons +Obsoletes: batik-rasterizer < %{version}-%{release} +Provides: batik-rasterizer = %{version}-%{release} + +%description rasterizer +The SVG Rasterizer is a utility that can convert SVG files to a raster +format. The tool can convert individual files or sets of files, making +it easy to convert entire directories of SVG files. The supported +formats are JPEG, PNG, and TIFF, however the design allows new formats +to be added easily. + +%package slideshow +Summary: Batik SVG slideshow +Group: Productivity/Graphics/Vector Editors +Requires: %{name} = %{version}-%{release} +Requires: javapackages-tools +Requires: rhino +Requires: xml-commons-apis +Requires: xmlgraphics-commons +Obsoletes: batik-slideshow < %{version}-%{release} +Provides: batik-slideshow = %{version}-%{release} + +%description slideshow +Batik SVG slideshow. + +%package javadoc +Summary: Javadoc for %{name} +Group: Documentation/HTML +Obsoletes: batik-javadoc < %{version}-%{release} +Provides: batik-javadoc = %{version}-%{release} + +%description javadoc +Javadoc for %{name}. + +%package demo +Summary: Demo for %{name} +Group: Productivity/Graphics/Vector Editors +Requires: %{name} = %{version}-%{release} +Obsoletes: batik-demo < %{version}-%{release} +Provides: batik-demo = %{version}-%{release} + +%description demo +Demonstrations and samples for %{name}. + +%prep +%setup -q -n batik-%{version} -a1 + +find -name '*.class' -delete +find -name '*.jar' -delete + +%patch -P 0 -p1 +%patch -P 1 -p1 + +cp -p %{SOURCE7} batik-svgrasterizer/src/main/resources/org/apache/batik/apps/rasterizer/resources/rasterizer.policy +cp -p %{SOURCE7} batik-svgbrowser/src/main/resources/org/apache/batik/apps/svgbrowser/resources/svgbrowser.policy + +# eclipse expects xmlgraphics to be optional +%pom_xpath_inject 'pom:dependency[pom:artifactId="xmlgraphics-commons"]' 'true' batik-css + +for pom in `find -mindepth 2 -name pom.xml -not -path ./batik-all/pom.xml`; do + %pom_add_plugin org.apache.felix:maven-bundle-plugin $pom " + true + + + org.apache.batik.$(sed 's:./batik-::;s:/pom.xml::' <<< $pom) + + + " + %pom_xpath_inject pom:project 'bundle' $pom +done + +# for eclipse +%pom_xpath_set pom:Bundle-SymbolicName org.apache.batik.util.gui batik-gui-util + +%pom_remove_dep :jython batik-script +rm -rf batik-script/src/main/java/org/apache/batik/script/jpython + +%pom_disable_module batik-test-old + +build-jar-repository -s lib js xml-apis xml-commons-apis-ext xmlgraphics-commons + +%build +export CLASSPATH= +export OPT_JAR_LIST=: +%{ant} \ + -f build-batik.xml -Dtest.skip=true \ + package +%{ant} \ + all-jar jars javadoc + +%install + +# jars +mkdir -p %{buildroot}%{_javadir}/%{name} + +for dir in batik-%{version} batik-%{version}/lib batik-%{version}/extensions; do + pushd ${dir} + for jar in batik-*.jar; do + basename=`basename ${jar} .jar` + name=`echo ${basename} | sed -e 's/batik-//' | sed -e 's/-%{version}//' ` + cp -p ${jar} %{buildroot}%{_javadir}/%{name}/${name}.jar + done + popd +done + +for pkg in squiggle squiggle-ext svgpp ttf2svg rasterizer rasterizer-ext slideshow; do + ln -s %{name}/${pkg}.jar %{buildroot}%{_javadir}/batik-${pkg}.jar +done + +mv %{buildroot}%{_javadir}/%{name}/all.jar %{buildroot}%{_javadir}/%{name}-all.jar +ln -s %{name}-all.jar %{buildroot}%{_javadir}/batik-all.jar + +#pom +mkdir -p %{buildroot}%{_mavenpomdir}/%{name} + +%{mvn_install_pom} pom.xml %{buildroot}%{_mavenpomdir}/%{name}/parent.pom +%add_maven_depmap %{name}/parent.pom + +%{mvn_install_pom} batik-all/pom.xml %{buildroot}%{_mavenpomdir}/%{name}-all.pom +%add_maven_depmap %{name}-all.pom %{name}-all.jar + +for i in anim awt-util bridge codec constants dom ext extension gvt i18n parser script shared-resources svg-dom svgbrowser svggen svgrasterizer swing transcoder util gui-util xml; +do + %{mvn_install_pom} batik-${i}/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/${i}.pom + %add_maven_depmap %{name}/${i}.pom %{name}/${i}.jar +done + +cp -p batik-css/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/css.pom +%add_maven_depmap %{name}/css.pom %{name}/css.jar -f css + +cp -p batik-svgpp/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/svgpp.pom +%add_maven_depmap %{name}/svgpp.pom %{name}/svgpp.jar -f svgpp + +cp -p batik-ttf2svg/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/ttf2svg.pom +%add_maven_depmap %{name}/ttf2svg.pom %{name}/ttf2svg.jar -f ttf2svg + +cp -p batik-slideshow/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/slideshow.pom +%add_maven_depmap %{name}/slideshow.pom %{name}/slideshow.jar -f slideshow + +for i in squiggle squiggle-ext; +do + cp -p batik-${i}/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/${i}.pom + %add_maven_depmap %{name}/${i}.pom %{name}/${i}.jar -f squiggle +done + +for i in rasterizer rasterizer-ext; +do + cp -p batik-${i}/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/${i}.pom + %add_maven_depmap %{name}/${i}.pom %{name}/${i}.jar -f rasterizer +done + +# scripts +%jpackage_script org.apache.batik.apps.svgbrowser.Main '' '' %{classpath} %{name}-squiggle true +%jpackage_script org.apache.batik.apps.svgpp.Main '' '' %{classpath} %{name}-svgpp true +%jpackage_script org.apache.batik.apps.ttf2svg.Main '' '' %{classpath} %{name}-ttf2svg true +%jpackage_script org.apache.batik.apps.rasterizer.Main '' '' %{classpath} %{name}-rasterizer true +%jpackage_script org.apache.batik.apps.slideshow.Main '' '' %{classpath} %{name}-slideshow true + +# demo +mkdir -p %{buildroot}%{_datadir}/%{name} +cp -pr contrib samples test-resources \ + %{buildroot}%{_datadir}/%{name} +%fdupes -s %{buildroot}%{_datadir}/%{name} +ln -s %{name} %{buildroot}%{_datadir}/batik + +# policy +mkdir -p %{buildroot}%{_sysconfdir}/%{name} +cp -p %{SOURCE7} %{buildroot}%{_sysconfdir}/%{name}/rasterizer.policy + +# javadoc +mkdir -p %{buildroot}%{_javadocdir}/%{name} +cp -pr batik-%{version}/docs/javadoc/* %{buildroot}%{_javadocdir}/%{name} +%fdupes -s %{buildroot}%{_javadocdir}/%{name} + +%files -f .mfiles +%license LICENSE NOTICE +%doc KEYS MAINTAIN README +%{_javadir}/batik-all.jar + +%files css -f .mfiles-css + +%files squiggle -f .mfiles-squiggle +%{_javadir}/batik-squiggle-ext.jar +%{_javadir}/batik-squiggle.jar +%{_bindir}/%{name}-squiggle + +%files svgpp -f .mfiles-svgpp +%{_javadir}/batik-svgpp.jar +%{_bindir}/%{name}-svgpp + +%files ttf2svg -f .mfiles-ttf2svg +%{_javadir}/batik-ttf2svg.jar +%{_bindir}/%{name}-ttf2svg + +%files rasterizer -f .mfiles-rasterizer +%{_javadir}/batik-rasterizer.jar +%{_javadir}/batik-rasterizer-ext.jar +%{_bindir}/%{name}-rasterizer +%dir %{_sysconfdir}/%{name} +%config(noreplace) %{_sysconfdir}/%{name}/rasterizer.policy + +%files slideshow -f .mfiles-slideshow +%{_javadir}/batik-slideshow.jar +%{_bindir}/%{name}-slideshow + +%files demo +%{_datadir}/%{name} +%{_datadir}/batik +%exclude %{_datadir}/%{name}/contrib/rasterizertask/build.sh +%exclude %{_datadir}/%{name}/contrib/charts/convert.sh +%attr(0755,root,root) %{_datadir}/%{name}/contrib/rasterizertask/build.sh +%attr(0755,root,root) %{_datadir}/%{name}/contrib/charts/convert.sh + +%files javadoc +%license LICENSE NOTICE +%{_javadocdir}/%{name} + +%changelog