diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index e69de29..0000000 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..895b688 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +ditaa-0.9.r74.tar.xz +/v0.10.tar.gz diff --git a/Makefile b/Makefile deleted file mode 100644 index 6049265..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: ditaa -# $Id$ -NAME := ditaa -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/ditaa-0.9-port-to-batik-1.8.patch b/ditaa-0.9-port-to-batik-1.8.patch new file mode 100644 index 0000000..d61846c --- /dev/null +++ b/ditaa-0.9-port-to-batik-1.8.patch @@ -0,0 +1,31 @@ +diff --git a/src/org/stathissideris/ascii2image/graphics/ImageHandler.java b/src/org/stathissideris/ascii2image/graphics/ImageHandler.java +index 72470d1..d6a5a9d 100755 +--- a/src/org/stathissideris/ascii2image/graphics/ImageHandler.java ++++ b/src/org/stathissideris/ascii2image/graphics/ImageHandler.java +@@ -43,10 +43,10 @@ import javax.swing.JLabel; + import org.apache.batik.bridge.BridgeContext; + import org.apache.batik.bridge.GVTBuilder; + import org.apache.batik.bridge.UserAgentAdapter; +-import org.apache.batik.dom.svg.SAXSVGDocumentFactory; ++import org.apache.batik.anim.dom.SAXSVGDocumentFactory; + import org.apache.batik.dom.util.DocumentFactory; +-import org.apache.batik.ext.awt.image.codec.PNGEncodeParam; +-import org.apache.batik.ext.awt.image.codec.PNGImageEncoder; ++import org.apache.batik.ext.awt.image.codec.png.PNGEncodeParam; ++import org.apache.batik.ext.awt.image.codec.png.PNGImageEncoder; + import org.apache.batik.gvt.GraphicsNode; + import org.apache.batik.gvt.renderer.ConcreteImageRendererFactory; + import org.apache.batik.gvt.renderer.ImageRenderer; +diff --git a/src/org/stathissideris/ascii2image/graphics/OffScreenSVGRenderer.java b/src/org/stathissideris/ascii2image/graphics/OffScreenSVGRenderer.java +index 9bf1f38..527d174 100755 +--- a/src/org/stathissideris/ascii2image/graphics/OffScreenSVGRenderer.java ++++ b/src/org/stathissideris/ascii2image/graphics/OffScreenSVGRenderer.java +@@ -30,7 +30,7 @@ import java.io.StringReader; + import org.apache.batik.bridge.BridgeContext; + import org.apache.batik.bridge.GVTBuilder; + import org.apache.batik.bridge.UserAgentAdapter; +-import org.apache.batik.dom.svg.SAXSVGDocumentFactory; ++import org.apache.batik.anim.dom.SAXSVGDocumentFactory; + import org.apache.batik.gvt.GraphicsNode; + import org.apache.batik.gvt.renderer.ConcreteImageRendererFactory; + import org.apache.batik.gvt.renderer.ImageRenderer; diff --git a/ditaa.spec b/ditaa.spec new file mode 100644 index 0000000..0fe7aac --- /dev/null +++ b/ditaa.spec @@ -0,0 +1,192 @@ +Summary: Diagrams Through ASCII Art +Name: ditaa +Version: 0.10 +Release: 30%{?dist} +# Automatically converted from old format: GPLv2+ - review is highly recommended. +License: GPL-2.0-or-later +URL: http://ditaa.sourceforge.net/ +Source0: https://github.com/stathissideris/ditaa/archive/v%{version}.tar.gz +Source1: ditaa.wrapper +Patch0: ditaa-0.9-port-to-batik-1.8.patch +# Patch from Debian to build with JDK 10+ +Patch1: https://sources.debian.org/data/main/d/ditaa/0.10+ds1-1.2/debian/patches/remove-JavadocTaglet.patch +Patch2: jdk17.patch +BuildArch: noarch +ExclusiveArch: %{java_arches} noarch +BuildRequires: java-25-devel >= 1:1.6.0 +BuildRequires: ant-openjdk25 +BuildRequires: jpackage-utils +BuildRequires: batik +BuildRequires: jericho-html +BuildRequires: xml-commons-apis +BuildRequires: apache-commons-cli +Requires: apache-commons-cli +Requires: xml-commons-apis +Requires: jericho-html +Requires: batik +Requires: jpackage-utils +Requires: java-25-headless >= 1:1.6.0 + +%description +ditaa is a small command-line utility written in Java, that can +convert diagrams drawn using ASCII art ('drawings' that contain +characters that resemble lines like | / - ), into proper bitmap +graphics. + +%prep +%autosetup -p1 +find -name '*.class' -delete +find -name '*.jar' -delete + +%build +install -d bin +build-jar-repository -s -p lib commons-cli batik-all xml-commons-apis-ext jericho-html +ant -f build/release.xml + +%install +install -D -p -m 0644 releases/%{name}0_9.jar %{buildroot}%{_javadir}/%{name}.jar +install -D -p -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/%{name} + +%files +%doc COPYING HISTORY +%{_bindir}/%{name} +%{_javadir}/%{name}.jar + +%changelog +* Mon Jul 28 2025 jiri vanek - 0.10-30 +- Rebuilt for java-25-openjdk as preffered jdk + +* Wed Jul 23 2025 Fedora Release Engineering - 0.10-29 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Thu Jan 16 2025 Fedora Release Engineering - 0.10-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Thu Jul 25 2024 Miroslav Suchý - 0.10-27 +- convert license to SPDX + +* Wed Jul 17 2024 Fedora Release Engineering - 0.10-26 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Mon Jul 01 2024 Terje Rosten - 0.10-25 +- Use autosetup macro + +* Tue Feb 27 2024 Jiri Vanek - 0.10-24 +- Rebuilt for java-21-openjdk as system jdk + +* Wed Jan 24 2024 Fedora Release Engineering - 0.10-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jan 19 2024 Fedora Release Engineering - 0.10-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Jul 19 2023 Fedora Release Engineering - 0.10-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jan 19 2023 Fedora Release Engineering - 0.10-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - 0.10-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Fri Jul 08 2022 Jiri Vanek - 0.10-18 +- Rebuilt for Drop i686 JDKs + +* Sat Feb 05 2022 Jiri Vanek - 0.10-17 +- changed bytecode level to 8 + +* Sat Feb 05 2022 Jiri Vanek - 0.10-16 +- Rebuilt for java-17-openjdk as system jdk + +* Thu Jan 20 2022 Fedora Release Engineering - 0.10-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Wed Jul 21 2021 Fedora Release Engineering - 0.10-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - 0.10-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Jul 27 2020 Fedora Release Engineering - 0.10-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sun Jul 19 2020 Terje Rosten - 0.10-11 +- Add patch from Debian to build with JDK 10+ + +* Fri Jul 10 2020 Jiri Vanek - 0.10-10 +- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 + +* Tue Jan 28 2020 Fedora Release Engineering - 0.10-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Jul 24 2019 Fedora Release Engineering - 0.10-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jan 31 2019 Fedora Release Engineering - 0.10-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Jul 12 2018 Fedora Release Engineering - 0.10-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 0.10-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 0.10-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 0.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Feb 03 2016 Fedora Release Engineering - 0.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Aug 31 2015 Terje Rosten - 0.10-1 +- 0.10 +- New upstream location + +* Mon Aug 31 2015 Michal Srb - 0.9-15.r74 +- Fix FTBFS (Resolves: rhbz#1239429) + +* Wed Jun 17 2015 Fedora Release Engineering - 0.9-14.r74 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 0.9-13.r74 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri Mar 28 2014 Michael Simacek - 0.9-12.r74 +- Use Requires: java-headless rebuild (#1067528) + +* Tue Oct 22 2013 Terje Rosten - 0.9-11.r74 +- Switch to unversioned jar (bz #1022093) + +* Sat Aug 03 2013 Fedora Release Engineering - 0.9-10.r74 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Feb 13 2013 Fedora Release Engineering - 0.9-9.r74 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Jul 18 2012 Fedora Release Engineering - 0.9-8.r74 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon May 07 2012 Terje Rosten - 0.9-7.r74 +- Switch from jakarta- to apache- (bz #818492) + +* Fri Jan 13 2012 Fedora Release Engineering - 0.9-6.r74 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Feb 08 2011 Fedora Release Engineering - 0.9-5.r74 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Jul 26 2010 Terje Rosten - 0.9-4.r74 +- Pull sources from svn do get working ditaa using system jericho + +* Tue Jun 22 2010 Terje Rosten - 0.9-3 +- Use system jericho-html + +* Mon Jun 21 2010 Terje Rosten - 0.9-2 +- Be more generic about jdk 1.6 buildreq +- Add req on jdk 1.6 +- Include some jars to wrapper + +* Sun Jun 20 2010 Terje Rosten - 0.9-1 +- initial build diff --git a/ditaa.wrapper b/ditaa.wrapper new file mode 100644 index 0000000..20e9c77 --- /dev/null +++ b/ditaa.wrapper @@ -0,0 +1,11 @@ +#! /bin/bash +# + +source /usr/share/java-utils/java-functions + +MAIN_CLASS=org.stathissideris.ascii2image.core.CommandLineConverter +BASE_JARS="ditaa commons-cli xml-commons-apis batik" + +set_classpath $BASE_JARS + +run "$@" diff --git a/jdk17.patch b/jdk17.patch new file mode 100644 index 0000000..82472b6 --- /dev/null +++ b/jdk17.patch @@ -0,0 +1,12 @@ +--- a/build/release.xml ++++ a/build/release.xml +@@ -35,7 +35,7 @@ + + + +- ++ + + + + diff --git a/remove-JavadocTaglet.patch b/remove-JavadocTaglet.patch new file mode 100644 index 0000000..996d809 --- /dev/null +++ b/remove-JavadocTaglet.patch @@ -0,0 +1,345 @@ +From: Markus Koschany +Date: Wed, 13 Jun 2018 22:58:25 +0200 +Subject: remove JavadocTaglet + +Remove JavadocTaglet class because the Taglet class has been removed in +Java 10. + +Bug-Debian: https://bugs.debian.org/897494 +--- + .../ascii2image/core/JavadocTaglet.java | 326 --------------------- + 1 file changed, 326 deletions(-) + delete mode 100644 src/org/stathissideris/ascii2image/core/JavadocTaglet.java + +diff --git a/src/org/stathissideris/ascii2image/core/JavadocTaglet.java b/src/org/stathissideris/ascii2image/core/JavadocTaglet.java +deleted file mode 100644 +index f1642ef..0000000 +--- a/src/org/stathissideris/ascii2image/core/JavadocTaglet.java ++++ /dev/null +@@ -1,326 +0,0 @@ +-/* +- * Text Diagram Taglet +- * +- * Copyright (C) 2006 Nordic Growth Market NGM AB, +- * Mikael Brannstrom. +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +- * +- */ +-package org.stathissideris.ascii2image.core; +- +-import com.sun.javadoc.ProgramElementDoc; +-import com.sun.javadoc.Tag; +-import com.sun.tools.doclets.Taglet; +-import com.sun.tools.doclets.internal.toolkit.Configuration; +-import com.sun.tools.doclets.standard.Standard; +-import java.awt.image.RenderedImage; +-import java.io.File; +-import java.io.IOException; +-import java.io.UnsupportedEncodingException; +-import java.lang.reflect.Field; +-import java.lang.reflect.Method; +-import java.util.Map; +-import java.util.regex.Pattern; +-import javax.imageio.ImageIO; +- +-import org.stathissideris.ascii2image.text.TextGrid; +-import org.stathissideris.ascii2image.graphics.Diagram; +-import org.stathissideris.ascii2image.core.ConversionOptions; +-import org.stathissideris.ascii2image.graphics.BitmapRenderer; +- +-/** This class is a custom Javadoc taglet for embedding ditaa diagrams in +- * javadoc comments. The tag is an inline which can be used in any javadoc +- * comment. The tag can also be used in package documentation and in the +- * overview. +- * This taglet assumes that the Standard Javadoc Doclet is being used. +- *

+- * The syntax is:
+- * +- * {@textdiagram diagram_name
+- * the ascii art diagram
+- * } +- *
+- *

+- * The diagram name will be used when generating the image, so that the image +- * can be referenced to somewhere else (by using an a-href HTML tag). The +- * diagram name can only contain letters, numbers and underscore. The name of +- * the generated image will become "<classname>-<diagram name>.png". +- *

+- * The syntax for the ditaa diagram is described at +- * http://ditaa.sourceforge.net/. +- *

+- * Note: The overview file needs to be named "overview.html" if it lies +- * in the source path, otherwise it is sufficient that it ends with ".html". +- * +- * @author Mikael Brannstrom +- */ +-public class JavadocTaglet implements Taglet { +- +- private static final String NAME = "textdiagram"; +- private static final Pattern FIGURE_NAME_PATTERN = Pattern.compile("\\w+"); +- +- private final File[] srcPath; +- private final File dstDir; +- +- private final boolean simpleMode; +- +- /** Creates a new instance of TextDiagramTaglet */ +- public JavadocTaglet() { +- +- String configSourcepath = null; +- String configDestDirName = null; +- // Try to get configuration +- try { +- // Do this: Configuration config = Standard.htmlDoclet.configuration(); +- Field htmlDocletField = Standard.class.getField("htmlDoclet"); +- Object htmlDoclet = htmlDocletField.get(null); // static field +- Method configurationMethod = htmlDoclet.getClass().getMethod("configuration", null); +- Object config = configurationMethod.invoke(htmlDoclet, null); +- // Do this: configSourcepath = config.sourcepath; +- Field sourcepathField = config.getClass().getField("sourcepath"); +- configSourcepath = (String)sourcepathField.get(config); +- // Do this: configDestDirName = config.destDirName; +- Field destDirNameField = config.getClass().getField("destDirName"); +- configDestDirName = (String)destDirNameField.get(config); +- } catch(Exception e) { +- warning("Could not setup taglet. Falling back to simple mode.\n"+e); +- } +- +- if(configDestDirName == null) { +- srcPath = null; +- dstDir = null; +- simpleMode = true; +- } else { +- // setup srcPath +- String[] srcPathStr = configSourcepath.split("[;:]"); +- srcPath = new File[srcPathStr.length]; +- for(int i=0; i"; +- } +- +- int i; +- if(i1 == -1 || i1 == -1) +- i = Math.max(i1, i2); +- else +- i = Math.min(i1, i2); +- +- figureName = text.substring(0, i); +- figureText = text.substring(i+1); +- +- if(!FIGURE_NAME_PATTERN.matcher(figureName).matches()) { +- error("Illegal "+getName()+" name: \""+figureName+"\""); +- } +- +- // Convert [d] to {d} where d can be 1 character and more +- figureText = figureText.replaceAll("\\[(\\w+)\\]", "{$1}"); +- +- if(simpleMode) { +- StringBuffer strBuf = new StringBuffer(); +- strBuf.append("

");
+-			strBuf.append(figureText);
+-			strBuf.append("
"); +- return strBuf.toString(); +- } else { +- File outputFile = getOutputFile(tag.position().file(), figureName); +- generateImage(figureText, outputFile); +- +- StringBuffer strBuf = new StringBuffer(); +- strBuf.append("\"");"); +- return strBuf.toString(); +- } +- } +- +- /** Returns null since this is an inline tag. +- */ +- public String toString(Tag[] tag) { +- return null; // should return null, this is an inline tag +- } +- +- /** Returns the path of the output file given +- * the source file and the diagram name. +- * @param srcFile the source file which contains the tag +- * @param name the diagram name that will be used for generating the output +- * filename. +- */ +- private File getOutputFile(File srcFile, String name) { +- String relPath = getRelativePath(srcFile); +- +- // Special hack for the overview file +- if(srcFile.getName().toLowerCase().equals("overview.html") || +- (relPath == null && srcFile.getName().toLowerCase().endsWith(".html"))) { +- relPath = "overview"; +- } +- +- if(relPath == null) { +- error("The file is not relative to the source path: "+srcFile); +- } +- +- // get the filename and dirname +- String dirname=null, filename=null; +- int i = relPath.lastIndexOf(File.separatorChar); +- if(i == -1) { +- filename = relPath; +- } else if(i == 0) { +- filename = relPath.substring(1); +- } else { +- filename = relPath.substring(i+1); +- dirname = relPath.substring(0, i); +- } +- +- // skip file ending in filename +- i = filename.lastIndexOf('.'); +- if(i != -1) +- filename = filename.substring(0, i); +- +- String path; +- if(dirname == null) { +- path = filename; +- } else { +- path = dirname+File.separator+filename; +- } +- +- return new File(dstDir, path+"-"+name+".png"); +- } +- +- /** Returns the relative path of a (source) file. +- * The path is relative to one of the source dirs specified to the +- * standard doclet. +- * @returns the relative path. If a relative path could not be found +- * null is returned. +- */ +- private String getRelativePath(File file) { +- file = file.getAbsoluteFile(); +- try { +- file = file.getCanonicalFile(); +- } catch (IOException ex) { +- warning("Could not get canonical path of file: "+file); +- } +- String filePath = file.getAbsolutePath(); +- for(int i=0; i