From 84204f9ce0b86bc5469e694a9bcae69ae4e9872aaeefc8dcfda72e49889d5bc5 Mon Sep 17 00:00:00 2001 From: Michal Vyskocil Date: Fri, 24 Feb 2012 08:48:17 +0000 Subject: [PATCH] removed _link OBS-URL: https://build.opensuse.org/package/show/Java:packages/bouncycastle?expand=0&rev=5 --- .gitattributes | 23 ++++ .gitignore | 1 + bcprov-jdk16-1.46.pom | 21 ++++ bcprov-jdk16-146-FEDORA.tar.gz | 3 + bouncycastle.changes | 6 ++ bouncycastle.spec | 187 +++++++++++++++++++++++++++++++++ 6 files changed, 241 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 bcprov-jdk16-1.46.pom create mode 100644 bcprov-jdk16-146-FEDORA.tar.gz create mode 100644 bouncycastle.changes create mode 100644 bouncycastle.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/bcprov-jdk16-1.46.pom b/bcprov-jdk16-1.46.pom new file mode 100644 index 0000000..62ef2e0 --- /dev/null +++ b/bcprov-jdk16-1.46.pom @@ -0,0 +1,21 @@ + + + 4.0.0 + org.bouncycastle + bcprov-jdk16 + jar + Bouncy Castle Provider + 1.45 + The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.6. + http://www.bouncycastle.org/java.html + + + Bouncy Castle Licence + http://www.bouncycastle.org/licence.html + repo + + + + http://www.bouncycastle.org/viewcvs/viewcvs.cgi/java + + \ No newline at end of file diff --git a/bcprov-jdk16-146-FEDORA.tar.gz b/bcprov-jdk16-146-FEDORA.tar.gz new file mode 100644 index 0000000..d11bfc2 --- /dev/null +++ b/bcprov-jdk16-146-FEDORA.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edb2665c3aff88aceef98f4a4b8b1cd95a2ef2796170641fd8343e4aa050dfc2 +size 3634603 diff --git a/bouncycastle.changes b/bouncycastle.changes new file mode 100644 index 0000000..ab0666e --- /dev/null +++ b/bouncycastle.changes @@ -0,0 +1,6 @@ +------------------------------------------------------------------- +Mon Jan 16 14:19:33 UTC 2012 - mvyskocil@suse.cz + +- Initial packaging for SUSE + from Fedora's bouncycastle 1.46 + diff --git a/bouncycastle.spec b/bouncycastle.spec new file mode 100644 index 0000000..e639e76 --- /dev/null +++ b/bouncycastle.spec @@ -0,0 +1,187 @@ +# +# spec file for package bouncycastle +# +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# +%define ver 1.46 +%define archivever jdk16-%(echo %{ver}|sed 's|\\\.||') +%define classname org.bouncycastle.jce.provider.BouncyCastleProvider +%define _mavenpomdir %{_datadir}/maven2/poms + +Summary: Bouncy Castle Crypto Package for Java +License: MIT +Group: Development/Libraries/Java +Name: bouncycastle +Version: %{ver} +Release: 0 +Url: http://www.%{name}.org/ +# Original source http://www.bouncycastle.org/download/bcprov-%{archivever}.tar.gz +# is modified to +# bcprov-%{archivever}-FEDORA.tar.gz with patented algorithms removed. +# Specifically: IDEA algorithms got removed. +Source0: bcprov-%{archivever}-FEDORA.tar.gz +#Source1: http://repo2.maven.org/maven2/org/bouncycastle/bcprov-jdk16/%{version}/bcprov-jdk16-%{version}.pom +Source1: bcprov-jdk16-%{version}.pom +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: jpackage-utils >= 1.5 +Requires(post): jpackage-utils >= 1.7 +Requires(postun): jpackage-utils >= 1.7 +BuildArch: noarch +BuildRequires: java-devel +BuildRequires: unzip +Requires: java +BuildRequires: junit4 + +Provides: bcprov = %{version}-%{release} + +%description +The Bouncy Castle Crypto package is a Java implementation of cryptographic +algorithms. The package is organised so that it contains a light-weight API +suitable for use in any environment (including the newly released J2ME) with +the additional infrastructure to conform the algorithms to the JCE framework. + +%package javadoc +Summary: Javadoc for %{name} +Group: Development/Libraries/Java +BuildArch: noarch +Requires: %{name} = %{version}-%{release} +Requires: jpackage-utils + +%description javadoc +API documentation for the %{name} package. + +%prep +%setup -q -n bcprov-%{archivever} + +# Remove provided binaries +find . -type f -name "*.class" -exec rm -f {} \; +find . -type f -name "*.jar" -exec rm -f {} \; + +mkdir src +unzip -qq src.zip -d src/ + +%build +pushd src + export CLASSPATH=$(build-classpath junit4) + %javac -g -target 1.5 -encoding UTF-8 $(find . -type f -name "*.java") + jarfile="../bcprov-%{version}.jar" + # Exclude all */test/* files except org.bouncycastle.util.test, cf. upstream + files="$(find . -type f \( -name '*.class' -o -name '*.properties' \) -not -path '*/test/*')" + files="$files $(find . -type f -path '*/org/bouncycastle/util/test/*.class')" + files="$files $(find . -type f -path '*/org/bouncycastle/jce/provider/test/*.class')" + files="$files $(find . -type f -path '*/org/bouncycastle/ocsp/test/*.class')" + 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 -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/java/security/security.d +touch $RPM_BUILD_ROOT%{_sysconfdir}/java/security/security.d/2000-%{classname} + +# install bouncy castle provider +install -dm 755 $RPM_BUILD_ROOT%{_javadir} +install -pm 644 bcprov-%{version}.jar \ + $RPM_BUILD_ROOT%{_javadir}/bcprov-%{version}.jar +pushd $RPM_BUILD_ROOT%{_javadir} + ln -sf bcprov-%{version}.jar bcprov.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-bcprov.pom +%add_to_maven_depmap org.bouncycastle bcprov-jdk16 %{version} JPP bcprov + +%check +pushd src + export CLASSPATH=$PWD:$(build-classpath junit4) + 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 + +%post +{ + # Rebuild the list of security providers in classpath.security + suffix=security/classpath.security + secfiles="/usr/lib/$suffix /usr/lib64/$suffix" + + for secfile in $secfiles + do + # check if this classpath.security file exists + [ -f "$secfile" ] || continue + + sed -i '/^security\.provider\./d' "$secfile" + + count=0 + for provider in $(ls /etc/java/security/security.d) + do + count=$((count + 1)) + echo "security.provider.${count}=${provider#*-}" >> "$secfile" + done + done +} || : + +%update_maven_depmap + +%postun +if [ $1 -eq 0 ] ; then + + { + # Rebuild the list of security providers in classpath.security + suffix=security/classpath.security + secfiles="/usr/lib/$suffix /usr/lib64/$suffix" + + for secfile in $secfiles + do + # check if this classpath.security file exists + [ -f "$secfile" ] || continue + + sed -i '/^security\.provider\./d' "$secfile" + + count=0 + for provider in $(ls /etc/java/security/security.d) + do + count=$((count + 1)) + echo "security.provider.${count}=${provider#*-}" >> "$secfile" + done + done + } || : + +fi +%update_maven_depmap + +%files +%defattr(0644,root,root,0755) +%doc *.html +%{_javadir}/bcprov.jar +%{_javadir}/bcprov-%{version}.jar +%{_javadir}/* +%{_sysconfdir}/java/* +%{_mavenpomdir}/JPP-bcprov.pom +%config %{_mavendepmapfragdir}/%{name} +%dir /usr/share/maven2 + +%files javadoc +%defattr(0644,root,root,0755) +%{_javadocdir}/%{name}/ + +%changelog