Name:           javacc
Version:        7.0.2
Release:        8
Epoch:          0
Summary:        A parser/scanner generator for java
License:        BSD
URL:            http://javacc.org
Source0:        https://github.com/javacc/javacc/archive/release_7_0_2.tar.gz
BuildRequires:  javapackages-local ant javacc
Requires:       javapackages-tools
BuildArch:      noarch

%description
Java Compiler Compiler (JavaCC) is a generator which can generate grammar and lexical analyzer.
The parser generator converts a grammar specification to a Java program that can recognize matches to
the grammar. In addition, JavaCC provides other standard capabilities related to parser generation
such as tree building (with JJTree included with JavaCC), actions, debugging, etc.

%package help
Summary:     Help documentation for %{name}
Provides:    %{name}-javadoc = %{version}-%{release}
Provides:    %{name}-manual  = %{version}-%{release}
Provides:    %{name}-demo    = %{version}-%{release}
Obsoletes:   %{name}-javadoc < %{version}-%{release}
Obsoletes:   %{name}-manual  < %{version}-%{release}
Obsoletes:   %{name}-demo    < %{version}-%{release}

%description help
Help documentation for %{name}.

%prep
%autosetup -n %{name}-release_7_0_2 -p1

find . -name "*.jar" -delete
find . -name "*.class" -delete
find ./examples -type f -exec sed -i 's/\r//' {} \;
build-jar-repository -p bootstrap javacc
%mvn_file : %{name}

%build
ant jar javadoc
%mvn_artifact --skip-dependencies pom.xml target/javacc-%{version}.jar

%install
%mvn_install -J target/javadoc

%jpackage_script javacc '' '' javacc javacc true
ln -s %{_bindir}/javacc %{buildroot}%{_bindir}/javacc.sh
%jpackage_script jjdoc '' '' javacc jjdoc true
%jpackage_script jjtree '' '' javacc jjtree true

%files -f .mfiles
%license LICENSE
%{_bindir}/{javacc,javacc.sh,jjdoc,jjtree}

%files help -f .mfiles-javadoc
%license LICENSE
%doc README www/* examples

%changelog
* Mon Nov 14 2022 xu_ping <xuping33@h-partners.com> - 0:7.0.2-8
- change source

* Sat Mar 7 2020 zhangchunyu <zhangchunyu11@huawei.com> - 0:7.0.2-7
- Package init
