Name: jflex
Version: 1.6.1
Release: 13
Summary: Scanner Generator for Java
License: BSD
URL: http://jflex.de/
BuildArch: noarch
Source0: https://sourceforge.net/projects/jflex/files/jflex/1.6.1/%{name}-%{version}.tar.gz
Source1: %{name}.desktop
Source2: %{name}.1
BuildRequires: maven-local ant jflex junit sonatype-oss-parent
BuildRequires: java-devel java_cup desktop-file-utils emacs
Requires: emacs-filesystem >= %{_emacs_version}
Requires: javapackages-tools
%description
JFlex is a lexical analyzer generator for Java, written in Java.
It can also be used together with other parser generators like ANTLR
or as a standalone tool.
%package help
Summary: Documentation for jflex
Provides: %{name}-javadoc = %{version}-%{release}
Obsoletes: %{name}-javadoc < %{version}-%{release}
%description help
This package provides documentation for jflex.
%prep
%autosetup -n jflex-1.6.1 -p1
find . -name "*.jar" -delete
rm -Rf src/main/java/java_cup/ examples/
%mvn_file : jflex
%pom_add_dep java_cup:java_cup
%pom_remove_plugin :maven-antrun-plugin
%pom_remove_plugin :jflex-maven-plugin
%pom_xpath_inject "pom:plugin[pom:artifactId='maven-surefire-plugin']/pom:configuration" "-Xss16384k"
%build
java -jar $(find-jar java_cup) -parser LexParse -interface -destdir src/main/java src/main/cup/LexParse.cup
jflex -d src/main/java/jflex --skel src/main/jflex/skeleton.nested src/main/jflex/LexScan.flex
%mvn_build
%{_emacs_bytecompile} lib/jflex-mode.el
%install
%mvn_install
%jpackage_script jflex.Main "" "" jflex:java_cup jflex true
install -d -m 755 %{buildroot}%{_mandir}/man1
install -p -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man1
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
install -d -m 755 %{buildroot}%{_datadir}/pixmaps
install -d -m 755 %{buildroot}%{_emacs_sitelispdir}/%{name}
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
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1.gz
%{_datadir}/applications/%{name}.desktop
%{_emacs_sitelispdir}/%{name}
%files help
%doc doc
%doc COPYRIGHT
%doc %{_javadocdir}/%{name}
%changelog
* Wed Feb 19 2020 fengbing - 1.6.1-13
- Package init