5e89faa
%global gittag r1rv58
5e89faa
%global classname org.bouncycastle.jce.provider.BouncyCastleProvider
Thomas Fitzsimmons 343d2e7
5e89faa
Summary:          Bouncy Castle Cryptography APIs for Java
Thomas Fitzsimmons 343d2e7
Name:             bouncycastle
5e89faa
Version:          1.58
d497d66
Release:          1%{?dist}
baefd30
License:          MIT
5e89faa
URL:              http://www.bouncycastle.org
5e89faa
5e89faa
Source0:          https://github.com/bcgit/bc-java/archive/%{gittag}/%{name}-%{version}.tar.gz
5e89faa
5e89faa
# POMs from Maven Central
5e89faa
Source1:          http://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/%{version}/bcprov-jdk15on-%{version}.pom
5e89faa
Source2:          http://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk15on/%{version}/bcpkix-jdk15on-%{version}.pom
5e89faa
Source3:          http://repo1.maven.org/maven2/org/bouncycastle/bcpg-jdk15on/%{version}/bcpg-jdk15on-%{version}.pom
5e89faa
Source4:          http://repo1.maven.org/maven2/org/bouncycastle/bcmail-jdk15on/%{version}/bcmail-jdk15on-%{version}.pom
5e89faa
Source5:          http://repo1.maven.org/maven2/org/bouncycastle/bctls-jdk15on/%{version}/bctls-jdk15on-%{version}.pom
5e89faa
5e89faa
# Script to fetch POMs from Maven Central
5e89faa
Source6:          get-poms.sh
5e89faa
baefd30
BuildArch:        noarch
5e89faa
5e89faa
BuildRequires:    aqute-bnd
5e89faa
BuildRequires:    ant
5e89faa
BuildRequires:    ant-junit
5e89faa
BuildRequires:    javamail
5e89faa
BuildRequires:    maven-local
5e89faa
5e89faa
Requires:         java-headless
5e89faa
Requires(post):   jpackage-utils
5e89faa
Requires(postun): jpackage-utils
Thomas Fitzsimmons 343d2e7
c296115
Provides:         bcprov = %{version}-%{release}
baefd30
Thomas Fitzsimmons 343d2e7
%description
09f6f9e
The Bouncy Castle Crypto package is a Java implementation of cryptographic
5e89faa
algorithms. This jar contains JCE provider and lightweight API for the
5e89faa
Bouncy Castle Cryptography APIs for JDK 1.5 to JDK 1.8.
5e89faa
5e89faa
%package pkix
5e89faa
Summary:          Bouncy Castle PKIX, CMS, EAC, TSP, PKCS, OCSP, CMP, and CRMF APIs
5e89faa
Requires:         java-headless
5e89faa
Requires:         mvn(org.bouncycastle:bcprov-jdk15on) = %{version}
5e89faa
5e89faa
%description pkix
5e89faa
The Bouncy Castle Java APIs for CMS, PKCS, EAC, TSP, CMP, CRMF, OCSP, and
5e89faa
certificate generation. This jar contains APIs for JDK 1.5 to JDK 1.8. The
5e89faa
APIs can be used in conjunction with a JCE/JCA provider such as the one
5e89faa
provided with the Bouncy Castle Cryptography APIs.
5e89faa
5e89faa
%package pg
5e89faa
Summary:          Bouncy Castle OpenPGP API
5e89faa
Requires:         java-headless
5e89faa
Requires:         mvn(org.bouncycastle:bcprov-jdk15on) = %{version}
5e89faa
5e89faa
%description pg
5e89faa
The Bouncy Castle Java API for handling the OpenPGP protocol. This jar
5e89faa
contains the OpenPGP API for JDK 1.5 to JDK 1.8. The APIs can be used in
5e89faa
conjunction with a JCE/JCA provider such as the one provided with the
5e89faa
Bouncy Castle Cryptography APIs.
5e89faa
5e89faa
%package mail
5e89faa
Summary:          Bouncy Castle S/MIME API
5e89faa
Requires:         java-headless
5e89faa
Requires:         mvn(org.bouncycastle:bcprov-jdk15on) = %{version}
5e89faa
Requires:         mvn(org.bouncycastle:bcpkix-jdk15on) = %{version}
5e89faa
5e89faa
%description mail
5e89faa
The Bouncy Castle Java S/MIME APIs for handling S/MIME protocols. This jar
5e89faa
contains S/MIME APIs for JDK 1.5 to JDK 1.8. The APIs can be used in
5e89faa
conjunction with a JCE/JCA provider such as the one provided with the Bouncy
5e89faa
Castle Cryptography APIs. The JavaMail API and the Java activation framework
5e89faa
will also be needed.
5e89faa
5e89faa
%package tls
5e89faa
Summary:          Bouncy Castle JSSE provider and TLS/DTLS API
5e89faa
Requires:         java-headless
5e89faa
Requires:         mvn(org.bouncycastle:bcprov-jdk15on) = %{version}
5e89faa
5e89faa
%description tls
5e89faa
The Bouncy Castle Java APIs for TLS and DTLS, including a provider for the
5e89faa
JSSE.
09f6f9e
09f6f9e
%package javadoc
5e89faa
Summary:          Javadoc for %{name}
5e89faa
Provides:         %{name}-pkix-javadoc = %{version}-%{release}
5e89faa
Obsoletes:        %{name}-pkix-javadoc < %{version}-%{release}
5e89faa
Provides:         %{name}-pg-javadoc = %{version}-%{release}
5e89faa
Obsoletes:        %{name}-pg-javadoc < %{version}-%{release}
5e89faa
Provides:         %{name}-mail-javadoc = %{version}-%{release}
5e89faa
Obsoletes:        %{name}-mail-javadoc < %{version}-%{release}
09f6f9e
09f6f9e
%description javadoc
5e89faa
API documentation for the Bouncy Castle Cryptography APIs.
Thomas Fitzsimmons 343d2e7
Thomas Fitzsimmons 343d2e7
%prep
5e89faa
%setup -q -n bc-java-%{gittag}
Thomas Fitzsimmons 343d2e7
Thomas Fitzsimmons 343d2e7
# Remove provided binaries
Thomas Fitzsimmons 343d2e7
find . -type f -name "*.class" -exec rm -f {} \;
Thomas Fitzsimmons 343d2e7
find . -type f -name "*.jar" -exec rm -f {} \;
Thomas Fitzsimmons 343d2e7
5e89faa
# Relax javadoc linting and set expected source encoding
5e89faa
sed -i -e '/
5e89faa
       -e '/
5e89faa
5e89faa
cp -p %{SOURCE1} bcprov.pom
5e89faa
cp -p %{SOURCE2} bcpkix.pom
5e89faa
cp -p %{SOURCE3} bcpg.pom
5e89faa
cp -p %{SOURCE4} bcmail.pom
5e89faa
cp -p %{SOURCE5} bctls.pom
baefd30
baefd30
%build
5e89faa
ant -f ant/jdk15+.xml \
5e89faa
  -Djunit.jar.home=$(build-classpath junit) \
5e89faa
  -Dmail.jar.home=$(build-classpath javamail/javax.mail) \
5e89faa
  -Dactivation.jar.home= \
5e89faa
  -Drelease.debug=true \
5e89faa
  clean build-provider build test
5e89faa
5e89faa
for bc in bcprov bcpkix bcpg bcmail bctls ; do
5e89faa
  # Make into OSGi bundle
5e89faa
  cat > $bc.bnd <<-EOF
5e89faa
-classpath=bcprov.jar,bcpkix.jar,bcpg.jar,bcmail.jar,bctls.jar
5e89faa
Export-Package: *;version=%{version}
5e89faa
Bundle-SymbolicName: $bc
5e89faa
Bundle-Version: %{version}.0
5e89faa
EOF
5e89faa
  java -jar $(build-classpath aqute-bnd) wrap -p $bc.bnd -o $bc.jar build/artifacts/jdk1.5/jars/$bc-jdk15on-*.jar
5e89faa
5e89faa
  # Request Maven installation
5e89faa
  %mvn_file ":$bc-jdk15on" $bc
5e89faa
  %mvn_package ":$bc-jdk15on" $bc
5e89faa
  %mvn_alias ":$bc-jdk15on" "org.bouncycastle:$bc-jdk16" "org.bouncycastle:$bc-jdk15"
5e89faa
  %mvn_artifact $bc.pom $bc.jar
5e89faa
done
5e89faa
5e89faa
# Not shipping the "lcrypto" jar, so don't ship the javadoc for it
5e89faa
rm -rf build/artifacts/jdk1.5/javadoc/lcrypto
Thomas Fitzsimmons 343d2e7
Thomas Fitzsimmons 343d2e7
%install
Thomas Fitzsimmons 343d2e7
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/java/security/security.d
Thomas Fitzsimmons b2cd403
touch $RPM_BUILD_ROOT%{_sysconfdir}/java/security/security.d/2000-%{classname}
Thomas Fitzsimmons 343d2e7
5e89faa
%mvn_install -J build/artifacts/jdk1.5/javadoc
c296115
Thomas Fitzsimmons 343d2e7
%post
Thomas Fitzsimmons b2cd403
{
Thomas Fitzsimmons b2cd403
  # Rebuild the list of security providers in classpath.security
Thomas Fitzsimmons b2cd403
  suffix=security/classpath.security
Thomas Fitzsimmons b2cd403
  secfiles="/usr/lib/$suffix /usr/lib64/$suffix"
Thomas Fitzsimmons b2cd403
Thomas Fitzsimmons b2cd403
  for secfile in $secfiles
Thomas Fitzsimmons b2cd403
  do
Thomas Fitzsimmons b2cd403
    # check if this classpath.security file exists
Thomas Fitzsimmons b2cd403
    [ -f "$secfile" ] || continue
Thomas Fitzsimmons b2cd403
Thomas Fitzsimmons b2cd403
    sed -i '/^security\.provider\./d' "$secfile"
Thomas Fitzsimmons b2cd403
Thomas Fitzsimmons b2cd403
    count=0
Thomas Fitzsimmons b2cd403
    for provider in $(ls /etc/java/security/security.d)
Thomas Fitzsimmons b2cd403
    do
Thomas Fitzsimmons b2cd403
      count=$((count + 1))
Thomas Fitzsimmons b2cd403
      echo "security.provider.${count}=${provider#*-}" >> "$secfile"
Thomas Fitzsimmons b2cd403
    done
Thomas Fitzsimmons b2cd403
  done
Thomas Fitzsimmons b2cd403
} || :
Thomas Fitzsimmons 343d2e7
Thomas Fitzsimmons 343d2e7
%postun
Thomas Fitzsimmons 343d2e7
if [ $1 -eq 0 ] ; then
Thomas Fitzsimmons 343d2e7
Thomas Fitzsimmons b2cd403
  {
Thomas Fitzsimmons b2cd403
    # Rebuild the list of security providers in classpath.security
Thomas Fitzsimmons b2cd403
    suffix=security/classpath.security
Thomas Fitzsimmons b2cd403
    secfiles="/usr/lib/$suffix /usr/lib64/$suffix"
Thomas Fitzsimmons b2cd403
Thomas Fitzsimmons b2cd403
    for secfile in $secfiles
Thomas Fitzsimmons b2cd403
    do
Thomas Fitzsimmons b2cd403
      # check if this classpath.security file exists
Thomas Fitzsimmons b2cd403
      [ -f "$secfile" ] || continue
Thomas Fitzsimmons b2cd403
Thomas Fitzsimmons b2cd403
      sed -i '/^security\.provider\./d' "$secfile"
Thomas Fitzsimmons b2cd403
Thomas Fitzsimmons b2cd403
      count=0
Thomas Fitzsimmons b2cd403
      for provider in $(ls /etc/java/security/security.d)
Thomas Fitzsimmons b2cd403
      do
Thomas Fitzsimmons b2cd403
        count=$((count + 1))
Thomas Fitzsimmons b2cd403
        echo "security.provider.${count}=${provider#*-}" >> "$secfile"
Thomas Fitzsimmons b2cd403
      done
Thomas Fitzsimmons b2cd403
    done
Thomas Fitzsimmons b2cd403
  } || :
Thomas Fitzsimmons 343d2e7
Thomas Fitzsimmons 343d2e7
fi
Thomas Fitzsimmons 343d2e7
5e89faa
%files -f .mfiles-bcprov
5e89faa
%license build/artifacts/jdk1.5/bcprov-jdk15on-*/LICENSE.html
5e89faa
%doc docs/ core/docs/ *.html
Thomas Fitzsimmons b2cd403
%{_sysconfdir}/java/security/security.d/2000-%{classname}
baefd30
5e89faa
%files pkix -f .mfiles-bcpkix
5e89faa
%license build/artifacts/jdk1.5/bcpkix-jdk15on-*/LICENSE.html
5e89faa
5e89faa
%files pg -f .mfiles-bcpg
5e89faa
%license build/artifacts/jdk1.5/bcpg-jdk15on-*/LICENSE.html
5e89faa
5e89faa
%files mail -f .mfiles-bcmail
5e89faa
%license build/artifacts/jdk1.5/bcmail-jdk15on-*/LICENSE.html
5e89faa
5e89faa
%files tls -f .mfiles-bctls
5e89faa
%license build/artifacts/jdk1.5/bctls-jdk15on-*/LICENSE.html
5e89faa
5e89faa
%files javadoc -f .mfiles-javadoc
5e89faa
%license LICENSE.html
Thomas Fitzsimmons 343d2e7
Thomas Fitzsimmons 343d2e7
%changelog
5e89faa
* Thu Dec 28 2017 Mattias Ellert <mattias.ellert@physics.uu.se> - 1.58-1
5e89faa
- Update to 1.58 - and merge relevant changes from master branch:
5e89faa
- Build all bouncycastle modules from a single source tree, using upstream's
5e89faa
  own build scripts
5e89faa
- Add sub-packages for each module
5e89faa
- Install with mvn_install
5e89faa
- Add OSGi metadata
5e89faa
- Introduce license macro
5e89faa
- Add alias for org.bouncycastle:bcprov-jdk15
5e89faa
- Migrate to .mfiles
5e89faa
- Fix java BR/R
5e89faa
- Switch to java-headless
5e89faa
d497d66
* Thu Feb 20 2014 Steve Traylen <steve.traylen@cern.ch> - 1.50-1
5e89faa
- Update to upstream version 1.50
d497d66
b6985c9
* Mon Jan  6 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.46-12
b6985c9
- Add Maven alias for bouncycastle:bcprov-jdk15
b6985c9
2d403ef
* Tue Oct 22 2013 gil cattaneo <puntogil@libero.it> 1.46-11
2d403ef
- remove versioned Jars
2d403ef
65728e0
* Thu Aug 29 2013 gil cattaneo <puntogil@libero.it> 1.46-10
65728e0
- remove update_maven_depmap
65728e0
b0df883
* Mon Aug 05 2013 gil cattaneo <puntogil@libero.it> 1.46-9
b0df883
- rebuilt rhbz#992026
b0df883
97cb44b
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.46-8
97cb44b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
97cb44b
1704228
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.46-7
1704228
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
1704228
3335daf
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.46-6
3335daf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
3335daf
8466e11
* Tue May 08 2012 Tom Callaway <spot@fedoraproject.org> - 1.46-5
8466e11
- use original sources from here on out
8466e11
ecbb10f
* Sat Feb 18 2012 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.46-4
ecbb10f
- Build with -source 1.6 -target 1.6 
ecbb10f
ecbb10f
* Thu Jan 12 2012 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.46-3
c7c4ae9
- Update javac target version to 1.7 to build with new java
c7c4ae9
651eefb
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.46-2
651eefb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
651eefb
ffee67b
* Tue Mar 01 2011 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.46-1
ffee67b
- Import Bouncy Castle 1.46.
ffee67b
2f523fc
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.45-3
2f523fc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
2f523fc
2b8eb2a
* Thu Dec 30 2010 Alexander Kurtakov <akurtako@redhat.com> 1.45-2
2b8eb2a
- Drop gcj.
2b8eb2a
- Adapt to current guidelines.
2b8eb2a
33499e8
* Thu Feb 11 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.45-1
33499e8
- Import Bouncy Castle 1.45.
33499e8
34da010
* Sat Nov 14 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.44-1
34da010
- Import Bouncy Castle 1.44.
34da010
c296115
* Sun Sep  6 2009 Ville Skyttä <ville.skytta@iki.fi> - 1.43-6
c296115
- Include improvements from #521475:
c296115
- Include missing properties files in jar.
c296115
- Build with javac -encoding UTF-8.
c296115
- Use %%javac and %%jar macros.
c296115
- Run test suite during build (ignoring failures for now).
c296115
- Follow upstream in excluding various test suite classes from jar; drop
c296115
  dependency on junit4.
c296115
Andrew Overholt 172359a
* Wed Aug 26 2009 Andrew Overholt <overholt@redhat.com> 1.43-5
Andrew Overholt 172359a
- Add maven POM
Andrew Overholt 172359a
372f01e
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.43-4
372f01e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
372f01e
53d559e
* Sat Jul 11 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.43-3
53d559e
- Raise java requirement to >= 1.7 once again.
53d559e
7710c51
* Fri Jul 10 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.43-2
7710c51
- Re-enable AOT bits thanks to Andrew Haley.
7710c51
c0b6011
* Mon Apr 20 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.43-1
c0b6011
- Import Bouncy Castle 1.43.
c0b6011
9a4cbb2
* Sat Apr 18 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.42-3
9a4cbb2
- Don't build AOT bits. The package needs java1.6
9a4cbb2
697ee28
* Thu Apr 09 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.42-2
697ee28
- Add missing Requires: junit4
697ee28
09f6f9e
* Tue Mar 17 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.42-1
09f6f9e
- Import Bouncy Castle 1.42.
09f6f9e
- Update description.
09f6f9e
- Add javadoc subpackage.
09f6f9e
0219a93
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.41-3
0219a93
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
0219a93
d497d66
* Tue Nov 11 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.41-2
baefd30
- Fixed license tag (BSD -> MIT).
baefd30
- Minor improvements in the SPEC file for better compatibility with the 
baefd30
  Fedora Java Packaging Guidelines.
baefd30
- Added "Provides: bcprov == %%{version}-%%{release}".
baefd30
Lillian Angel 21e7bea
* Thu Oct  2 2008 Lillian Angel <langel@redhat.com> - 1.41-1
Lillian Angel 21e7bea
- Import Bouncy Castle 1.41.
Lillian Angel 21e7bea
- Resolves: rhbz#465203
Lillian Angel 21e7bea
Thomas Fitzsimmons 569a3b4
* Thu May 15 2008 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.39-1
Thomas Fitzsimmons 569a3b4
- Import Bouncy Castle 1.39.
Thomas Fitzsimmons 569a3b4
- Set target to 1.5.
Thomas Fitzsimmons 569a3b4
f30a6ac
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.38-2
f30a6ac
- Autorebuild for GCC 4.3
f30a6ac
Thomas Fitzsimmons b2cd403
* Thu Nov 29 2007 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.38-1
Thomas Fitzsimmons b2cd403
- Import Bouncy Castle 1.38.
Thomas Fitzsimmons b2cd403
- Require junit4 for build.
Thomas Fitzsimmons 135b478
- Require java-1.7.0-icedtea-devel for build.
Thomas Fitzsimmons b2cd403
- Wrap lines at 80 columns.
Thomas Fitzsimmons b2cd403
- Inline rebuild-security-providers in post and postun sections.
Thomas Fitzsimmons b2cd403
- Related: rhbz#260161
Thomas Fitzsimmons b2cd403
Thomas Fitzsimmons b5e757b
* Sat Mar 31 2007 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.34-3
Thomas Fitzsimmons b5e757b
- Require java-1.5.0-gcj.
Thomas Fitzsimmons b5e757b
Thomas Fitzsimmons b5e757b
* Tue Dec 12 2006 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.34-2
baefd30
- Install bcprov jar and unversioned symlink in %%{_javadir}.
baefd30
- Install bcprov symlink in %%{_javadir}/gcj-endorsed.
Thomas Fitzsimmons 7c2684d
- Change release numbering format to X.fc7.
Thomas Fitzsimmons 7c2684d
- Include new bcprov files in files list.
Thomas Fitzsimmons 7c2684d
- Import Bouncy Castle 1.34.
Thomas Fitzsimmons 7c2684d
- Related: rhbz#218794
Thomas Fitzsimmons 7c2684d
Thomas Fitzsimmons 8c43d5a
* Tue Jul 25 2006 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.33-3
Thomas Fitzsimmons 8c43d5a
- Bump release number.
Thomas Fitzsimmons 8c43d5a
Thomas Fitzsimmons 343d2e7
* Mon Jul 10 2006 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.33-2
Thomas Fitzsimmons 343d2e7
- Fix problems pointed out by reviewer.
Thomas Fitzsimmons 343d2e7
Thomas Fitzsimmons 343d2e7
* Fri Jul  7 2006 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.33-1
Thomas Fitzsimmons 343d2e7
- First release.