%bcond_with bootstrap
Summary: Fast Scanner Generator
Name: jflex
Version: 1.4.3
Release: 19%{?dist}
Epoch: 0
License: GPL+
URL: http://jflex.de/
# ./create-tarball.sh %%{version}
Source0: %{name}-%{version}-clean.tar.gz
Source1: http://repo2.maven.org/maven2/de/jflex/jflex/1.4.3/jflex-1.4.3.pom
Source4: %{name}.1
Source5: create-tarball.sh
Patch0: jflex-build_xml.patch
Patch1: jflex-junit-incompatibility.patch
# Build-require itself except in bootstrapping mode
%{!?with_bootstrap:BuildRequires: jflex}
BuildRequires: jpackage-utils >= 0:1.5
BuildRequires: ant
BuildRequires: emacs
BuildRequires: junit
BuildRequires: java-devel
BuildRequires: java_cup
Requires: emacs-filesystem >= %{_emacs_version}
Requires: java
Requires: java_cup
BuildArch: noarch
%description
JFlex is a lexical analyzer generator (also known as scanner
generator) for Java, written in Java. 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
Summary: API documentation for %{name}
%description javadoc
This package provides %{summary}.
%prep
%setup -q
%patch0 -b .sav
%patch1 -p1 -b .sav
%{__sed} -i 's/\r//' COPYRIGHT
%{__sed} -i 's|includes="JFlex/\*\*,java_cup/\*\*,skeleton|includes="JFlex/\*\*,skeleton|g' src/build.xml
%build
pushd src
%if %{with bootstrap}
# intial build using the autogenerated sym.java LexParse.java and LexScan.java
# these are created by the jflex ant task which needs to be built first
export CLASSPATH=$(build-classpath junit java_cup)
ant jar-bootstrap
# now that the JFlex.jar has been build we can use jflex ant tasks
# removing the generated files and rebuilding using the JFlex.jar
export CLASSPATH=${CLASSPATH}:../lib/JFlex.jar
%else
export CLASSPATH=$(build-classpath junit java_cup jflex)
%endif
ant genclean libclean jar
javadoc -sourcepath . -d ../api JFlex
popd
# Compile Emacs jflex-mode source
%{_emacs_bytecompile} lib/jflex-mode.el
%install
install -d -m 755 %{buildroot}%{_javadir}
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
install -d -m 755 %{buildroot}%{_mandir}/man1
install -d -m 755 %{buildroot}%{_emacs_sitelispdir}/%{name}
install -d -m 755 %{buildroot}%{_datadir}/pixmaps
# jars
install -p -m 644 lib/JFlex.jar %{buildroot}%{_javadir}/%{name}.jar
ln -sf %{name}.jar %{buildroot}%{_javadir}/JFlex.jar
# pom
install -pm 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap
# javadoc
cp -pr api/* %{buildroot}%{_javadocdir}/%{name}
# wrapper script for direct execution
%jpackage_script JFlex.Main "" "" jflex:java_cup jflex true
# manpage
install -p -m 644 %{SOURCE4} %{buildroot}%{_mandir}/man1
# Emacs files
install -p -m 644 lib/jflex-mode.el %{buildroot}%{_emacs_sitelispdir}/%{name}
install -p -m 644 lib/jflex-mode.elc %{buildroot}%{_emacs_sitelispdir}/%{name}
%files -f .mfiles
%doc doc
%doc COPYRIGHT
%{_javadir}/JFlex.jar
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1.gz
%{_emacs_sitelispdir}/%{name}
%files javadoc
%doc COPYRIGHT
%doc %{_javadocdir}/%{name}
%changelog
* Thu Oct 24 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.4.3-19
- Remove desktop files
* Fri Aug 02 2013 Michal Srb <msrb@redhat.com> - 0:1.4.3-18
- Add create-tarball.sh script to SRPM
* Fri Jul 12 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.4.3-17
- Remove workaround for rpm bug #646523
* Fri Jun 28 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.4.3-16
- Rebuild to regenerate API documentation
- Resolves: CVE-2013-1571
* Thu Jun 20 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.4.3-15
- Fix javadoc generation
- Update to current packaging guidelines
* Thu Jun 20 2013 Michal Srb <msrb@redhat.com> - 0:1.4.3-14
- Build from clean tarball
- Install license file with javadoc package
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.4.3-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Thu Nov 22 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.4.3-12
- Install Emacs jflex-mode
* Thu Nov 22 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.4.3-11
- Remove bundled java_cup sources
- Resolves: rhbz#877051
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.4.3-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Wed May 2 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.4.3-9
- Fix license tag
- Import manpage from Debian's jflex 1.4.1-3 (GPL+)
* Thu Apr 19 2012 Jaromir Capik <jcapik@redhat.com> - 0:1.4.3-8
- Desktop file generated
- Icon created from the GPL licensed logo
* Mon Mar 12 2012 Jaromir Capik <jcapik@redhat.com> - 0:1.4.3-7
- Wrapper script generated
- Minor spec file changes according to the latest guidelines
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.4.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.4.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Feb 15 2010 Alexander Kurtakov <akurtako@redhat.com> 0:1.4.3-4
- Add dependency on java_cup in the maven pom.xml.
* Mon Feb 15 2010 Alexander Kurtakov <akurtako@redhat.com> 0:1.4.3-3
- Require java_cup.
* Wed Jan 20 2010 Alexander Kurtakov <akurtako@redhat.com> 0:1.4.3-3
- Provide JFlex.jar.
- Don't put java_cup classes in the jar.
* Fri Jan 8 2010 Alexander Kurtakov <akurtako@redhat.com> 0:1.4.3-2
- Add maven pom and depmaps.
* Fri Jan 8 2010 Alexander Kurtakov <akurtako@redhat.com> 0:1.4.3-1
- Update to 1.4.3.
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.4.1-0.5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.4.1-0.4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Wed Jul 9 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0:1.4.1-0.3
- drop repotag
* Mon Mar 03 2008 Matt Wringe <mwringe@redhat.com> - 0:1.4.1-0jpp.2
- Add missing buildrequires on java_cup
* Fri Feb 22 2008 Matt Wringe <mwringe@redhat.com> - 0:1.4.1-0jpp.1
- Patch build file to allow bootstrap building
* Mon Feb 18 2008 Lubomir Kundrak <lkundrak@redhat.com> - 0:1.4.1-0jpp.1
- Naive attempt to update to newer version
* Mon Apr 02 2007 Matt Wringe <mwringe@redhat.com> - 0:1.3.5-2jpp.2
- Add patches jflex-CharSet_java.patch and jflex-StateSet_java.patch
to allow building with the new gcj
* Mon Feb 12 2007 Matt Wringe <mwringe@redhat.com> - 0:1.3.5-2jpp.1
- Remove javadoc post and postun sections due to new jpp standard
- Update makefile patch to compress jar
- Fix rpmlint issues
* Wed Jan 04 2006 Fernando Nasser <fnasser@redhat.com> - 0:1.3.5-2jpp
- First JPP 1.7 build
* Wed Nov 16 2005 Ralph Apel <r.apel at r-apel.de> - 0:1.3.5-1jpp
- First JPackage release