java-jflex/java-jflex.spec

150 lines
4.2 KiB
RPMSpec

%define bootstrap 0
Name: java-jflex
Version: 1.4.1
Release: 4mamba
Summary: JFlex - The Fast Scanner Generator for Java
Group: Development/Libraries/Java
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://jflex.de/
Source0: http://jflex.de/jflex-%{version}.tar.gz
Source1: java-jflex.script
Patch0: java-jflex-1.4.1-build_xml.patch
Patch1: java-jflex-1.4.1-no-cup-no-jflex.patch
Patch2: java-jflex-1.4.1-cup-anttask.patch
Patch3: java-jflex-1.4.1-classpath.patch
Patch4: java-jflex-1.4.1-byaccj.patch
License: GPL
BuildRequires: apache-ant
BuildRequires: java_cup
BuildRequires: java-junit3
BuildRequires: jpackage-utils
BuildRequires: sinjdoc
Requires: java_cup
Requires: jpackage-utils
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
JFlex is a lexical analyzer generator (also known as scanner generator) for Java(tm), written in Java(tm). It is also a rewrite of the very useful tool JLex which was developed by Elliot Berk at Princeton University.
As Vern Paxson states for his C/C++ tool flex: They do not share any code though.
JFlex is designed to work together with the LALR parser generator CUP by Scott Hudson, and the Java modification of Berkeley Yacc BYacc/J by Bob Jamison. It can also be used together with other parser generators like ANTLR or as a standalone tool.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
JFlex is a lexical analyzer generator (also known as scanner generator) for Java(tm), written in Java(tm). It is also a rewrite of the very useful tool JLex which was developed by Elliot Berk at Princeton University.
As Vern Paxson states for his C/C++ tool flex: They do not share any code though.
This package contains Javadoc for %{name}.
%prep
#rm -rf jflex*
%setup -q -n jflex-%{version}
%patch0 -p1
%if ! %bootstrap
%patch1 -p1
%else
%patch2 -p1
%patch3 -p1
sed -i "s|_JAVA-DIR_|%{_javadir}|" src/build.xml
%patch4 -p1
%endif
rm -rf src/java_cup
#find . -name "*.class" -exec rm {} \;
for j in $(find . -name "*.jar"); do
mv $j ${j}.no
done
sed -i 's/\r//' COPYRIGHT
%build
pushd src
%if ! %bootstrap
# bootstrap generated JFlex.jar
CLASSPATH=$(build-classpath java-cup java-cup-runtime junit-3.8.2) \
ant jar-bootstrap
# rebuilding using the JFlex.jar
CLASSPATH=$(build-classpath java-cup java-cup-runtime junit-3.8.2):../lib/JFlex.jar \
ant \
genclean libclean \
jar
%else
CLASSPATH=$(build-classpath java-cup java_cup-runtime junit-3.8.2) \
ant jar
%endif
mkdir -p ../dist/docs/api
sinjdoc -d ../dist/docs/api \
-classpath $(build-classpath junit-3.8.2 ant-1.7.1):lib/JFlex.jar \
-encoding iso-8859-1 \
-sourcepath . JFlex \
-doctitle 'JFlex %{version} API' \
`find src -name '*.java'`
popd
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_javadir}
install -pm 644 lib/JFlex.jar \
%{buildroot}%{_javadir}/jflex-%{version}.jar
( cd %{buildroot}%{_javadir}
for jar in *-%{version}.jar; do
ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`
done
ln -s jflex.jar JFlex.jar
)
mkdir -p %{buildroot}%{_javadocdir}/jflex-%{version}
cp -pr dist/docs/api/* %{buildroot}%{_javadocdir}/jflex-%{version}
ln -s jflex-%{version} %{buildroot}%{_javadocdir}/jflex
mkdir -p %{buildroot}%{_bindir}
install -m 755 %{S:1} %{buildroot}%{_bindir}/jflex
rm -rf doc/COPYRIGHT
perl -pi -e 's/\r$//g' examples/standalone/sample.inp
#%{_bindir}/aot-compile-rpm
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_bindir}/jflex
%{_javadir}/jflex-%{version}.jar
%{_javadir}/jflex.jar
%{_javadir}/JFlex.jar
%doc COPYRIGHT doc/*
%doc examples src/README src/changelog
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/jflex-%{version}
%{_javadocdir}/jflex
%changelog
* Thu Nov 25 2010 gil <puntogil@libero.it> 1.4.1-4mamba
- rebuilt devel
* Mon Mar 02 2009 gil <puntogil@libero.it> 1.4.1-3mamba
- fixed some bugs
* Mon Mar 02 2009 gil <puntogil@libero.it> 1.4.1-2mamba
- rebuilt
* Mon Mar 02 2009 gil <puntogil@libero.it> 1.4.1-1mamba
- package created by autospec