Remove build-dependency on cobertura-maven-plugin

(cobertura was removed from Fedora due to licensing issues)
- Enable tests in EPEL 7
- Implement new license packaging guidelines
This commit is contained in:
Mattias Ellert 2015-07-12 00:25:12 +02:00
commit 2a5360f074
2 changed files with 533 additions and 28 deletions

View file

@ -1,6 +1,6 @@
Name: voms-api-java
Version: 3.0.5
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Virtual Organization Membership Service Java API
Group: Development/Libraries
@ -11,6 +11,8 @@ Source0: https://github.com/italiangrid/%{name}/archive/v%{version}.tar.gz
Patch0: %{name}-bc147.patch
# Disable tests using non-local network interface
Patch1: %{name}-no-local.patch
# Fix javadoc warnings/errors
Patch2: %{name}-javadoc.patch
BuildArch: noarch
BuildRequires: maven-local
@ -18,20 +20,13 @@ BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-compiler-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-javadoc-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-release-plugin)
BuildRequires: mvn(eu.eu-emi.security:canl)
%if %{?fedora}%{!?fedora:0} >= 21 || %{?rhel}%{!?rhel:0} >= 7
BuildRequires: mvn(org.bouncycastle:bcpkix-jdk15on)
%else
BuildRequires: mvn(org.bouncycastle:bcmail-jdk16)
%endif
BuildRequires: mvn(junit:junit)
%if %{?fedora}%{!?fedora:0}
# Missing stuff in EPEL (mostly test frameworks)
BuildRequires: mvn(com.mycila.maven-license-plugin:maven-license-plugin)
BuildRequires: mvn(org.codehaus.mojo:cobertura-maven-plugin)
BuildRequires: mvn(org.mockito:mockito-core)
%if %{?fedora}%{!?fedora:0}
# Missing in EPEL
BuildRequires: mvn(com.mycila.maven-license-plugin:maven-license-plugin)
BuildRequires: mvn(net.jcip:jcip-annotations)
%endif
@ -54,47 +49,48 @@ Virtual Organization Membership Service (VOMS) Java API Documentation.
%prep
%setup -q
%if %{?fedora}%{!?fedora:0} >= 21 || %{?rhel}%{!?rhel:0} >= 7
%patch0 -p1
%pom_xpath_replace "pom:project/pom:dependencies/pom:dependency[pom:artifactId='bcmail']/pom:groupId/text()" "org.bouncycastle"
%pom_xpath_replace "pom:project/pom:dependencies/pom:dependency[pom:artifactId='bcmail']/pom:artifactId/text()" "bcpkix-jdk15on"
%else
%pom_xpath_replace "pom:project/pom:dependencies/pom:dependency[pom:artifactId='bcmail']/pom:groupId/text()" "org.bouncycastle"
%pom_xpath_replace "pom:project/pom:dependencies/pom:dependency[pom:artifactId='bcmail']/pom:artifactId/text()" "bcmail-jdk16"
%endif
%patch1 -p1
%patch2 -p1
%pom_xpath_set "pom:project/pom:dependencies/pom:dependency[pom:artifactId='bcmail']/pom:groupId" "org.bouncycastle"
%pom_xpath_set "pom:project/pom:dependencies/pom:dependency[pom:artifactId='bcmail']/pom:artifactId" "bcpkix-jdk15on"
%pom_remove_plugin org.codehaus.mojo:cobertura-maven-plugin
%if %{?fedora}%{!?fedora:0}
%pom_xpath_inject "pom:project/pom:build/pom:plugins/pom:plugin[pom:groupId='com.mycila.maven-license-plugin']/pom:configuration/pom:excludes" "<exclude>.xmvn/**</exclude>"
%pom_xpath_remove "pom:project/pom:build/pom:plugins/pom:plugin[pom:groupId='com.mycila.maven-license-plugin']/pom:configuration/pom:strictCheck"
%else
# Missing stuff in EPEL (mostly test frameworks)
# Missing in EPEL
%pom_remove_plugin com.mycila.maven-license-plugin:maven-license-plugin
%pom_remove_plugin org.codehaus.mojo:cobertura-maven-plugin
%pom_remove_dep net.jcip:jcip-annotations
%pom_remove_dep org.mockito:mockito-core
%endif
%build
%if %{?fedora}%{!?fedora:0}
%mvn_build
%else
# Can not run tests in EPEL due to missing test frameworks
%mvn_build -f
%endif
%install
%mvn_install -J target/site/javadoc/apidocs
%files -f .mfiles
%dir %{_javadir}/%{name}
%doc AUTHORS LICENSE README.md
%if %{?fedora}%{!?fedora:0} >= 21 || %{?rhel}%{!?rhel:0} >= 8
%dir %{_mavenpomdir}/%{name}
%endif
%doc AUTHORS README.md
%license LICENSE
%files javadoc -f .mfiles-javadoc
%doc LICENSE
%license LICENSE
%changelog
* Sat Jul 11 2015 Mattias Ellert <mattias.ellert@fysast.uu.se> - 3.0.5-3
- Remove build-dependency on cobertura-maven-plugin
(cobertura was removed from Fedora due to licensing issues)
- Enable tests in EPEL 7
- Implement new license packaging guidelines
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild