Blame SPECS/powermock.spec

2c43cd
%{?scl:%scl_package powermock}
2c43cd
%{!?scl:%global pkg_name %{name}}
2c43cd
2c43cd
Name:           %{?scl_prefix}powermock
2c43cd
Version:        1.6.5
2c43cd
Release:        5.3%{?dist}
2c43cd
Summary:        A Java mocking framework
2c43cd
2c43cd
# Note: api-mockito subpackage is ASL 2.0 and MIT, the rest is ASL 2.0
2c43cd
License:        ASL 2.0
2c43cd
URL:            https://github.com/jayway/powermock
2c43cd
Source0:        https://github.com/jayway/%{pkg_name}/archive/%{pkg_name}-%{version}.tar.gz
2c43cd
2c43cd
Patch1:         0001-Fix-junit3-compat.patch
2c43cd
# powermock contains forked version of mockito
2c43cd
# this is the same patch as in mockito to fix incompatibility with our cglib
2c43cd
Patch2:         0002-Setting-naming-policy.patch
2c43cd
2c43cd
BuildArch:      noarch
2c43cd
2c43cd
BuildRequires:  %{?scl_prefix}maven-local
2c43cd
BuildRequires:  %{?scl_prefix}mvn(cglib:cglib-nodep)
2c43cd
BuildRequires:  %{?scl_prefix}mvn(commons-logging:commons-logging)
2c43cd
BuildRequires:  %{?scl_prefix}mvn(javax.servlet:servlet-api)
2c43cd
BuildRequires:  %{?scl_prefix}mvn(junit:junit)
2c43cd
BuildRequires:  %{?scl_prefix}mvn(org.apache.felix:maven-bundle-plugin)
2c43cd
BuildRequires:  %{?scl_prefix}mvn(org.assertj:assertj-core)
2c43cd
BuildRequires:  %{?scl_prefix}mvn(org.easymock:easymock)
2c43cd
BuildRequires:  %{?scl_prefix}mvn(org.hamcrest:hamcrest-core)
2c43cd
BuildRequires:  %{?scl_prefix}mvn(org.javassist:javassist)
2c43cd
BuildRequires:  %{?scl_prefix}mvn(org.mockito:mockito-core)
2c43cd
BuildRequires:  %{?scl_prefix}mvn(org.objenesis:objenesis)
2c43cd
BuildRequires:  %{?scl_prefix}mvn(org.sonatype.oss:oss-parent:pom:)
2c43cd
BuildRequires:  %{?scl_prefix}mvn(org.testng:testng)
2c43cd
2c43cd
2c43cd
%global desc \
2c43cd
PowerMock is a framework that extend other mock libraries\
2c43cd
such as EasyMock with more powerful capabilities. PowerMock uses a\
2c43cd
custom classloader and bytecode manipulation to enable mocking of\
2c43cd
static methods, constructors, final classes and methods, private\
2c43cd
methods, removal of static initializers and more.
2c43cd
2c43cd
%description
2c43cd
%{desc}
2c43cd
2c43cd
%package common
2c43cd
Summary:        Common files for PowerMock
2c43cd
2c43cd
%description common
2c43cd
%{desc}
2c43cd
2c43cd
This package contains common files for all PowerMock modules.
2c43cd
2c43cd
%package reflect
2c43cd
Summary:        Reflection module of PowerMock
2c43cd
Requires:       %{name}-common = %{version}-%{release}
2c43cd
2c43cd
%description reflect
2c43cd
%{desc}
2c43cd
2c43cd
This package contains the reflection module of PowerMock.
2c43cd
2c43cd
%package core
2c43cd
Summary:        Core module of PowerMock
2c43cd
Requires:       %{name}-common = %{version}-%{release}
2c43cd
2c43cd
%description core
2c43cd
%{desc}
2c43cd
2c43cd
This package contains the core module of PowerMock.
2c43cd
2c43cd
%package junit4
2c43cd
Summary:        JUnit4 common module of PowerMock
2c43cd
Requires:       %{name}-common = %{version}-%{release}
2c43cd
2c43cd
%description junit4
2c43cd
%{desc}
2c43cd
2c43cd
This package contains the JUnit4 module of PowerMock.
2c43cd
2c43cd
%package api-support
2c43cd
Summary:        PowerMock API support module
2c43cd
Requires:       %{name}-common = %{version}-%{release}
2c43cd
2c43cd
%description api-support
2c43cd
%{desc}
2c43cd
2c43cd
This package contains support code for the PowerMock API extensions.
2c43cd
2c43cd
%package api-mockito
2c43cd
# Bundles forked mockito, which is under MIT
2c43cd
License:        ASL 2.0 and MIT
2c43cd
Provides:       bundled(mockito) = 2.0
2c43cd
Summary:        PowerMock Mockito API module
2c43cd
Requires:       %{name}-common = %{version}-%{release}
2c43cd
2c43cd
%description api-mockito
2c43cd
%{desc}
2c43cd
2c43cd
This package contains the PowerMock Mockito API extension.
2c43cd
2c43cd
%package api-easymock
2c43cd
Summary:        PowerMock EasyMock API module
2c43cd
Requires:       %{name}-common = %{version}-%{release}
2c43cd
2c43cd
%description api-easymock
2c43cd
%{desc}
2c43cd
2c43cd
This package contains the PowerMock EasyMock API extension.
2c43cd
2c43cd
%package testng
2c43cd
Summary:        PowerMock module for TestNG.
2c43cd
Requires:       %{name}-common = %{version}-%{release}
2c43cd
2c43cd
%description testng
2c43cd
%{desc}
2c43cd
2c43cd
This package contains the PowerMock TestNG extension.
2c43cd
2c43cd
%package javadoc
2c43cd
Summary:        JavaDocs for %{pkg_name}
2c43cd
2c43cd
%description javadoc
2c43cd
%{desc}
2c43cd
2c43cd
This package contains the API documentation for %{pkg_name}.
2c43cd
2c43cd
%prep
2c43cd
%setup -q -n %{pkg_name}-%{pkg_name}-%{version}
2c43cd
2c43cd
%patch1 -p1
2c43cd
%patch2 -p1
2c43cd
2c43cd
# bundled sources of various libraries
2c43cd
rm -r modules/module-impl/agent
2c43cd
# there is forked mockito, which contains bundled cglib and asm
2c43cd
rm -r api/mockito2/src/main/java/org/powermock/api/mockito/repackaged/{cglib,asm}
2c43cd
2c43cd
find -name '*.java' | xargs sed -i 's/org\.mockito\.cglib/net.sf.cglib/g;
2c43cd
                                    s/org\.powermock\.api\.mockito\.repackaged\.cglib/net.cf.cglib/g;
2c43cd
                                    s/org\.powermock\.api\.mockito\.repackaged\.asm/org.objectweb.asm/g'
2c43cd
2c43cd
# Assumes different JUnit version
2c43cd
rm modules/module-impl/junit4-common/src/test/java/org/powermock/modules/junit4/common/internal/impl/JUnitVersionTest.java
2c43cd
2c43cd
# StackOverflow in koji
2c43cd
sed -i '/shouldLoadClassAndOverrideMethodGreaterThanJvmLimit/i@org.junit.Ignore' \
2c43cd
    core/src/test/java/org/powermock/core/transformers/impl/ClassMockTransformerTest.java
2c43cd
2c43cd
# Disable modules that we cannot build (yet).
2c43cd
%pom_disable_module module-test modules
2c43cd
%pom_disable_module junit4-legacy modules/module-impl
2c43cd
%pom_disable_module junit4-rule-agent modules/module-impl
2c43cd
%pom_disable_module junit3 modules/module-impl
2c43cd
%pom_disable_module testng-agent modules/module-impl
2c43cd
%pom_disable_module agent modules/module-impl
2c43cd
%pom_disable_module examples
2c43cd
%pom_disable_module release
2c43cd
%pom_disable_module classloading-xstream classloading
2c43cd
%pom_disable_module mockito2 api
2c43cd
2c43cd
%pom_remove_plugin :rat-maven-plugin
2c43cd
%pom_remove_plugin :maven-source-plugin
2c43cd
%pom_xpath_remove "pom:plugin[pom:artifactId='maven-javadoc-plugin']/pom:executions"
2c43cd
2c43cd
%mvn_package :powermock-core core
2c43cd
%mvn_package :powermock-classloading-base core
2c43cd
%mvn_package :powermock-classloading-objenesis core
2c43cd
%mvn_package :powermock-module-junit4 junit4
2c43cd
%mvn_package :powermock-module-junit4-rule junit4
2c43cd
%mvn_package :powermock-module-junit4-common junit4
2c43cd
%mvn_package :powermock-api-mockito api-mockito
2c43cd
%mvn_package :powermock-api-mockito-common api-mockito
2c43cd
%mvn_package :powermock-api-support api-support
2c43cd
%mvn_package :powermock-api-easymock api-easymock
2c43cd
%mvn_package :powermock-reflect reflect
2c43cd
%mvn_package :powermock-module-testng testng
2c43cd
%mvn_package :powermock-module-testng-common testng
2c43cd
2c43cd
%mvn_package org.powermock.tests: __noinstall
2c43cd
2c43cd
# poms are not needed by anything
2c43cd
%mvn_package ::pom: __noinstall
2c43cd
2c43cd
%build
2c43cd
%mvn_build
2c43cd
2c43cd
%install
2c43cd
%mvn_install
2c43cd
2c43cd
%files common
2c43cd
%dir %{_javadir}/%{pkg_name}
2c43cd
%license LICENSE.txt
2c43cd
2c43cd
%files reflect -f .mfiles-reflect
2c43cd
2c43cd
%files core -f .mfiles-core
2c43cd
2c43cd
%files junit4 -f .mfiles-junit4
2c43cd
2c43cd
%files api-support -f .mfiles-api-support
2c43cd
2c43cd
%files api-mockito -f .mfiles-api-mockito
2c43cd
%license api/mockito2/src/main/java/org/powermock/api/mockito/repackaged/Mockito-LICENSE.txt
2c43cd
2c43cd
%files api-easymock -f .mfiles-api-easymock
2c43cd
2c43cd
%files testng -f .mfiles-testng
2c43cd
2c43cd
%files javadoc -f .mfiles-javadoc
2c43cd
%license LICENSE.txt
2c43cd
2c43cd
%changelog
2c43cd
* Mon Aug 14 2017 Michael Simacek <msimacek@redhat.com> - 1.6.5-5.3
2c43cd
- Add license and provides for bundled mockito
2c43cd
2c43cd
* Thu Jun 22 2017 Michael Simacek <msimacek@redhat.com> - 1.6.5-5.2
2c43cd
- Mass rebuild 2017-06-22
2c43cd
2c43cd
* Wed Jun 21 2017 Java Maintainers <java-maint@redhat.com> - 1.6.5-5.1
2c43cd
- Automated package import and SCL-ization
2c43cd
2c43cd
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.5-5
2c43cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2c43cd
2c43cd
* Wed Jun 22 2016 Michael Simacek <msimacek@redhat.com> - 1.6.5-4
2c43cd
- Unbundle asm and cglib
2c43cd
- Patch forked mockito
2c43cd
2c43cd
* Fri Jun 17 2016 Michael Simacek <msimacek@redhat.com> - 1.6.5-3
2c43cd
- Skip test that overflows stack in koji
2c43cd
2c43cd
* Wed Jun 01 2016 Michael Simacek <msimacek@redhat.com> - 1.6.5-2
2c43cd
- Enable TestNG module
2c43cd
2c43cd
* Wed Jun 01 2016 Michael Simacek <msimacek@redhat.com> - 1.6.5-1
2c43cd
- Update to upstream version 1.6.5
2c43cd
2c43cd
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.2-3
2c43cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
2c43cd
2c43cd
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.2-2
2c43cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2c43cd
2c43cd
* Wed May 20 2015 Michael Simacek <msimacek@redhat.com> - 1.6.2-1
2c43cd
- Update to upstream version 1.6.2
2c43cd
- Update upstream URL
2c43cd
- Use upstream tarball since the bundled files are opensource and thus can be
2c43cd
  removed in %prep
2c43cd
2c43cd
* Tue Jun 10 2014 Severin Gehwolf <sgehwolf@redhat.com> - 1.4.12-12
2c43cd
- Fix FTBFS by dropping obsolete junit4 surefire provider and
2c43cd
  changing BR to junit over junit4.
2c43cd
- Resolves RHBZ#1106669.
2c43cd
2c43cd
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.12-11
2c43cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2c43cd
2c43cd
* Thu Mar 27 2014 Michael Simacek <msimacek@redhat.com> - 1.4.12-10
2c43cd
- Enable api-easymock module
2c43cd
2c43cd
* Fri Mar 21 2014 Michael Simacek <msimacek@redhat.com> - 1.4.12-9
2c43cd
- Use mvn_build
2c43cd
- Drop manual requires
2c43cd
- Use pom macros instead of a patch
2c43cd
- Collapse description into a macro
2c43cd
2c43cd
* Fri Jul 26 2013 Alexander Kurtakov <akurtako@redhat.com> 1.4.12-8
2c43cd
- Build against easymock3.
2c43cd
2c43cd
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.12-7
2c43cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2c43cd
2c43cd
* Wed Feb 06 2013 Java SIG <java-devel@lists.fedoraproject.org> - 1.4.12-6
2c43cd
- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild
2c43cd
- Replace maven BuildRequires with maven-local
2c43cd
2c43cd
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.12-5
2c43cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
2c43cd
2c43cd
* Fri May 18 2012 Roman Kennke <rkennke@redhat.com> 1.4.12-4
2c43cd
- Use svn export instead of svn checkout for creating source archive
2c43cd
- Remove 3rd party sources from source archive
2c43cd
2c43cd
* Mon May 07 2012 Roman Kennke <rkennke@redhat.com> 1.4.12-3
2c43cd
- Moved JARs to powermock subdirectory
2c43cd
- Removed .svn directories from created source package
2c43cd
- Removed 3rd party source files from created source package
2c43cd
2c43cd
* Mon Apr 30 2012 Roman Kennke <rkennke@redhat.com> 1.4.12-2
2c43cd
- Added javadoc subpackage
2c43cd
2c43cd
* Tue Apr 24 2012 Roman Kennke <rkennke@redhat.com> 1.4.12-1
2c43cd
- Initial package