Name:                aspectjweaver
Version:             1.8.9
Release:             1
Summary:             Java byte-code weaving library
License:             EPL
URL:                 http://eclipse.org/aspectj/
Source0:             https://repo1.maven.org/maven2/org/aspectj/%{name}/%{version}/%{name}-%{version}-sources.jar
Source1:             aspectjweaver-build.xml
Source2:             https://repo1.maven.org/maven2/org/aspectj/%{name}/%{version}/%{name}-%{version}.pom
Source3:             epl-v10.txt
BuildRequires:       ant apache-commons-logging javapackages-local objectweb-asm glibc-langpack-en
BuildArch:           noarch
%description
The AspectJ Weaver supports byte-code weaving for aspect-oriented
programming (AOP) in java.

%package javadoc
Summary:             Javadoc for %{name}
%description javadoc
API documentation for %{summary}.

%prep
%setup -q -c
sed -i.objectweb-asm "s|import aj.|import |" \
 org/aspectj/weaver/bcel/asm/StackMapAdder.java
cp %{SOURCE1} build.xml
rm org/aspectj/weaver/loadtime/JRockitAgent.java
cp %{SOURCE2} pom.xml
%pom_xpath_inject "pom:project" "
  <dependencies>
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm</artifactId>
      <version>5.0.3</version>
    </dependency>
  </dependencies>"
cp %{SOURCE3} .

%build
%mvn_file org.aspectj:%{name} %{name}
%mvn_alias org.aspectj:%{name} "org.aspectj:aspectjrt" "aspectj:aspectjrt"
LANG=en_US.ISO8859-1 CLASSPATH=$( build-classpath objectweb-asm/asm commons-logging ) ant
LANG=en_US.ISO8859-1 CLASSPATH=$( build-classpath objectweb-asm/asm commons-logging ) ant javadoc
%mvn_artifact pom.xml build/%{name}.jar

%install
%mvn_install -J javadoc

%files -f .mfiles
%license epl-v10.txt

%files javadoc -f .mfiles-javadoc
%license epl-v10.txt

%changelog
* Sat Aug 22 2020 Jeffery.Gao <gaojianxing@huawei.com> - 1.8.9-1
- package init
