Sisyphus repository
Last update: 19 october 2019 | SRPMs: 17506 | Visits: 15299671
en ru br
ALT Linux repos
S:1.61-alt1_1jpp8
5.0: 1.37-alt1_5jpp1.7
4.1: 1.37-alt1_5jpp1.7
4.0: 1.37-alt1_5jpp1.7

Group :: Development/Java
RPM: bouncycastle

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

BuildRequires(pre): java-1.4.2-devel java-1.5.0-devel java-1.6.0-devel
BuildRequires: /proc
BuildRequires: jpackage-generic-compat
# Copyright (c) 2000-2007, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the JPackage Project nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

%define archivever 137

Summary:        Bouncy Castle Crypto Package for Java
Name:           bouncycastle
Version:        1.37
Release:        alt1_5jpp1.7
Epoch:          0
Group:          Development/Java
License:        BSD
URL:            http://www.bouncycastle.org/
BuildArch:      noarch
Source0:        http://www.bouncycastle.org/download/bcmail-jdk14-%{archivever}.tar.gz
Source1:        http://www.bouncycastle.org/download/bcmail-jdk15-%{archivever}.tar.gz
Source2:        http://www.bouncycastle.org/download/bcmail-jdk16-%{archivever}.tar.gz
Source3:        http://www.bouncycastle.org/download/bcpg-jdk14-%{archivever}.tar.gz
Source4:        http://www.bouncycastle.org/download/bcpg-jdk15-%{archivever}.tar.gz
Source5:        http://www.bouncycastle.org/download/bcpg-jdk16-%{archivever}.tar.gz
Source6:        http://www.bouncycastle.org/download/bcprov-jdk14-%{archivever}.tar.gz
Source7:        http://www.bouncycastle.org/download/bcprov-jdk15-%{archivever}.tar.gz
Source8:        http://www.bouncycastle.org/download/bcprov-jdk16-%{archivever}.tar.gz
Source9:        http://www.bouncycastle.org/download/lcrypto-jdk14-%{archivever}.tar.gz
Source10:        http://www.bouncycastle.org/download/lcrypto-jdk15-%{archivever}.tar.gz
Source11:        http://www.bouncycastle.org/download/lcrypto-jdk16-%{archivever}.tar.gz
Source12:        http://www.bouncycastle.org/download/bctsp-jdk14-%{archivever}.tar.gz
Source13:        http://www.bouncycastle.org/download/bctsp-jdk15-%{archivever}.tar.gz
Source14:        http://www.bouncycastle.org/download/bctsp-jdk16-%{archivever}.tar.gz
# FIXME: Just sign the jar
# We keep original 1.4 provider since java 1.4 wants it to be signed
# This sucks big time - should we add jar signing infrastructure to
# jpackage in || to rpm signing? Sun seems much less user-friendly than
# your average Linux distribution
Source15:       http://www.bouncycastle.org/download/bcprov-jdk14-%{archivever}.jar
Source16:       http://www.bouncycastle.org/download/bcprov-jdk15-%{archivever}.jar
Source17:       http://www.bouncycastle.org/download/bcprov-jdk16-%{archivever}.jar
Source18:       http://www.bouncycastle.org/download/bcmail-jdk14-%{archivever}.jar
Source19:       http://www.bouncycastle.org/download/bcmail-jdk15-%{archivever}.jar
Source20:       http://www.bouncycastle.org/download/bcmail-jdk16-%{archivever}.jar
Source21:       http://www.bouncycastle.org/download/bctsp-jdk14-%{archivever}.jar
Source22:       http://www.bouncycastle.org/download/bctsp-jdk15-%{archivever}.jar
Source23:       http://www.bouncycastle.org/download/bctsp-jdk16-%{archivever}.jar
Source24:       http://www.bouncycastle.org/download/bcpg-jdk14-%{archivever}.jar
Source25:       http://www.bouncycastle.org/download/bcpg-jdk15-%{archivever}.jar
Source26:       http://www.bouncycastle.org/download/bcpg-jdk16-%{archivever}.jar

Requires: %{name}-jdk1.5 = %{epoch}:%{version}-%{release}
Requires: jpackage-utils >= 0:1.7.3

BuildRequires: jaf
BuildRequires: javamail
BuildRequires: junit
BuildRequires: jpackage-utils >= 0:1.7.3

%description
The Bouncy Castle Crypto APIs consist of the following:
- A lightweight cryptography API in Java.
- A provider for the JCE and JCA.
- A clean room implementation of the JCE 1.2.1.
- Generators for Version 1 and Version 3 X.509 certificates and PKCS12 files.
- A signed jar version suitable for JDK 1.4 and the Sun JCE.

%package jdk1.4
Group:          Development/Java
Summary:        Bouncy Castle JCE APIs for Java 1.4.x
Requires: %{name} = %{epoch}:%{version}
Requires: jaf
Requires: javamail
Provides:       %{name}-provider = %{epoch}:%{version}

%description jdk1.4
Bouncy Castle JCE API's for Java 1.4.

%package jdk1.5
Group:          Development/Java
Summary:        Bouncy Castle JCE APIs for Java 1.5.x
Requires: %{name} = %{epoch}:%{version}
Requires: jaf
Requires: javamail
Provides:       %{name}-provider = %{epoch}:%{version}

%description jdk1.5
Bouncy Castle JCE API's for Java 1.5.

%package jdk1.6
Group:          Development/Java
Summary:        Bouncy Castle JCE APIs for Java 1.6.x
Requires: %{name} = %{epoch}:%{version}
Requires: jaf
Requires: javamail
Provides:       %{name}-provider = %{epoch}:%{version}

%description jdk1.6
Bouncy Castle JCE API's for Java 1.6.

%package javadoc-jdk1.4
Group:          Development/Java
Summary:        Java 1.4 javadoc for %{name}

%description javadoc-jdk1.4
Java 1.4 javadocs for %{name}.

%package javadoc-jdk1.5
Group:          Development/Java
Summary:        Java 1.5 javadoc for %{name}

%description javadoc-jdk1.5
Java 1.5 javadocs for %{name}.

%package javadoc-jdk1.6
Group:          Development/Java
Summary:        Java 1.6 javadoc for %{name}

%description javadoc-jdk1.6
Java 1.6 javadocs for %{name}.

%prep
%setup -q -c -T -a 0
%setup -q -D -T -a 1
%setup -q -D -T -a 2
%setup -q -D -T -a 3
%setup -q -D -T -a 4
%setup -q -D -T -a 5
%setup -q -D -T -a 6
%setup -q -D -T -a 7
%setup -q -D -T -a 8
%setup -q -D -T -a 9
%setup -q -D -T -a 10
%setup -q -D -T -a 11
%setup -q -D -T -a 12
%setup -q -D -T -a 13
%setup -q -D -T -a 14

for d in \
bcmail-jdk14-%{archivever} \
bcmail-jdk15-%{archivever} \
bcmail-jdk16-%{archivever} \
bcpg-jdk14-%{archivever} \
bcpg-jdk15-%{archivever} \
bcpg-jdk16-%{archivever} \
bcprov-jdk14-%{archivever} \
bcprov-jdk15-%{archivever} \
bcprov-jdk16-%{archivever} \
bctsp-jdk14-%{archivever} \
bctsp-jdk15-%{archivever} \
bctsp-jdk16-%{archivever} \
; do
 mkdir $d/src
 pushd $d/src
   unzip -q ../src.zip
 popd
done
# Remove provided binaries
find . -type f -name "*.class" -exec %__rm -f {} \;
find . -type f -name "*.jar" -exec %__rm -f {} \;
find . -type f -name "*.zip" -exec %__rm -f {} \;

%build
deps="jaf javamail/mailapi junit"
dirs14="bcprov-jdk14-%{archivever} bcmail-jdk14-%{archivever} bcpg-jdk14-%{archivever} lcrypto-jdk14-%{archivever} bctsp-jdk14-%{archivever}"
dirs15="bcprov-jdk15-%{archivever} bcmail-jdk15-%{archivever} bcpg-jdk15-%{archivever} lcrypto-jdk15-%{archivever} bctsp-jdk15-%{archivever}"
dirs16="bcprov-jdk16-%{archivever} bcmail-jdk16-%{archivever} bcpg-jdk16-%{archivever} lcrypto-jdk16-%{archivever} bctsp-jdk16-%{archivever}"

export LANG=en_US.UTF-8
# 1.4
unset JAVA_HOME
for javaver in 1.4.0 1.4.1 1.4.2; do
 [ -d "%{_jvmdir}/java-${javaver}" ] && \
 export JAVA_HOME=%{_jvmdir}/java-${javaver}
done
[ -z "$JAVA_HOME" ] && exit 1

export CLASSPATH=$(build-classpath $deps)
CLASSPATH=$CLASSPATH:$RPM_BUILD_DIR/%{name}-%{version}/bcprov-jdk14-%{archivever}/bcprov-jdk14-%{version}.jar:.
CLASSPATH=$CLASSPATH:$RPM_BUILD_DIR/%{name}-%{version}/bcmail-jdk14-%{archivever}/bcmail-jdk14-%{version}.jar
CLASSPATH=$CLASSPATH:.

javac=$JAVA_HOME/bin/javac
jar=$JAVA_HOME/bin/jar
javadoc=$JAVA_HOME/bin/javadoc

for i in $dirs14; do
 pushd $i/src
 $javac `find . -type f -name "*.java"`
 jar2="../`basename $i -%{archivever}`-%{version}.jar"
 files="`find . -type f -name "*.class"`"
 test ! -d classes && mf="" || mf="`find classes/ -type f -name "*.mf" 2>/dev/null`"
 test -n "$mf" && $jar cvfm $jar2 $mf $files || $jar cvf $jar2 $files
 popd
done

# 1.5

unset JAVA_HOME
for javaver in 1.5.0; do
 [ -d "%{_jvmdir}/java-${javaver}" ] && \
 export JAVA_HOME=%{_jvmdir}/java-${javaver}
done
[ -z "$JAVA_HOME" ] && exit 1

export CLASSPATH=$(build-classpath $deps)
CLASSPATH=$CLASSPATH:$RPM_BUILD_DIR/%{name}-%{version}/bcprov-jdk15-%{archivever}/bcprov-jdk15-%{version}.jar:.
CLASSPATH=$CLASSPATH:$RPM_BUILD_DIR/%{name}-%{version}/bcmail-jdk15-%{archivever}/bcmail-jdk15-%{version}.jar
CLASSPATH=$CLASSPATH:.

javac=$JAVA_HOME/bin/javac
jar=$JAVA_HOME/bin/jar
javadoc=$JAVA_HOME/bin/javadoc

for i in $dirs15; do
 pushd $i/src
 $javac `find . -type f -name "*.java"`
 jar2="../`basename $i -%{archivever}`-%{version}.jar"
 files="`find . -type f -name "*.class"`"
 test ! -d classes && mf="" || mf="`find classes -type f -name "*.mf" 2>/dev/null`"
 test -n "$mf" && $jar cvfm $jar2 $mf $files || $jar cvf $jar2 $files
 popd
done

# 1.6

unset JAVA_HOME
for javaver in 1.6.0; do
 [ -d "%{_jvmdir}/java-${javaver}" ] && \
 export JAVA_HOME=%{_jvmdir}/java-${javaver}
done
[ -z "$JAVA_HOME" ] && exit 1

export CLASSPATH=$(build-classpath $deps)
CLASSPATH=$CLASSPATH:$RPM_BUILD_DIR/%{name}-%{version}/bcprov-jdk16-%{archivever}/bcprov-jdk16-%{version}.jar:.
CLASSPATH=$CLASSPATH:$RPM_BUILD_DIR/%{name}-%{version}/bcmail-jdk16-%{archivever}/bcmail-jdk16-%{version}.jar
CLASSPATH=$CLASSPATH:.

javac=$JAVA_HOME/bin/javac
jar=$JAVA_HOME/bin/jar
javadoc=$JAVA_HOME/bin/javadoc

for i in $dirs16; do
 pushd $i/src
 $javac `find . -type f -name "*.java"`
 jar2="../`basename $i -%{archivever}`-%{version}.jar"
 files="`find . -type f -name "*.class"`"
 test ! -d classes && mf="" || mf="`find classes -type f -name "*.mf" 2>/dev/null`"
 test -n "$mf" && $jar cvfm $jar2 $mf $files || $jar cvf $jar2 $files
 popd
done


# 1.4, 1.5 and 1.6 javadocs

dirs="$dirs14 $dirs15 $dirs16"

for i in $dirs; do
 pushd $i
 for j in *.html; do
   %__mv -f $j $i-$j
 done

 %__mv -f *.html ../

 pushd src
 $javadoc -d ../docs `find . -type f -name "*.java"`
 popd
 popd
done

%install
%__rm -rf %{buildroot}

# jars

jars=`find . -type f -name "*.jar"`

for i in $jars; do
 %__mv -f $i .
done

# Replace built 1.4, 1.5 and 1.6 providers with original one

%__rm -f bcprov-jdk14-%{version}.jar
%__rm -f bcprov-jdk15-%{version}.jar
%__rm -f bcprov-jdk16-%{version}.jar
%__cp -a %{SOURCE15} bcprov-jdk14-%{version}.jar
%__cp -a %{SOURCE16} bcprov-jdk15-%{version}.jar
%__cp -a %{SOURCE17} bcprov-jdk16-%{version}.jar

# Replace built 1.4, 1.5 and 1.6 bcmail with original one

%__rm -f bcmail-jdk14-%{version}.jar
%__rm -f bcmail-jdk15-%{version}.jar
%__rm -f bcmail-jdk16-%{version}.jar
%__cp -a %{SOURCE18} bcmail-jdk14-%{version}.jar
%__cp -a %{SOURCE19} bcmail-jdk15-%{version}.jar
%__cp -a %{SOURCE20} bcmail-jdk16-%{version}.jar

# Replace built 1.4, 1.5 and 1.6 bctsp with original one

%__rm -f bctsp-jdk14-%{version}.jar
%__rm -f bctsp-jdk15-%{version}.jar
%__rm -f bctsp-jdk16-%{version}.jar
%__cp -a %{SOURCE21} bctsp-jdk14-%{version}.jar
%__cp -a %{SOURCE22} bctsp-jdk15-%{version}.jar
%__cp -a %{SOURCE23} bctsp-jdk16-%{version}.jar

# Replace built 1.4, 1.5 and 1.6 bcpg with original one

%__rm -f bcpg-jdk14-%{version}.jar
%__rm -f bcpg-jdk15-%{version}.jar
%__rm -f bcpg-jdk16-%{version}.jar
%__cp -a %{SOURCE24} bcpg-jdk14-%{version}.jar
%__cp -a %{SOURCE25} bcpg-jdk15-%{version}.jar
%__cp -a %{SOURCE26} bcpg-jdk16-%{version}.jar

# Java 1.4

%__mkdir_p %{buildroot}%{_javadir}-{ext/%{name}-jdk1.4,1.4.0,1.4.1,1.4.2}

for jar14 in *-jdk14-%{version}.jar; do
  jar=$(echo $jar14 | %__sed s+-jdk14++g)
  %__install -m 644 $jar14 %{buildroot}%{_javadir}-ext/%{name}-jdk1.4/$jar
done

pushd %{buildroot}%{_javadir}-ext/%{name}-jdk1.4
  for jar in *-%{version}.jar; do
     %__ln_s $jar $(echo $jar | %__sed s+-%{version}\.jar+.jar+g)
  done
popd

for javaver in 1.4.0 1.4.1 1.4.2; do
  # FIXME: This should be relative
  (cd %{buildroot}%{_javadir}-${javaver} && %__ln_s %{_javadir}-ext/%{name}-jdk1.4 %{name})
done

# Java 1.5

%__mkdir_p %{buildroot}%{_javadir}-{ext/%{name}-jdk1.5,1.5.0}

for jar15 in *-jdk15-%{version}.jar; do
  jar=$(echo $jar15 | %__sed s+-jdk15++g)
  %__install -m 644 $jar15 %{buildroot}%{_javadir}-ext/%{name}-jdk1.5/$jar
done

pushd %{buildroot}%{_javadir}-ext/%{name}-jdk1.5
 for jar in *-%{version}.jar; do
   %__ln_s $jar $(echo $jar | %__sed s+-%{version}\.jar+.jar+g)
 done
popd

for javaver in 1.5.0; do
 # FIXME: This should be relative
 (cd %{buildroot}%{_javadir}-${javaver} && %__ln_s %{_javadir}-ext/%{name}-jdk1.5 %{name})
done

# Java 1.6

%__mkdir_p %{buildroot}%{_javadir}-{ext/%{name}-jdk1.6,1.6.0}

for jar16 in *-jdk16-%{version}.jar; do
  jar=$(echo $jar16 | %__sed s+-jdk16++g)
  %__install -m 644 $jar16 %{buildroot}%{_javadir}-ext/%{name}-jdk1.6/$jar
done

pushd %{buildroot}%{_javadir}-ext/%{name}-jdk1.6
 for jar in *-%{version}.jar; do
   %__ln_s $jar $(echo $jar | %__sed s+-%{version}\.jar+.jar+g)
 done
popd

for javaver in 1.6.0; do
 # FIXME: This should be relative
 (cd %{buildroot}%{_javadir}-${javaver} && %__ln_s %{_javadir}-ext/%{name}-jdk1.6 %{name})
done

# javadoc

%__mkdir_p %{buildroot}%{_javadocdir}/%{name}-{jdk16,jdk15,jdk14}-%{version}
(cd %{buildroot}%{_javadocdir} && %__ln_s %{name}-jdk16-%{version} %{name}-jdk16)
(cd %{buildroot}%{_javadocdir} && %__ln_s %{name}-jdk15-%{version} %{name}-jdk15)
(cd %{buildroot}%{_javadocdir} && %__ln_s %{name}-jdk14-%{version} %{name}-jdk14)

for javaver in 14 15 16; do
 for javadoc in $(find . -type d -name docs | grep jdk${javaver}); do
   dest=$(echo $javadoc | %__sed s+-jdk${javaver}-%{version}++g | %__sed s+/docs++g)
   dest=$(echo $dest | %__sed 's+-%{archivever}++')
   %__cp -a $javadoc %{buildroot}%{_javadocdir}/%{name}-jdk${javaver}-%{version}/$dest
 done
done

find . -type d -name docs | xargs %__rm -rf

%clean
%__rm -rf %{buildroot}

%post javadoc-jdk1.6
%__rm -f %{_javadocdir}/%{name}-jdk16
%__ln_s %{name}-jdk16-%{version} %{_javadocdir}/%{name}-jdk16

%postun javadoc-jdk1.6
if [ $1 -eq 0 ]; then
 %__rm -f %{_javadocdir}/%{name}-jdk16
fi

%post javadoc-jdk1.5
%__rm -f %{_javadocdir}/%{name}-jdk15
%__ln_s %{name}-jdk15-%{version} %{_javadocdir}/%{name}-jdk15

%postun javadoc-jdk1.5
if [ $1 -eq 0 ]; then
 %__rm -f %{_javadocdir}/%{name}-jdk15
fi

%post javadoc-jdk1.4
%__rm -f %{_javadocdir}/%{name}-jdk14
%__ln_s %{name}-jdk14-%{version} %{_javadocdir}/%{name}-jdk14

%postun javadoc-jdk1.4
if [ $1 -eq 0 ]; then
 %__rm -f %{_javadocdir}/%{name}-jdk1.4
fi

%files
%doc *.html

%files jdk1.4
%dir %{_javadir}-ext/%{name}-jdk1.4
%{_javadir}-ext/%{name}-jdk1.4/*.jar
%{_javadir}-1.4.0/%{name}
%{_javadir}-1.4.1/%{name}
%{_javadir}-1.4.2/%{name}

%files jdk1.5
%dir %{_javadir}-ext/%{name}-jdk1.5
%{_javadir}-ext/%{name}-jdk1.5/*.jar
%{_javadir}-1.5.0/%{name}

%files jdk1.6
%dir %{_javadir}-ext/%{name}-jdk1.6
%{_javadir}-ext/%{name}-jdk1.6/*.jar
%{_javadir}-1.6.0/%{name}

%files javadoc-jdk1.4
%dir %{_javadocdir}/%{name}-jdk14-%{version}
%{_javadocdir}/%{name}-jdk14-%{version}/*
%ghost %{_javadocdir}/%{name}-jdk14

%files javadoc-jdk1.5
%dir %{_javadocdir}/%{name}-jdk15-%{version}
%{_javadocdir}/%{name}-jdk15-%{version}/*
%ghost %{_javadocdir}/%{name}-jdk15

%files javadoc-jdk1.6
%dir %{_javadocdir}/%{name}-jdk16-%{version}
%{_javadocdir}/%{name}-jdk16-%{version}/*
%ghost %{_javadocdir}/%{name}-jdk16

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin