diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index 8fbb210..0000000 --- a/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -java_cup_v10k.tar.gz diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bfd0d32 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +java_cup_v10k.tar.gz +java_cup-0.11a.tar.bz2 +/java_cup-0.11b.tar.bz2 +/java_cup-0.11b.tar.zst diff --git a/0001-Adopt-build-script.patch b/0001-Adopt-build-script.patch new file mode 100644 index 0000000..4d476d5 --- /dev/null +++ b/0001-Adopt-build-script.patch @@ -0,0 +1,53 @@ +From d58d0d2cb2626b15077eaf902f16f7a6bca41933 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Wed, 16 Jul 2025 18:15:17 +0200 +Subject: [PATCH] Adopt build script + +--- + build.xml | 16 +--------------- + 1 file changed, 1 insertion(+), 15 deletions(-) + +diff --git a/build.xml b/build.xml +index 33f0c60..975e753 100644 +--- a/build.xml ++++ b/build.xml +@@ -17,18 +17,6 @@ + + + +- +- +- +- +- +- +- +- +- +- +- +- + + + +@@ -69,8 +57,7 @@ + token="+ version_str" + value='+ "v0.11b ${cupversion} (SVN rev ${svnversion})"'> + +- +- ++ + + + +@@ -78,7 +65,6 @@ + + + +- + + + +-- +2.50.1 + diff --git a/Makefile b/Makefile deleted file mode 100644 index b335b35..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: java_cup -# $Id: Makefile,v 1.1 2004/09/09 06:29:10 cvsdist Exp $ -NAME := java_cup -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 $$/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),) -# attempt 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/changelog b/changelog new file mode 100644 index 0000000..7e4d9d3 --- /dev/null +++ b/changelog @@ -0,0 +1,240 @@ +* Thu Jul 18 2024 Fedora Release Engineering - 1:0.11b-31 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Thu Feb 29 2024 Jiri Vanek - 1:0.11b-30 +- bump of release for for java-21-openjdk as system jdk + +* Tue Feb 27 2024 Jiri Vanek - 1:0.11b-29 +- Rebuilt for java-21-openjdk as system jdk + +* Wed Feb 21 2024 Marian Koncek - 1:0.11b-28 +- Set OpenJDK version to 1.8 + +* Wed Jan 24 2024 Fedora Release Engineering - 1:0.11b-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jan 20 2024 Fedora Release Engineering - 1:0.11b-26 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Sep 01 2023 Mikolaj Izdebski - 1:0.11b-25 +- Convert License tag to SPDX format + +* Thu Jul 20 2023 Fedora Release Engineering - 1:0.11b-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jan 19 2023 Fedora Release Engineering - 1:0.11b-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - 1:0.11b-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Feb 05 2022 Jiri Vanek - 1:0.11b-21 +- Rebuilt for java-17-openjdk as system jdk + +* Thu Jan 20 2022 Fedora Release Engineering - 1:0.11b-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Tue Nov 02 2021 Mikolaj Izdebski - 1:0.11b-19 +- Bump Java compiler source/target levels to 1.7 + +* Thu Jul 22 2021 Fedora Release Engineering - 1:0.11b-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Mon May 17 2021 Mikolaj Izdebski - 1:0.11b-17 +- Bootstrap build +- Non-bootstrap build + +* Tue Jan 26 2021 Fedora Release Engineering - 1:0.11b-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 1:0.11b-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Jul 10 2020 Jiri Vanek - 1:0.11b-14 +- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 + +* Thu Jun 25 2020 Roland Grunberg - 1:0.11b-13 +- Use source/target of 1.6 to build against Java 11. + +* Wed Jan 29 2020 Fedora Release Engineering - 1:0.11b-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Tue Nov 05 2019 Mikolaj Izdebski - 1:0.11b-10 +- Mass rebuild for javapackages-tools 201902 + +* Thu Jul 25 2019 Fedora Release Engineering - 1:0.11b-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri May 24 2019 Mikolaj Izdebski - 1:0.11b-9 +- Mass rebuild for javapackages-tools 201901 + +* Fri Feb 01 2019 Fedora Release Engineering - 1:0.11b-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 1:0.11b-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 1:0.11b-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Mon Sep 25 2017 Mikolaj Izdebski - 1:0.11b-7 +- Elimitate race condition when injecting JAR manifest +- Resolves: rhbz#1495233 + +* Wed Jul 26 2017 Fedora Release Engineering - 1:0.11b-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Mar 22 2017 Michael Simacek - 1:0.11b-5 +- Install with XMvn + +* Fri Feb 10 2017 Fedora Release Engineering - 1:0.11b-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 1:0.11b-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Dec 24 2015 gil cattaneo 1:0.11b-2 +- convert %%defines to %%global + +* Tue Jun 23 2015 Mikolaj Izdebski - 1:0.11b-1 +- Update to upstream version 0.11b + +* Wed Jun 17 2015 Fedora Release Engineering - 1:0.11a-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri Feb 06 2015 gil cattaneo 1:0.11a-19 +- introduce license macro + +* Sat Jun 07 2014 Fedora Release Engineering - 1:0.11a-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu May 29 2014 Mikolaj Izdebski - 1:0.11a-17 +- Use .mfiles generated during build + +* Tue Mar 04 2014 Stanislav Ochotnicky - 1:0.11a-16 +- Use Requires: java-headless rebuild (#1067528) + +* Sat Aug 31 2013 Mat Booth - 1:0.11a-15 +- Inject OSGi manifests into both jars. + +* Fri Aug 30 2013 Mat Booth - 1:0.11a-14 +- Patch so that generated action methods do not exceed the 65535 byte JVM + method size limit. Supplied by eclipse-pdt project. +- Drop rpm bug workaround scriptlet. + +* Sat Aug 03 2013 Fedora Release Engineering - 1:0.11a-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 1:0.11a-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Nov 13 2012 gil cattaneo 1:0.11a-11 +- adapt to current guideline +- add %%pre javadoc script + +* Tue Nov 13 2012 Tom Callaway - 1:0.11a-10 +- include copy of LICENSE, correct License tag + +* Thu Jul 19 2012 Fedora Release Engineering - 1:0.11a-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sun Jun 24 2012 Gerard Ryan - 1:0.11a-8 +- Inject OSGI Manifest for java-cup-runtime.jar + +* Fri Jan 13 2012 Fedora Release Engineering - 1:0.11a-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Feb 09 2011 Fedora Release Engineering - 1:0.11a-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sat Dec 04 2010 Lubomir Rintel 1:0.11a-5 +- Require appropriate packages for depmap maintenance in scriptlets +- Remove classpath from jar manifest + +* Mon Feb 15 2010 Alexander Kurtakov 1:0.11a-4 +- Add maven pom and depmap. + +* Wed Jan 20 2010 Alexander Kurtakov 1:0.11a-3 +- Fix bootstrap. + +* Sun Jan 17 2010 Miloš Jakubíček - 1:0.11a-2 +- Rebuilt in non-bootstrap mode (removed all prebuilt jars). +- Added BR: jflex and java_cup >= 1:0.11a for non-bootstrap mode +- Remove unnecessary R(post,postun): coreutils + +* Fri Jan 8 2010 Alexander Kurtakov 1:0.11a-1 +- Update to 0.11a. +- Drop gcj_support. + +* Fri Jul 24 2009 Fedora Release Engineering - 1:0.10k-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 1:0.10k-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Jul 15 2008 Lubomir Rintel - 1:0.10k-1 +- Fix the version to match upstream, so that FEver can be used + +* Wed Jul 9 2008 Tom "spot" Callaway - 1:0.10-0.k.6.3 +- drop repotag + +* Sun Feb 17 2008 Lubomir Kundrak - 1:0.10-0.k.6jpp.2 +- Ant task +- Clean up to satisfy QA script and rpmlint + +* Fri Aug 04 2006 Vivek Lakshmanan - 1:0.10-0.k.6jpp.1 +- Re-sync with latest version from JPP. +- Partially adopt new naming convention. + +* Sat Jul 22 2006 Jakub Jelinek - 1:0.10-0.k.5jpp_2fc +- Rebuilt + +* Thu Jul 20 2006 Vivek Lakshmanan - 1:0.10-0.k.5jpp_1fc +- Re-sync with latest version from JPP. + +* Wed Jul 19 2006 Vivek Lakshmanan - 1:0.10-0.k.4jpp_1fc +- Conditional native compilation for GCJ. + +* Wed Jul 12 2006 Jesse Keating - 1:0.10-0.k.1jpp_10fc +- rebuild + +* Mon Mar 6 2006 Jeremy Katz - 1:0.10-0.k.1jpp_9fc +- stop scriptlet spew + +* Fri Feb 10 2006 Jesse Keating - 1:0.10-0.k.1jpp_8fc +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 1:0.10-0.k.1jpp_7fc +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Tue Jan 3 2006 Jesse Keating 1:0.10-0.k.1jpp_6fc +- rebuilt again + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Tue Jul 19 2005 Gary Benson 1:0.10-0.k.1jpp_5fc +- Build on ia64, ppc64, s390 and s390x. +- Switch to aot-compile-rpm. + +* Tue Jun 28 2005 Gary Benson 1:0.10-0.k.1jpp_4fc +- BC-compile. + +* Tue Jun 21 2005 Gary Benson 1:0.10-0.k.1jpp_3fc +- Remove classes from the tarball. + +* Thu Nov 4 2004 Gary Benson 1:0.10-0.k.1jpp_2fc +- Build into Fedora. + +* Thu Mar 4 2004 Frank Ch. Eigler 1:0.10-0.k.1jpp_1rh +- RH vacuuming + +* Thu Jan 22 2004 David Walluck 1:0.10-0.k.1jpp +- fix version/release (bump epoch) +- change License tag from Free to BSD-style +- add Distribution tag +- really update for JPackage 1.5 + +* Wed Mar 26 2003 Paul Nasrat 0.10k-1jpp +- for jpackage-utils 1.5 +- New spec reverse engineered from binary rpms diff --git a/ci.fmf b/ci.fmf new file mode 100644 index 0000000..c5aa0e0 --- /dev/null +++ b/ci.fmf @@ -0,0 +1 @@ +resultsdb-testcase: separate diff --git a/cup-ant-task.patch b/cup-ant-task.patch deleted file mode 100644 index 55ca375..0000000 --- a/cup-ant-task.patch +++ /dev/null @@ -1,354 +0,0 @@ -diff -r -u -N java_cup_orig/AntTask.java java_cup/AntTask.java ---- java_cup_orig/AntTask.java 1970-01-01 10:00:00.000000000 +1000 -+++ java_cup/AntTask.java 2003-06-04 03:11:53.000000000 +1000 -@@ -0,0 +1,261 @@ -+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -+ * Ant task for CUP * -+ * Copyright (C) 2003 Gerwin Klein * -+ * All rights reserved. * -+ * * -+ * License: LGPL 2, http://www.gnu.org/copyleft/lesser.html * -+ * * -+ * This library is free software; you can redistribute it and/or * -+ * modify it under the terms of the GNU Lesser General Public * -+ * License as published by the Free Software Foundation; either * -+ * version 2 of the License, or (at your option) any later version. * -+ * * -+ * This library 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 * -+ * Lesser General Public License for more details. * -+ * * -+ * You should have received a copy of the GNU Lesser General Public * -+ * License along with this library; if not, write to the Free Software * -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA* -+ * * -+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -+ -+package java_cup; -+ -+import org.apache.tools.ant.Task; -+import org.apache.tools.ant.BuildException; -+ -+import java.io.*; -+ -+/* -+ Example build.xml file for using CUP with Ant (assumes that java_cup classes -+ are available in classpath): -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ */ -+ -+/** -+ * An Ant task class for CUP, supports all CUP options available on -+ * the command line. -+ *

-+ * The option names are the same as on the command line. Options without -+ * parameters are booleans in Ant (-nosummary becomes nosummary="true") -+ *

-+ * Example build.xml file for Ant (assumes that java_cup classes -+ * are available in classpath): -+ *

 
-+ * <project name="cup" default="jar">
-+ * 
-+ * <taskdef classname="java_cup.AntTask" name="cup" />
-+ * 
-+ * <target name="compile" depends="cup">
-+ *   <javac srcdir="." destdir="bin" target="1.1" classpath="." />  
-+ * </target> 
-+ * 
-+ * <target name="cup">
-+ *   <cup file="java_cup/parser.cup" dir="java_cup" nosummary="true" />
-+ * </target>
-+ *
-+ * <target name="jar" depends="compile">
-+ *   <jar basedir="bin" includes="java_cup/**" jarfile="java_cup.jar" />
-+ * </target>
-+ * </project>
-+ * 
-+ * -+ * @see java_cup.Main -+ * -+ * @author Gerwin Klein -+ */ -+public class AntTask extends Task { -+ -+ private File inputFile; -+ -+ /* FIXME: this duplicates default settings, -+ * would be better to refactor settings from Main, emit, and here -+ * into an own class. -+ */ -+ private String parserName = "parser"; -+ private String symName = "sym"; -+ private String packageName = null; -+ -+ private File destinationDir; -+ -+ private int expect = 0; -+ -+ private boolean symInterface = false; -+ private boolean nonTerms = false; -+ private boolean compactRed = false; -+ private boolean noSummary = false; -+ private boolean noWarn = false; -+ private boolean dumpStates = false; -+ private boolean dumpTables = false; -+ private boolean printProgress = false; -+ private boolean dumpGrammar = false; -+ private boolean showTiming = false; -+ private boolean lrValues = true; -+ private boolean suppressScanner = false; -+ -+ /** -+ * Run the Ant task. Assumes that options have already been set -+ * with setter methods by Ant. -+ * -+ * @throws BuildException if build fails -+ */ -+ public void execute() throws BuildException { -+ if (inputFile == null) { -+ throw new BuildException("No input file. Use "); -+ } -+ -+ if (!inputFile.canRead()) { -+ throw new BuildException("Cannot read input file " + inputFile); -+ } -+ -+ try { -+ File parserFile = new File(destinationDir, parserName + ".java"); -+ File symFile = new File(destinationDir, symName + ".java"); -+ -+ if (inputFile.lastModified() > parserFile.lastModified() -+ || inputFile.lastModified() > symFile.lastModified()) { -+ -+ // cup redefines System.in -+ InputStream systemIn_save = System.in; -+ -+ /* run it. assumption: Main.parse_args works with empty -+ * argument list and does nothing */ -+ configure(); -+ Main.main(new String[0]); -+ -+ // restore System.in -+ System.setIn(systemIn_save); -+ -+ if (noSummary) { -+ System.out.println("Generated: " + parserFile + " and " + symFile); -+ } -+ } -+ } catch (IOException e) { -+ throw new BuildException("IOException: " + e.toString()); -+ } catch (internal_error e) { -+ throw new BuildException("Internal CUP error."); -+ } catch (Exception e) { -+ throw new BuildException("CUP generation failed."); -+ } -+ } -+ -+ /** -+ * Configures cup accordings to the settings of this class -+ * -+ * @throws FileNotFoundException if inputFile does not exist -+ */ -+ public void configure() throws FileNotFoundException { -+ System.setIn(new FileInputStream(inputFile)); -+ Main.output_dir = destinationDir; -+ Main.sym_interface = symInterface; -+ emit.parser_class_name = parserName; -+ emit.symbol_const_class_name = symName; -+ emit.package_name = packageName; -+ Main.include_non_terms = nonTerms; -+ Main.expect_conflicts = expect; -+ Main.opt_compact_red = compactRed; -+ Main.no_summary = noSummary; -+ emit.nowarn = noWarn; -+ Main.opt_dump_states = dumpStates; -+ Main.opt_dump_grammar = dumpGrammar; -+ Main.opt_dump_tables = dumpTables; -+ Main.print_progress = printProgress; -+ Main.opt_show_timing = showTiming; -+ Main.lr_values = lrValues; -+ Main.suppress_scanner = suppressScanner; -+ } -+ -+ public void setDir(File destinationDir) { -+ this.destinationDir = destinationDir; -+ } -+ -+ public void setFile(File file) { -+ this.inputFile = file; -+ } -+ -+ public void setParser(String name) { -+ this.parserName = name; -+ } -+ -+ public void setSymbols(String name) { -+ this.symName = name; -+ } -+ -+ public void setPackage(String name) { -+ this.packageName = name; -+ } -+ -+ public void setInterface(boolean symInterface) { -+ this.symInterface = symInterface; -+ } -+ -+ public void setCompact_red(boolean b) { -+ compactRed = b; -+ } -+ -+ public void setDump_grammar(boolean b) { -+ dumpGrammar = b; -+ } -+ -+ public void setDump_states(boolean b) { -+ dumpStates = b; -+ } -+ -+ public void setDump_tables(boolean b) { -+ dumpTables = b; -+ } -+ -+ public void setDump(boolean b) { -+ dumpStates = dumpTables = dumpGrammar = true; -+ } -+ -+ public void setExpect(int i) { -+ expect = i; -+ } -+ -+ public void setNopositions(boolean b) { -+ lrValues = !b; -+ } -+ -+ public void setNonterms(boolean b) { -+ nonTerms = b; -+ } -+ -+ public void setNosummary(boolean b) { -+ noSummary = b; -+ } -+ -+ public void setNowarn(boolean b) { -+ noWarn = b; -+ } -+ -+ public void setProgress(boolean b) { -+ printProgress = b; -+ } -+ -+ public void setTime(boolean b) { -+ showTiming = b; -+ } -+ -+ public void setNoscanner(boolean b) { -+ suppressScanner = b; -+ } -+} -diff -r -u -N java_cup_orig/Main.java java_cup/Main.java ---- java_cup_orig/Main.java 1999-07-24 23:16:59.000000000 +1000 -+++ java_cup/Main.java 2003-06-04 03:03:41.000000000 +1000 -@@ -25,6 +25,8 @@ - *
specify parser class name [default "parser"] - *
-symbols name - *
specify name for symbol constant class [default "sym"] -+ *
-dir name -+ *
put generated files into directory name [default "."] - *
-interface - *
emit symbol constant interface, rather than class - *
-nonterms -@@ -110,6 +112,10 @@ - * java_cup.runtime.Scanner for compatibility with old runtimes? */ - protected static boolean suppress_scanner = false; - -+ /** User option -- directory for ouput files */ -+ protected static File output_dir = null; -+ -+ - /*----------------------------------------------------------------------*/ - /* Timing data (not all of these time intervals are mutually exclusive) */ - /*----------------------------------------------------------------------*/ -@@ -244,6 +250,7 @@ - " -parser name specify parser class name [default \"parser\"]\n" + - " -symbols name specify name for symbol constant class [default \"sym\"]\n"+ - " -interface put symbols in an interface, rather than a class\n" + -+" -dir name put generated into directory name [default \".\"]" + - " -nonterms put non terminals in symbol constant class\n" + - " -expect # number of conflicts expected/allowed [default 0]\n" + - " -compact_red compact tables by defaulting to most frequent reduce\n" + -@@ -287,6 +294,15 @@ - /* record the name */ - emit.package_name = argv[i]; - } -+ else if (argv[i].equals("-dir")) -+ { -+ if (++i >= len || argv[i].startsWith("-") || -+ argv[i].endsWith(".cup")) -+ usage("-dir must have a name argument"); -+ -+ /* record the name */ -+ output_dir = new File(argv[i]); -+ } - else if (argv[i].equals("-parser")) - { - /* must have an arg */ -@@ -390,23 +406,23 @@ - - /* parser class */ - out_name = emit.parser_class_name + ".java"; -- fil = new File(out_name); -+ fil = new File(output_dir,out_name); - try { - parser_class_file = new PrintWriter( - new BufferedOutputStream(new FileOutputStream(fil), 4096)); - } catch(Exception e) { -- System.err.println("Can't open \"" + out_name + "\" for output"); -+ System.err.println("Can't open \"" + fil + "\" for output"); - System.exit(3); - } - - /* symbol constants class */ - out_name = emit.symbol_const_class_name + ".java"; -- fil = new File(out_name); -+ fil = new File(output_dir,out_name); - try { - symbol_class_file = new PrintWriter( - new BufferedOutputStream(new FileOutputStream(fil), 4096)); - } catch(Exception e) { -- System.err.println("Can't open \"" + out_name + "\" for output"); -+ System.err.println("Can't open \"" + fil + "\" for output"); - System.exit(4); - } - } -@@ -656,8 +672,11 @@ - - /* code location */ - if (output_produced) -- System.err.println(" Code written to \"" + emit.parser_class_name + -- ".java\", and \"" + emit.symbol_const_class_name + ".java\"."); -+ System.err.println(" Code written to \"" + -+ new File(output_dir, emit.parser_class_name) + -+ ".java\", and \"" + -+ new File(output_dir, emit.symbol_const_class_name) + -+ ".java\"."); - else - System.err.println(" No code produced."); - diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..7b6e38f --- /dev/null +++ b/gating.yaml @@ -0,0 +1,9 @@ +--- !Policy +product_versions: + - fedora-* +decision_contexts: + - bodhi_update_push_testing + - bodhi_update_push_stable +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/smoke.functional} + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/javapackages.functional} diff --git a/java_cup-MANIFEST.MF b/java_cup-MANIFEST.MF new file mode 100644 index 0000000..4b3ffba --- /dev/null +++ b/java_cup-MANIFEST.MF @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.4 +Bundle-Name: Java Cup +Bundle-SymbolicName: java_cup +Export-Package: java_cup,java_cup.runtime +Bundle-Version: 0.11.0 +Bundle-ManifestVersion: 2 +Main-Class: java_cup/Main diff --git a/java_cup-build.xml b/java_cup-build.xml deleted file mode 100644 index 290768f..0000000 --- a/java_cup-build.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - Jpackage build file for java_cup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java_cup-runtime-MANIFEST.MF b/java_cup-runtime-MANIFEST.MF new file mode 100644 index 0000000..a644cbf --- /dev/null +++ b/java_cup-runtime-MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.4 +Bundle-Name: Java Cup Runtime +Bundle-SymbolicName: java_cup.runtime +Export-Package: java_cup.runtime +Bundle-Version: 0.11.0 +Bundle-ManifestVersion: 2 diff --git a/java_cup.spec b/java_cup.spec index 9124ef2..9e974d1 100644 --- a/java_cup.spec +++ b/java_cup.spec @@ -1,228 +1,85 @@ -# Copyright (c) 2000-2005, JPackage Project -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the -# distribution. -# 3. Neither the name of the JPackage Project nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -%define _with_gcj_support 1 - -%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}} - -%define pkg_version v10k -%define section free +%bcond_with bootstrap +%global pkg_version 11b Name: java_cup -Version: 0.10k -Release: 1 Epoch: 1 -Summary: Java source interpreter -License: BSD and LGPLv2 -Url: http://www.cs.princeton.edu/%7Eappel/modern/java/CUP/ -Source0: http://www.cs.princeton.edu/%7Eappel/modern/java/CUP/%{name}_%{pkg_version}.tar.gz -Source1: %{name}-build.xml -Patch0: http://jflex.de/cup-ant-task.patch -BuildRequires: ant -BuildRequires: jpackage-utils >= 0:1.5 -Group: Development/Tools -%if ! %{gcj_support} -Buildarch: noarch -%endif -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Version: 0.11b +Release: %autorelease +Summary: LALR parser generator for Java +License: SMLNJ +URL: https://www2.cs.tum.edu/projects/cup/ +BuildArch: noarch +ExclusiveArch: %{java_arches} noarch -%if %{gcj_support} -BuildRequires: java-gcj-compat-devel -Requires(post): java-gcj-compat -Requires(postun): java-gcj-compat +# git clone https://github.com/DrMichaelPetter/cup.git +# git -C cup archive --prefix java_cup-0.11b/ c35ed3ab0cde2310af9b01321c930349c7c797e2 | zstd -15 >java_cup-0.11b.tar.zst +Source0: java_cup-%{version}.tar.zst +# Add OSGi manifests +Source2: %{name}-MANIFEST.MF +Source4: %{name}-runtime-MANIFEST.MF + +Patch: 0001-Adopt-build-script.patch + +%if %{with bootstrap} +BuildRequires: javapackages-bootstrap +%else +BuildRequires: javapackages-local-openjdk25 +BuildRequires: ant-openjdk25 +BuildRequires: java_cup +BuildRequires: jflex %endif +# TODO Remove in Fedora 46 +Obsoletes: %{name}-javadoc < 1:0.11b-57 %description java_cup is a LALR Parser Generator for Java -%package javadoc -Summary: Javadoc for java_cup -Group: Documentation -# For /bin/rm and /bin/ln -Requires(post): coreutils -Requires(postun): coreutils - -%description javadoc -Javadoc for java_cup - %package manual Summary: Documentation for java_cup -Group: Documentation %description manual Documentation for java_cup. %prep -%setup -q -c -n %{name}-%{version} -%patch0 -p0 -install -m 644 %{SOURCE1} build.xml +%autosetup -p1 -C # remove all binary files -find . -name "*.class" -exec rm -f {} \; +find -name "*.class" -delete + +%mvn_file ':{*}' @1 + +# remove prebuilt JFlex +rm -rf java_cup-%{version}/bin/JFlex.jar + +# remove prebuilt java_cup, if not bootstrapping +rm -rf java_cup-%{version}/bin/java-cup-11.jar %build -ant -find . -name parser.cup -exec rm {} \; -ant javadoc +export CLASSPATH=$(build-classpath java_cup java_cup-runtime jflex) + +%ant -Dcupversion=20150326 -Dsvnversion=65 + +# inject OSGi manifests +%jar ufm dist/java-cup-%{pkg_version}.jar %{SOURCE2} +%jar ufm dist/java-cup-%{pkg_version}-runtime.jar %{SOURCE4} %install -rm -rf $RPM_BUILD_ROOT +%mvn_artifact %{name}:%{name}:%{version} dist/java-cup-%{pkg_version}.jar +%mvn_artifact %{name}:%{name}-runtime:%{version} dist/java-cup-%{pkg_version}-runtime.jar -# jar -install -d -m 755 $RPM_BUILD_ROOT%{_javadir} -install -m 644 dist/lib/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar -install -m 644 dist/lib/%{name}-runtime.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-runtime-%{version}.jar -(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do \ -ln -sf ${jar} ${jar/-%{version}/}; done) +%mvn_install -# javadoc -install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} -cp -pr dist/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} -(cd $RPM_BUILD_ROOT%{_javadocdir} && ln -sf %{name}-%{version} %{name}) +# wrapper script for direct execution +%jpackage_script java_cup.Main "" "" java_cup cup true -%if %{gcj_support} -%{_bindir}/aot-compile-rpm -%endif - -%clean -rm -rf $RPM_BUILD_ROOT - -%post javadoc -rm -f %{_javadocdir}/%{name} -ln -s %{name}-%{version} %{_javadocdir}/%{name} - -%postun javadoc -if [ $1 -eq 0 ]; then - rm -f %{_javadocdir}/%{name} -fi - -%post -%if %{gcj_support} -if [ -x %{_bindir}/rebuild-gcj-db ] -then - %{_bindir}/rebuild-gcj-db -fi -%endif - -%postun -%if %{gcj_support} -if [ -x %{_bindir}/rebuild-gcj-db ] -then - %{_bindir}/rebuild-gcj-db -fi -%endif - -%files -%defattr(0644,root,root,0755) -%doc README LICENSE CHANGELOG -%{_javadir}/* - -%if %{gcj_support} -%attr(-,root,root) %{_libdir}/gcj/%{name} -%attr(-,root,root) %{_libdir}/gcj/%{name}/java_cup-%{version}.jar.* -%attr(-,root,root) %{_libdir}/gcj/%{name}/java_cup-runtime-%{version}.jar.* -%endif +%files -f .mfiles +%{_bindir}/cup +%doc changelog.txt +%license licence.txt %files manual -%defattr(0644,root,root,0755) -%doc cup_logo.gif manual.html - -%files javadoc -%defattr(0644,root,root,0755) -%doc %{_javadocdir}/%{name}-%{version} -%ghost %doc %{_javadocdir}/%{name} +%doc manual.html +%license licence.txt %changelog -* Tue Jul 15 2008 Lubomir Rintel - 1:0.10k-1 -- Fix the version to match upstream, so that FEver can be used - -* Wed Jul 9 2008 Tom "spot" Callaway - 1:0.10-0.k.6.3 -- drop repotag - -* Sun Feb 17 2008 Lubomir Kundrak - 1:0.10-0.k.6jpp.2 -- Ant task -- Clean up to satisfy QA script and rpmlint - -* Fri Aug 04 2006 Vivek Lakshmanan - 1:0.10-0.k.6jpp.1 -- Re-sync with latest version from JPP. -- Partially adopt new naming convention. - -* Sat Jul 22 2006 Jakub Jelinek - 1:0.10-0.k.5jpp_2fc -- Rebuilt - -* Thu Jul 20 2006 Vivek Lakshmanan - 1:0.10-0.k.5jpp_1fc -- Re-sync with latest version from JPP. - -* Wed Jul 19 2006 Vivek Lakshmanan - 1:0.10-0.k.4jpp_1fc -- Conditional native compilation for GCJ. - -* Wed Jul 12 2006 Jesse Keating - 1:0.10-0.k.1jpp_10fc -- rebuild - -* Mon Mar 6 2006 Jeremy Katz - 1:0.10-0.k.1jpp_9fc -- stop scriptlet spew - -* Fri Feb 10 2006 Jesse Keating - 1:0.10-0.k.1jpp_8fc -- bump again for double-long bug on ppc(64) - -* Tue Feb 07 2006 Jesse Keating - 1:0.10-0.k.1jpp_7fc -- rebuilt for new gcc4.1 snapshot and glibc changes - -* Tue Jan 3 2006 Jesse Keating 1:0.10-0.k.1jpp_6fc -- rebuilt again - -* Fri Dec 09 2005 Jesse Keating -- rebuilt - -* Tue Jul 19 2005 Gary Benson 1:0.10-0.k.1jpp_5fc -- Build on ia64, ppc64, s390 and s390x. -- Switch to aot-compile-rpm. - -* Tue Jun 28 2005 Gary Benson 1:0.10-0.k.1jpp_4fc -- BC-compile. - -* Tue Jun 21 2005 Gary Benson 1:0.10-0.k.1jpp_3fc -- Remove classes from the tarball. - -* Thu Nov 4 2004 Gary Benson 1:0.10-0.k.1jpp_2fc -- Build into Fedora. - -* Thu Mar 4 2004 Frank Ch. Eigler 1:0.10-0.k.1jpp_1rh -- RH vacuuming - -* Thu Jan 22 2004 David Walluck 1:0.10-0.k.1jpp -- fix version/release (bump epoch) -- change License tag from Free to BSD-style -- add Distribution tag -- really update for JPackage 1.5 - -* Wed Mar 26 2003 Paul Nasrat 0.10k-1jpp -- for jpackage-utils 1.5 -- New spec reverse engineered from binary rpms +%autochangelog diff --git a/plans/javapackages.fmf b/plans/javapackages.fmf new file mode 100644 index 0000000..ae17c0c --- /dev/null +++ b/plans/javapackages.fmf @@ -0,0 +1,7 @@ +summary: Run javapackages-specific tests +discover: + how: fmf + url: https://gitlab.com/redhat/centos-stream/tests/javapackages.git + ref: f43 +execute: + how: tmt diff --git a/plans/smoke.fmf b/plans/smoke.fmf new file mode 100644 index 0000000..a1e7bfd --- /dev/null +++ b/plans/smoke.fmf @@ -0,0 +1,5 @@ +summary: Basic smoke test +discover: + how: fmf +execute: + how: tmt diff --git a/sources b/sources index c6d5f81..3bdd25b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8b11edfec13c590ea443d0f0ae0da479 java_cup_v10k.tar.gz +SHA512 (java_cup-0.11b.tar.zst) = f999ed5c20c35eb2f86aa5b1720f9f38b2c0729edddfbbabe81779d7221b6d3253b92e1b86d4055d2b9da61b644d2196c3d41b025de455ca67c5448d3f02d233 diff --git a/tests/Sanity/smoke/empty.cup b/tests/Sanity/smoke/empty.cup new file mode 100644 index 0000000..479f98e --- /dev/null +++ b/tests/Sanity/smoke/empty.cup @@ -0,0 +1,2 @@ +non terminal bar; +bar::=; diff --git a/tests/Sanity/smoke/main.fmf b/tests/Sanity/smoke/main.fmf new file mode 100644 index 0000000..b9bed52 --- /dev/null +++ b/tests/Sanity/smoke/main.fmf @@ -0,0 +1,6 @@ +summary: java_cup smoke test +description: | + Test basic functionality of java_cup. +require: + - java_cup + - java-21-openjdk-devel diff --git a/tests/Sanity/smoke/runtest.sh b/tests/Sanity/smoke/runtest.sh new file mode 100755 index 0000000..838cfcd --- /dev/null +++ b/tests/Sanity/smoke/runtest.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Author: Mikolaj Izdebski +. /usr/share/beakerlib/beakerlib.sh + +rlJournalStart + + rlPhaseStartTest "check for presence of cup command" + rlAssertRpm java_cup + rlAssertBinaryOrigin cup java_cup + rlPhaseEnd + + rlPhaseStartTest "display cup version" + rlRun -s "cup -version" 1 + rlAssertGrep "CUP v0" $rlRun_LOG + rlPhaseEnd + + rlPhaseStartTest "generate parser for empty grammar" + java_home=/usr/lib/jvm/java-21-openjdk/bin + jar=/usr/share/java/java_cup-runtime.jar + rlRun -s "cup empty.cup" + rlAssertGrep "0 errors and 0 warnings" $rlRun_LOG + rlAssertGrep "2 terminals, 1 non-terminal, and 2 productions declared" $rlRun_LOG + rlAssertGrep "Code written to" $rlRun_LOG + rlRun "javac -cp ${jar} parser.java sym.java" + rlPhaseEnd + +rlJournalEnd +rlJournalPrintText diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..99fd67e --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,4 @@ +contact: Mikolaj Izdebski +framework: beakerlib +test: ./runtest.sh +tier: 0