diff --git a/javacc-5.0-parser-build_xml.patch b/javacc-5.0-parser-build_xml.patch
deleted file mode 100644
index cea8efe..0000000
--- a/javacc-5.0-parser-build_xml.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/org/javacc/parser/build.xml 2008-10-30 00:29:16.000000000 +0100
-+++ src/org/javacc/parser/build.xml-gil 2010-04-17 17:42:36.000000000 +0200
-@@ -52,7 +52,7 @@
-
-
-
diff --git a/javacc.sh b/javacc.sh
deleted file mode 100644
index 5031f86..0000000
--- a/javacc.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# JavaCC script
-# JPackage Project
-
-# Source functions library
-if [ -f /usr/share/java-utils/java-functions ] ; then
- . /usr/share/java-utils/java-functions
-else
- echo "Can't find function library, aborting"
- exit 1
-fi
-
-# Configuration
-MAIN_CLASS=javacc
-BASE_JARS="javacc.jar"
-
-# Set parameters
-set_jvm
-set_classpath $BASE_JARS
-set_flags $BASE_FLAGS
-set_options $BASE_OPTIONS
-
-# Let's start
-run "$@"
diff --git a/javacc.spec b/javacc.spec
index ffe0a51..98f9df5 100644
--- a/javacc.spec
+++ b/javacc.spec
@@ -1,28 +1,18 @@
-%define bootstrap 0
-%define javahome %{_jvmdir}/jdk
Name: javacc
-Version: 5.0
-Release: 4mamba
+Version: 7.0.10
+Release: 1mamba
Summary: JavaCC is a parser/scanner generator for java
Group: Development/Tools
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco
-URL: https://javacc.dev.java.net/
-Source0: https://javacc.dev.java.net/files/documents/17/142527/javacc-%{version}src.tar.gz
-# files bin
-# http://www.jpackage.org/cgi-bin/viewvc.cgi/rpms/free/javacc3/
-Source1: javacc.sh
-Source2: jjdoc
-Source3: jjtree
-Source5: javacc-%{version}.jar
-Patch0: javacc-5.0-parser-build_xml.patch
+URL: https://javacc.github.io/javacc/
+Source0: https://github.com/javacc/javacc/archive/refs/tags/javacc-%{version}.tar.gz
License: BSD
BuildRequires: apache-ant
-BuildRequires: java-junit3
-BuildRequires: jpackage-utils
-Requires: jpackage-utils
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
+BuildRequires: javapackages
+BuildRequires: java-openjdk8
+Requires: javapackages
%description
Java Compiler Compiler (JavaCC) is the most popular parser generator for use with Java applications. A parser generator is a tool that reads a grammar specification and converts it to a Java program that can recognize matches to the grammar. In addition to the parser generator itself, JavaCC provides other standard capabilities related to parser generation such as tree building (via a tool called JJTree included with JavaCC), actions, debugging, etc.
@@ -46,102 +36,66 @@ JavaCC is a parser/scanner generator for java.
This package contains manual for %{name}.
%prep
-%setup -q -n %{name}
-cp %{SOURCE1} bin/javacc
-cp %{SOURCE2} bin/jjdoc
-cp %{SOURCE3} bin/jjtree
-
-for j in $(find . -name "*.jar"); do
- mv $j ${j}.no
-done
-
-%patch0
-
-%if %bootstrap
- mv bootstrap/javacc.jar.no bootstrap/javacc.jar
-%else
-# ln -sf $(build-classpath javacc) bootstrap/javacc.jar
- cp -p %{SOURCE5} bootstrap/javacc.jar
-%endif
-
-for j in $(find . -name "*.class"); do
- rm -rf $j
-done
-
-ln -sf %{_javadir}/junit381.jar lib/junit3.8.1/junit.jar
+%setup -q -n javacc-javacc-%{version}
%build
-export JAVA_HOME=%javahome
-# use %{SOURCE5} to generate some required source java files.
-# after these source files are generated we remove the
-# bootstrap jar and build the binary from source.
-ant -f src/org/javacc/parser/build.xml parser-files
-ant -f src/org/javacc/jjtree/build.xml tree-files
-
-for j in $(find . -name "*.jar"); do
- rm -rf $j
-done
-
-export CLASSPATH=$(build-classpath junit)
-ant jar
-
-%if %bootstrap
- cp bin/lib/javacc.jar %{_sourcedir}/javacc-%{version}.jar
-%endif
-
+export JAVA_HOME=%{_jvmdir}/java-8-openjdk
+ant
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
-mkdir -p %{buildroot}%{_javadir}
+install -d -m0755 %{buildroot}%{_javadir}/javacc/{docs,examples} %{buildroot}%{_bindir}
-install -pm 644 bin/lib/javacc.jar %{buildroot}%{_javadir}/javacc-%{version}.jar
-ln -s javacc-%{version}.jar %{buildroot}%{_javadir}/javacc.jar
+# install examples
+cp -R examples/ %{buildroot}%{_javadir}/javacc/examples
-mkdir -p %{buildroot}%{_mavenpomdir}
-sed -i "s|4.2|%{version}|" pom.xml
-sed -i "s|5.0.0|4.0.0|" pom.xml
-install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-javacc.pom
-%add_to_maven_depmap net.java.dev.javacc javacc %{version} JPP javacc
+# install documentation
+cp -R docs/ %{buildroot}%{_javadir}/javacc/docs
+# install jar
+install -m755 -D target/javacc-%{version}.jar %{buildroot}%{_javadir}/javacc/bin/lib/javacc.jar
+ln -s javacc/bin/lib/javacc.jar %{buildroot}%{_javadir}/javacc.jar
-mkdir -p %{buildroot}%{_bindir}
-install -m 755 bin/{javacc,jjdoc,jjtree} %{buildroot}%{_bindir}
+# generate scripts to allow direct execution
+for i in jjtree jjdoc javacc; do
+ printf "#\!bin/sh\nJAR=\"%{_javadir}/javacc/bin/lib/javacc.jar\"\n\njava -classpath \"\$JAR\" $i \"\$@\"\n" > %{buildroot}%{_javadir}/javacc/bin/$i
+ ln -s %{_javadir}/javacc/bin/$i %{buildroot}%{_bindir}/$i
+done
-mkdir -p %{buildroot}%{_datadir}/javacc
-cp -pr examples %{buildroot}%{_datadir}/javacc
-
-#%{_bindir}/aot-compile-rpm
+# Set permissions
+chmod -R 755 %{buildroot}%{_javadir}/javacc/bin %{buildroot}%{_bindir}
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
-%post
-%update_maven_depmap
-
-%postun
-%update_maven_depmap
-
%files
%defattr(-,root,root)
-%attr(0755,root,root) %{_bindir}/javacc
-%attr(0755,root,root) %{_bindir}/jjdoc
-%attr(0755,root,root) %{_bindir}/jjtree
-%{_javadir}/javacc-%{version}.jar
+%{_bindir}/javacc
+%{_bindir}/jjdoc
+%{_bindir}/jjtree
+%dir %{_javadir}/javacc
+%dir %{_javadir}/javacc/bin
+%{_javadir}/javacc/bin/*
+%dir %{_datadir}/java/javacc/bin/lib
+%{_datadir}/java/javacc/bin/lib/javacc.jar
%{_javadir}/javacc.jar
-%{_mavenpomdir}/*
-%{_mavendepmapfragdir}/*
-%doc LICENSE README
+%doc LICENSE
%files demo
%defattr(-,root,root)
-%{_datadir}/javacc
+%dir %{_javadir}/javacc/examples
+%{_javadir}/javacc/examples/*
%files manual
%defattr(-,root,root)
-%doc www/*
+%dir %{_javadir}/javacc/docs
+%{_javadir}/javacc/docs/*
%changelog
+* Tue Nov 30 2021 Silvan Calarco 7.0.10-1mamba
+- update to 7.0.10
+
* Fri Mar 25 2011 gil 5.0-4mamba
- rebuilt with java-gcj-compat support
diff --git a/jjdoc b/jjdoc
deleted file mode 100644
index bc9aa0f..0000000
--- a/jjdoc
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# JJDoc script
-# JPackage Project
-
-# Source functions library
-if [ -f /usr/share/java-utils/java-functions ] ; then
- . /usr/share/java-utils/java-functions
-else
- echo "Can't find function library, aborting"
- exit 1
-fi
-
-# Configuration
-MAIN_CLASS=jjdoc
-BASE_JARS="javacc.jar"
-
-# Set parameters
-set_jvm
-set_classpath $BASE_JARS
-set_flags $BASE_FLAGS
-set_options $BASE_OPTIONS
-
-# Let's start
-run "$@"
diff --git a/jjtree b/jjtree
deleted file mode 100644
index bfe4db3..0000000
--- a/jjtree
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# JJTree script
-# JPackage Project
-
-# Source functions library
-if [ -f /usr/share/java-utils/java-functions ] ; then
- . /usr/share/java-utils/java-functions
-else
- echo "Can't find function library, aborting"
- exit 1
-fi
-
-# Configuration
-MAIN_CLASS=jjtree
-BASE_JARS="javacc.jar"
-
-# Set parameters
-set_jvm
-set_classpath $BASE_JARS
-set_flags $BASE_FLAGS
-set_options $BASE_OPTIONS
-
-# Let's start
-run "$@"