javacc/javacc.spec

115 lines
3.3 KiB
RPMSpec
Raw Permalink Normal View History

Name: javacc
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 <silvan.calarco@mambasoft.it>
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: 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.
%package demo
Group: Documentation
Summary: Examples for %{name}
%description demo
JavaCC is a parser/scanner generator for java.
This package contains examples for %{name}
%package manual
Group: Documentation
Summary: Manual for %{name}
%description manual
JavaCC is a parser/scanner generator for java.
This package contains manual for %{name}.
%prep
%setup -q -n javacc-javacc-%{version}
%build
export JAVA_HOME=%{_jvmdir}/java-8-openjdk
ant
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -d -m0755 %{buildroot}%{_javadir}/javacc/{docs,examples} %{buildroot}%{_bindir}
# install examples
cp -R examples/ %{buildroot}%{_javadir}/javacc/examples
# 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
# 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
# Set permissions
chmod -R 755 %{buildroot}%{_javadir}/javacc/bin %{buildroot}%{_bindir}
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_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
%doc LICENSE
%files demo
%defattr(-,root,root)
%dir %{_javadir}/javacc/examples
%{_javadir}/javacc/examples/*
%files manual
%defattr(-,root,root)
%dir %{_javadir}/javacc/docs
%{_javadir}/javacc/docs/*
%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
- rebuilt with java-gcj-compat support
* Sun Nov 07 2010 gil <puntogil@libero.it> 5.0-3mamba
- rebuilt devel
* Sat Apr 17 2010 gil <puntogil@libero.it> 5.0-2mamba
- rebuilt with system javacc.jar
* Sat Apr 17 2010 gil <puntogil@libero.it> 5.0-1mamba
- update to 5.0
- added maven pom
- bootstrap
* Thu Feb 26 2009 gil <puntogil@libero.it> 4.2-1mamba
- package created by autospec