#
# spec file for package byte-buddy
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%global upstream_name byte-buddy-byte-buddy

Name:           byte-buddy
Version:        1.11.12
Release:        4.66
License:        Apache-2.0
Summary:        Byte Buddy is a code generation and manipulation library for Java
URL:            http://bytebuddy.net
Group:          Development/Libraries/Java
Source0:        %{upstream_name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  fdupes
BuildRequires:  java-devel
BuildRequires:  maven-local
%if 0%{?rhel} >= 9
BuildRequires:  xmvn-tools
BuildRequires:  xmvn-minimal
%endif
BuildRequires:  mvn(com.google.code.findbugs:annotations)
BuildRequires:  mvn(net.java.dev.jna:jna)
BuildRequires:  mvn(net.java.dev.jna:jna-platform)
BuildRequires:  mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires:  mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)
BuildRequires:  mvn(org.apache.maven.plugins:maven-plugin-plugin)
BuildRequires:  mvn(org.apache.maven.plugins:maven-shade-plugin)
BuildRequires:  mvn(org.apache.maven:maven-core)
BuildRequires:  mvn(org.apache.maven:maven-plugin-api)
BuildRequires:  mvn(org.eclipse.aether:aether-api)
BuildRequires:  mvn(org.eclipse.aether:aether-util)
BuildRequires:  mvn(org.ow2.asm:asm) >= 9.2
BuildRequires:  mvn(org.ow2.asm:asm-commons) >= 9.2
BuildRequires:  mvn(org.sonatype.plexus:plexus-build-api)
BuildArch:      noarch
Requires:       java
Provides:       %{name} = %{version}-%{release}.module_el9.1.0+11+ae49fe6f

%description
Byte Buddy is a code generation and manipulation library for creating and modifying Java classes during the runtime of a Java application and without the help of a compiler. Other than the code generation utilities that ship with the Java Class Library, Byte Buddy allows the creation of arbitrary classes and is not limited to implementing interfaces for the creation of runtime proxies. Furthermore, Byte Buddy offers a convenient API for changing classes either manually, using a Java agent or during a build.

%package dep
Summary:        byte-budy dep POM
Group:          Development/Libraries/Java

%description dep
This package contains dep POM.

%package agent
Summary:        byte-budy agent POM
Group:          Development/Libraries/Java

%description agent
This package contains agent POM.

%package parent
Summary:        byte-budy parent POM
Group:          Development/Libraries/Java

%description parent
This package contains parent POM.

%package javadoc
Summary:        API documentation for %{name}
Group:          Documentation/HTML

%description javadoc
This package contains the API documentation for %{name}.

%package maven-plugin
Summary:        byte-budy maven-plugin POM
Group:          Development/Libraries/Java

%description maven-plugin
This package contains maven-plugin POM.

%prep
%setup -q -n "%{upstream_name}-%{version}"
find . "(" -name "*.jar" -o -name "*.zip" -o -name "*.class" ")" -delete

%pom_remove_plugin :nexus-staging-maven-plugin
%pom_remove_plugin :license-maven-plugin
%pom_remove_plugin -r :byte-buddy-maven-plugin
%pom_remove_plugin -r :modulemaker-maven-plugin
%pom_remove_plugin -r :maven-release-plugin
%pom_remove_plugin org.pitest:pitest-maven
%pom_remove_plugin :jacoco-maven-plugin
%pom_remove_plugin :coveralls-maven-plugin
%pom_remove_plugin :spotbugs-maven-plugin
%pom_remove_plugin com.github.ferstl:jitwatch-jarscan-maven-plugin
%pom_remove_plugin org.codehaus.mojo:clirr-maven-plugin

%pom_xpath_set "pom:dependency[pom:groupId = 'com.google.code.findbugs' ]/pom:artifactId" annotations

%pom_disable_module byte-buddy-android
%pom_disable_module byte-buddy-android-test

%pom_disable_module byte-buddy-benchmark
%pom_disable_module byte-buddy-gradle-plugin

%build
%{mvn_build} -f -s -- -Dsource=8

%install
%mvn_install
%fdupes -s %{buildroot}%{_javadocdir}

%files -f .mfiles-byte-buddy
%license LICENSE

%files agent -f .mfiles-byte-buddy-agent
%license LICENSE

%files dep -f .mfiles-byte-buddy-dep
%license LICENSE

%files parent -f .mfiles-byte-buddy-parent
%license LICENSE

%files javadoc -f .mfiles-javadoc
%license LICENSE

%files maven-plugin -f .mfiles-byte-buddy-maven-plugin
%license LICENSE

%changelog
* Sun Jun  5 2022 Michael Calmer <mc@suse.com>
- Update to version 1.11.12
  * Update ASM and support Java 18 without experimental configuration.
  * Remove `AccessController` API to replace with weaved access control
    via `AccessControllerPlugin`.
  * Add support for Java records.
  * Performance improvement on array creation.
  * Full release notes can be found at
  https://github.com/raphw/byte-buddy/blob/byte-buddy-1.11.12/release-notes.md
  Removed:
  * build.sh
- require objectweb-asm 9.2 or higher
* Fri Dec 21 2018 moio@suse.com
- initial version