%global githash 6f4d22725ef28f09bfd5422939b83e1865b5daef
Name:                proxytoys
Version:             1.0
Release:             1
Summary:             An implementation neutral API for creation of dynamic proxies
License:             BSD
Url:                 http://proxytoys.github.io/
Source0:             https://github.com/proxytoys/proxytoys/archive/%{githash}/%{name}-%{githash}.tar.gz
Patch0:              proxytoys-1.0-tests.patch
BuildRequires:       maven-local mvn(cglib:cglib) mvn(junit:junit)
BuildRequires:       mvn(org.mockito:mockito-all) mvn(xpp3:xpp3)
BuildArch:           noarch
%description
ProxyToys provides a collection of toys acting as factories for
creating "special" proxies such as:
* Decorators - for simple AOP-like chained method interception
* Delegates - for method invocation on a delegate object,
  that might have different type
* Dispatcher proxy - single proxy instance dispatching method
  calls to different object with separate types
* Echo proxy - for tracing method calls
* Failover objects - fails over to a next object in case of
  exception
* Hot swapping proxy - allows implementation hiding that
  can be swapped, and mutual dependencies
* Multicasting objects - for multicasting a method invocation
  to multiple objects
* Null objects - for default implementations of classes that
  do nothing at all
* Pool - for a pool implementation with proxied objects that
  return automatically to the pool

%package example-code
Summary:             ProxyToys Example Code
%description example-code
This package contains ProxyToys example code.

%package parent
Summary:             ProxyToys parent POM
%description parent
ProxyToys parent POM.

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

%prep
%setup -q -n %{name}-%{githash}
find -name '*.class' -delete
find -name '*.jar' -print -delete
%patch0 -p0
%pom_disable_module website
%pom_xpath_remove "pom:build/pom:extensions"
%pom_remove_plugin :xsite-maven-plugin
%pom_remove_plugin :maven-source-plugin
%pom_remove_plugin :maven-source-plugin example-code
%pom_remove_plugin :maven-source-plugin %{name}
%pom_remove_plugin :cobertura-maven-plugin
%pom_remove_plugin :cobertura-maven-plugin %{name}
%pom_remove_plugin :maven-javadoc-plugin %{name}
%pom_remove_plugin :findbugs-maven-plugin %{name}
%pom_remove_plugin :javancss-maven-plugin %{name}
%pom_remove_plugin :jdepend-maven-plugin %{name}
%pom_remove_plugin :jxr-maven-plugin %{name}
%pom_remove_plugin :maven-pmd-plugin %{name}
%pom_xpath_remove "pom:dependency[pom:classifier='javadoc']"
%pom_change_dep cglib: :cglib
%pom_change_dep cglib: :cglib %{name}
%pom_xpath_set "pom:dependency[pom:groupId='cglib']/pom:optional" false %{name}
%pom_change_dep :xstream org.jvnet.hudson:
%pom_change_dep :xstream org.jvnet.hudson: %{name}
%pom_add_dep xpp3:xpp3:1.1.4c:test %{name}
%mvn_file :%{name} %{name}
%mvn_file :%{name}-example-code %{name}-example-code
%mvn_alias :%{name} "proxytoys:proxytoys"

%build
%mvn_build -sf -- -Dproject.build.sourceEncoding=UTF-8

%install
%mvn_install

%files -f .mfiles-%{name}
%license LICENSE.txt

%files example-code -f .mfiles-%{name}-example-code
%license LICENSE.txt

%files parent -f .mfiles-%{name}-parent
%license LICENSE.txt

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

%changelog
* Thu Aug 20 2020 zhanghua <zhanghua40@huawei.com> - 1.0-1
- Package init
