update to 7.0.10 [release 7.0.10-1mamba;Tue Nov 30 2021]

This commit is contained in:
Silvan Calarco 2024-01-06 00:16:02 +01:00
parent 7a468a8259
commit d72cef1f80
5 changed files with 41 additions and 173 deletions

View File

@ -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 @@
<javac srcdir="${javacc.root}/src"
destdir="${javacc.root}/classes"
debug="${build.compiler.debug}"
- source="1.4"
+ source="1.5"
classpath="${javacc.root}/classes:${junit.jar}">
</javac>
</target>

View File

@ -1,25 +0,0 @@
#!/bin/sh
#
# JavaCC script
# JPackage Project <http://www.jpackage.org/>
# 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 "$@"

View File

@ -1,28 +1,18 @@
%define bootstrap 0
%define javahome %{_jvmdir}/jdk
Name: javacc Name: javacc
Version: 5.0 Version: 7.0.10
Release: 4mamba Release: 1mamba
Summary: JavaCC is a parser/scanner generator for java Summary: JavaCC is a parser/scanner generator for java
Group: Development/Tools Group: Development/Tools
Vendor: openmamba Vendor: openmamba
Distribution: openmamba Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://javacc.dev.java.net/ URL: https://javacc.github.io/javacc/
Source0: https://javacc.dev.java.net/files/documents/17/142527/javacc-%{version}src.tar.gz Source0: https://github.com/javacc/javacc/archive/refs/tags/javacc-%{version}.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
License: BSD License: BSD
BuildRequires: apache-ant BuildRequires: apache-ant
BuildRequires: java-junit3 BuildRequires: javapackages
BuildRequires: jpackage-utils BuildRequires: java-openjdk8
Requires: jpackage-utils Requires: javapackages
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description %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. 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}. This package contains manual for %{name}.
%prep %prep
%setup -q -n %{name} %setup -q -n javacc-javacc-%{version}
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
%build %build
export JAVA_HOME=%javahome export JAVA_HOME=%{_jvmdir}/java-8-openjdk
# use %{SOURCE5} to generate some required source java files. ant
# 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
%install %install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{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 # install examples
ln -s javacc-%{version}.jar %{buildroot}%{_javadir}/javacc.jar cp -R examples/ %{buildroot}%{_javadir}/javacc/examples
mkdir -p %{buildroot}%{_mavenpomdir} # install documentation
sed -i "s|<version>4.2</version>|%{version}|" pom.xml cp -R docs/ %{buildroot}%{_javadir}/javacc/docs
sed -i "s|<modelVersion>5.0.0</modelVersion>|<modelVersion>4.0.0</modelVersion>|" 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 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} # generate scripts to allow direct execution
install -m 755 bin/{javacc,jjdoc,jjtree} %{buildroot}%{_bindir} 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 # Set permissions
cp -pr examples %{buildroot}%{_datadir}/javacc chmod -R 755 %{buildroot}%{_javadir}/javacc/bin %{buildroot}%{_bindir}
#%{_bindir}/aot-compile-rpm
%clean %clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post
%update_maven_depmap
%postun
%update_maven_depmap
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%attr(0755,root,root) %{_bindir}/javacc %{_bindir}/javacc
%attr(0755,root,root) %{_bindir}/jjdoc %{_bindir}/jjdoc
%attr(0755,root,root) %{_bindir}/jjtree %{_bindir}/jjtree
%{_javadir}/javacc-%{version}.jar %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 %{_javadir}/javacc.jar
%{_mavenpomdir}/* %doc LICENSE
%{_mavendepmapfragdir}/*
%doc LICENSE README
%files demo %files demo
%defattr(-,root,root) %defattr(-,root,root)
%{_datadir}/javacc %dir %{_javadir}/javacc/examples
%{_javadir}/javacc/examples/*
%files manual %files manual
%defattr(-,root,root) %defattr(-,root,root)
%doc www/* %dir %{_javadir}/javacc/docs
%{_javadir}/javacc/docs/*
%changelog %changelog
* Tue Nov 30 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 7.0.10-1mamba
- update to 7.0.10
* Fri Mar 25 2011 gil <puntogil@libero.it> 5.0-4mamba * Fri Mar 25 2011 gil <puntogil@libero.it> 5.0-4mamba
- rebuilt with java-gcj-compat support - rebuilt with java-gcj-compat support

25
jjdoc
View File

@ -1,25 +0,0 @@
#!/bin/sh
#
# JJDoc script
# JPackage Project <http://www.jpackage.org/>
# 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 "$@"

25
jjtree
View File

@ -1,25 +0,0 @@
#!/bin/sh
#
# JJTree script
# JPackage Project <http://www.jpackage.org/>
# 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 "$@"