%global namedreltag -b003
%global namedversion %{version}%{?namedreltag}
Name:                glassfish-gmbal
Version:             3.2.0
Release:             2
Summary:             GlassFish MBean Annotation Library
License:             (CDDL-1.1 OR GPL-2.0-with-classpath-exception) AND IPL-1.0 AND LGPL-2.1-only AND Apache-2.0 AND CPL-1.0
URL:                 http://java.net/projects/gmbal/pages/Home
Source0:             https://github.com/javaee/gmbal/archive/VERSION-%{namedversion}.tar.gz
Source1:             https://src.fedoraproject.org/rpms/glassfish-gmbal/raw/f30/f/%{name}-%{namedversion}-01-build.xml
BuildRequires:       ant ant-junit aqute-bnd glassfish-management-api glassfish-pfl
BuildRequires:       javapackages-local junit
BuildArch:           noarch
%description
The GlassFish MBean Annotation Library (gmbal, pronounced "Gumball")
is a library for using annotations to create Open MBeans. There is similar
functionality in JSR 255 for JDK 7, but gmbal only requires JDK 5. Gmbal
also supports JSR 77 ObjectNames and the GlassFish Version 3 AMX
requirements for MBeans. AS a consequence, gmbal-enabled classes
will be fully manageable in GlassFish v3 using the standard GlassFish
v3 admin tools, while still being manageable with generic MBean tools
when not run under GlassFish v3.

%package javadoc
Summary:             Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.

%prep
%setup -q -n gmbal-VERSION-%{namedversion}
cp -p %{SOURCE1} build.xml
rm -r test/org/glassfish/gmbal/impl/AMXClientTest.java

%build
%ant jars javadoc test
bnd wrap -p make/gmbal.bnd -o dist/gmbal.bar dist/gmbal.jar
mv dist/gmbal.bar dist/gmbal.jar
bnd wrap -p make/gmbal-api-only.bnd -o dist/gmbal-api-only.bar dist/gmbal-api-only.jar
mv dist/gmbal-api-only.bar dist/gmbal-api-only.jar

%install
%mvn_file org.glassfish.gmbal:gmbal %{name}
%mvn_file org.glassfish.gmbal:gmbal-api-only %{name}-api-only
%mvn_artifact make/gmbal.pom dist/gmbal.jar
%mvn_artifact make/gmbal-api-only.pom dist/gmbal-api-only.jar
%mvn_install -J dist/javadoc

%files -f .mfiles
%license legal/LICENSE.TXT

%files javadoc -f .mfiles-javadoc
%license legal/LICENSE.TXT

%changelog
* Thu May 12 2022 Ge Wang <wangge20@h-partners.com> - 3.2.0-2
- license compliance rectification

* Mon Aug 17 2020 Ge Wang <wangge20@huawei.com> - 3.2.0-1
- package init
