Update to version 3

- Apply patch for bouncycastle 1.47+ on Fedora 21+ and EPEL 7+
- Convert to using xmvn
This commit is contained in:
Mattias Ellert 2014-03-10 16:20:07 +01:00
commit 6ffbd89911
7 changed files with 383 additions and 449 deletions

View file

@ -1,83 +1,37 @@
# Use maven if it is available - otherwise fall back to ant
%if %{?fedora}%{!?fedora:0} >= 15 || %{?rhel}%{!?rhel:0} >= 7
%global maven 1
%else
%global maven 0
%endif
Name: voms-api-java
Version: 2.0.10
Version: 3.0.2
%global tagver %(tr . _ <<< %{version})
Release: 4%{?dist}
Release: 1%{?dist}
Summary: Virtual Organization Membership Service Java API
Group: Development/Libraries
License: ASL 2.0
URL: https://wiki.italiangrid.it/VOMS
Source0: https://github.com/italiangrid/%{name}/archive/%{tagver}.tar.gz
# These are build instructions for ant generated from the maven
# build instrutions using the maven ant plugin.
# These are used for building on EPEL since there is no maven
# available there.
Source1: build.xml
Source2: maven-build.xml
Source3: maven-build.properties
Patch0: %{name}-test.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch0: %{name}-bc147.patch
BuildArch: noarch
# There is no bouncycastle in EPEL 5 ppc and EPEL 6 ppc64
%if %{?rhel}%{!?rhel:0} == 5
ExcludeArch: ppc
%endif
%if %{?rhel}%{!?rhel:0} == 6
ExcludeArch: ppc64
%endif
Requires: java
Requires: jpackage-utils
Requires: bouncycastle >= 1.39
%if %{?fedora}%{!?fedora:0} >= 15 || %{?rhel}%{!?rhel:0} >= 7
Requires: apache-commons-cli
Requires: apache-commons-lang
%else
Requires: jakarta-commons-cli
Requires: jakarta-commons-lang
%endif
Requires: log4j
Provides: vomsjapi = %{version}-%{release}
Obsoletes: vomsjapi < 2.0.7
BuildRequires: java-devel >= 1:1.6.0
BuildRequires: jpackage-utils
%if %maven
BuildRequires: maven-local
BuildRequires: maven-compiler-plugin
BuildRequires: maven-install-plugin
BuildRequires: maven-jar-plugin
BuildRequires: maven-javadoc-plugin
BuildRequires: maven-release-plugin
BuildRequires: maven-resources-plugin
BuildRequires: maven-surefire-plugin
BuildRequires: maven-surefire-provider-junit
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: ant
BuildRequires: ant-junit
BuildRequires: mvn(org.bouncycastle:bcmail-jdk16)
%endif
BuildRequires: bouncycastle >= 1.39
%if %{?fedora}%{!?fedora:0} >= 15 || %{?rhel}%{!?rhel:0} >= 7
BuildRequires: apache-commons-cli
BuildRequires: apache-commons-io
BuildRequires: apache-commons-lang
%else
BuildRequires: jakarta-commons-cli
BuildRequires: jakarta-commons-io
BuildRequires: jakarta-commons-lang
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)
BuildRequires: mvn(net.jcip:jcip-annotations)
%endif
BuildRequires: log4j
%description
The Virtual Organization Membership Service (VOMS) is an attribute authority
@ -92,8 +46,6 @@ This package provides a java client API for VOMS.
%package javadoc
Summary: Virtual Organization Membership Service Java API Documentation
Group: Documentation
Requires: jpackage-utils
Requires: %{name} = %{version}-%{release}
Provides: vomsjapi-javadoc = %{version}-%{release}
Obsoletes: vomsjapi-javadoc < 2.0.7
@ -102,58 +54,45 @@ Virtual Organization Membership Service (VOMS) Java API Documentation.
%prep
%setup -q -n %{name}-%{tagver}
%patch0 -p1
install -m 644 %SOURCE1 .
install -m 644 %SOURCE2 .
install -m 644 %SOURCE3 .
sed -e s/bcprov-ext-jdk16/bcprov-jdk16/ -i pom.xml
%if %{?fedora}%{!?fedora:0} >= 21 || %{?rhel}%{!?rhel:0} >= 7
%patch0 -p1
%endif
%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>"
%else
# Missing stuff in EPEL (mostly test frameworks)
%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 %{maven}
mvn-rpmbuild -Dbouncycastle.version=1.46 install javadoc:aggregate
%if %{?fedora}%{!?fedora:0}
%mvn_build
%else
export CLASSPATH=$(build-classpath bcprov log4j commons-cli commons-io commons-lang)
ant -Dbuild.sysclasspath=last package javadoc
# Can not run tests in EPEL due to missing test frameworks
%mvn_build -f
%endif
%install
mkdir -p %{buildroot}%{_javadir}
install -m 644 target/%{name}-%{version}.jar \
%{buildroot}%{_javadir}/%{name}.jar
ln -s %{name}.jar %{buildroot}%{_javadir}/vomsjapi.jar
%mvn_install -J target/site/javadoc/apidocs
mkdir -p %{buildroot}%{_javadocdir}/%{name}
%if %{maven}
cp -pr target/site/javadoc/apidocs %{buildroot}%{_javadocdir}/%{name}
%else
cp -pr target/site/apidocs %{buildroot}%{_javadocdir}/%{name}
%endif
%if %{maven}
mkdir -p %{buildroot}%{_mavenpomdir}
install -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap JPP-%{name}.pom %{name}.jar -a org.glite:vomsjapi
%endif
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_javadir}/%{name}.jar
%{_javadir}/vomsjapi.jar
%if %{maven}
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}
%endif
%files -f .mfiles
%dir %{_javadir}/%{name}
%doc AUTHORS LICENSE README.md
%files javadoc
%defattr(-,root,root,-)
%doc %{_javadocdir}/%{name}
%files javadoc -f .mfiles-javadoc
%doc LICENSE
%changelog
* Sun Mar 09 2014 Mattias Ellert <mattias.ellert@fysast.uu.se> - 3.0.2-1
- Update to version 3
- Apply patch for bouncycastle 1.47+ on Fedora 21+ and EPEL 7+
- Convert to using xmvn
* Mon Oct 14 2013 Mattias Ellert <mattias.ellert@fysast.uu.se> - 2.0.10-4
- Disable CRL tests (the CRL in the sources has expired)