%global ver 1.49 %global archivever jdk15on-%(echo %{ver}|sed 's|\\\.||') Summary: CMS, PKCS, EAC, TSP, CMP, CRMF, OCSP for Bouncy Castle Name: bouncycastle-pkix Version: %{ver} Release: 1%{?dist} License: MIT URL: http://www.bouncycastle.org/ Source0: http://www.bouncycastle.org/download/bcpkix-%{archivever}.tar.gz Source1: http://repo2.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/%{version}/bcpkix-jdk15on-%{version}.pom BuildArch: noarch BuildRequires: bouncycastle = %{version} BuildRequires: java-devel >= 1:1.7 BuildRequires: jpackage-utils BuildRequires: junit Requires: bouncycastle = %{version} Requires: java >= 1:1.7 Requires: jpackage-utils Provides: bcpkxi = %{version}-%{release} %description Bouncy Castle consists of a lightweight cryptography API and is a provider for the Java Cryptography Extension and the Java Cryptography Architecture. This library package offers additional classes, in particuar CMS, PKCS, EAC, TSP, CMP, CRMF, OCSP, and certificate generation. %package javadoc Summary: Javadoc for %{name} Requires: %{name} = %{version}-%{release} %description javadoc API documentation for the %{name} package. %prep %setup -q -n bcpkix-%{archivever} mkdir src unzip -qq src.zip -d src/ # Remove provided binaries find . -type f -name "*.class" -exec rm -f {} \; find . -type f -name "*.jar" -exec rm -f {} \; %build pushd src export CLASSPATH=$(build-classpath junit bcprov) %javac -g -source 1.6 -target 1.6 -encoding UTF-8 $(find . -type f -name "*.java") jarfile="../bcpkix.jar" # Exclude all */test/* , cf. upstream files="$(find . -type f \( -name '*.class' -o -name '*.properties' \) -not -path '*/test/*')" test ! -d classes && mf="" \ || mf="`find classes/ -type f -name "*.mf" 2>/dev/null`" test -n "$mf" && %jar cvfm $jarfile $mf $files \ || %jar cvf $jarfile $files popd %install # install bouncy castle pkix install -dm 755 $RPM_BUILD_ROOT%{_javadir} install -pm 644 bcpkix.jar \ $RPM_BUILD_ROOT%{_javadir}/bcpkix.jar install -dm 755 $RPM_BUILD_ROOT%{_javadir}/gcj-endorsed pushd $RPM_BUILD_ROOT%{_javadir}/gcj-endorsed ln -sf ../bcpkix.jar bcpkix.jar popd # javadoc mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name} cp -pr docs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name} # maven pom install -dm 755 $RPM_BUILD_ROOT%{_mavenpomdir} install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-bcpkix.pom %add_maven_depmap JPP-bcpkix.pom bcpkix.jar %check pushd src export CLASSPATH=$PWD:$(build-classpath junit bcprov) for test in $(find . -name AllTests.class) ; do test=${test#./} ; test=${test%.class} ; test=${test//\//.} # TODO: failures; get them fixed and remove || : %java org.junit.runner.JUnitCore $test || : done popd %files %doc *.html %{_javadir}/bcpkix.jar %{_javadir}/gcj-endorsed/bcpkix.jar %{_mavenpomdir}/JPP-bcpkix.pom %{_mavendepmapfragdir}/%{name} %files javadoc %{_javadocdir}/%{name} %changelog * Wed Oct 23 2013 Vít Ondruch - 1.49-1 - Initial version.