Blame SPECS/bouncycastle.spec

1333f5
%{?scl:%scl_package bouncycastle}
1333f5
%{!?scl:%global pkg_name %{name}}
1333f5
%{?java_common_find_provides_and_requires}
1333f5
1333f5
%global ver 1.52
1333f5
%global archivever jdk15on-%(echo %{ver}|sed 's|\\\.||')
1333f5
%global classname org.bouncycastle.jce.provider.BouncyCastleProvider
1333f5
1333f5
Summary:          Bouncy Castle Crypto Package for Java
1333f5
Name:             %{?scl_prefix}bouncycastle
1333f5
Version:          %{ver}
1333f5
Release:          5.2%{?dist}
1333f5
License:          MIT
1333f5
URL:              http://www.bouncycastle.org
1333f5
# Use original sources from here on out.
1333f5
Source0:          http://www.bouncycastle.org/download/bcprov-%{archivever}.tar.gz
1333f5
Source1:          http://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/%{ver}/bcprov-jdk15on-%{ver}.pom
1333f5
Source2:          bouncycastle-OSGi.bnd
1333f5
1333f5
BuildRequires:    %{?scl_prefix_maven}aqute-bnd
1333f5
1333f5
BuildRequires:    %{?scl_prefix_java_common}junit
1333f5
BuildRequires:    %{?scl_prefix_java_common}javapackages-tools
1333f5
Requires(post):   %{?scl_prefix_java_common}javapackages-tools
1333f5
Requires(postun): %{?scl_prefix_java_common}javapackages-tools
1333f5
1333f5
BuildArch:        noarch
1333f5
1333f5
Provides:         %{?scl_prefix}bcprov = %{version}-%{release}
1333f5
1333f5
%description
1333f5
The Bouncy Castle Crypto package is a Java implementation of cryptographic
1333f5
algorithms. The package is organized so that it contains a light-weight API
1333f5
suitable for use in any environment (including the newly released J2ME) with
1333f5
the additional infrastructure to conform the algorithms to the JCE framework.
1333f5
1333f5
%package javadoc
1333f5
Summary:        Javadoc for %{pkg_name}
1333f5
1333f5
%description javadoc
1333f5
API documentation for the %{pkg_name} package.
1333f5
1333f5
%prep
1333f5
%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"}
1333f5
%setup -q -n bcprov-%{archivever}
1333f5
1333f5
# Remove provided binaries
1333f5
find . -type f -name "*.class" -exec rm -f {} \;
1333f5
find . -type f -name "*.jar" -exec rm -f {} \;
1333f5
1333f5
mkdir src
1333f5
unzip -qq src.zip -d src/
1333f5
#missing o.b.crypto.test.cavp package sources
1333f5
rm -fr src/org/bouncycastle/crypto/test/KDF*.java
1333f5
sed -i '/KDF/d' src/org/bouncycastle/crypto/test/RegressionTest.java
1333f5
1333f5
cp -p %{SOURCE2} bc.bnd
1333f5
sed -i "s|@VERSION@|%{version}|" bc.bnd
1333f5
%{?scl:EOF}
1333f5
1333f5
1333f5
%build
1333f5
%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"}
1333f5
pushd src
1333f5
  export CLASSPATH=$(build-classpath junit)
1333f5
  javac -g -source 1.6 -target 1.6 -encoding UTF-8 $(find . -type f -name "*.java")
1333f5
  jarfile="../bcprov.jar"
1333f5
  # Exclude all */test/* files except org.bouncycastle.util.test, cf. upstream
1333f5
  files="$(find . -type f \( -name '*.class' -o -name '*.properties' \) -not -path '*/test/*')"
1333f5
  files="$files $(find . -type f -path '*/org/bouncycastle/util/test/*.class')"
1333f5
  files="$files $(find . -type f -path '*/org/bouncycastle/jce/provider/test/*.class')"
1333f5
  files="$files $(find . -type f -path '*/org/bouncycastle/ocsp/test/*.class')"
1333f5
  test ! -d classes && mf="" \
1333f5
    || mf="`find classes/ -type f -name "*.mf" 2>/dev/null`"
1333f5
  test -n "$mf" && jar cvfm $jarfile $mf $files \
1333f5
    || jar cvf $jarfile $files
1333f5
popd
1333f5
java -jar $(build-classpath aqute-bnd) wrap -properties bc.bnd bcprov.jar
1333f5
%{?scl:EOF}
1333f5
1333f5
1333f5
%install
1333f5
%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"}
1333f5
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/java/security/security.d
1333f5
touch $RPM_BUILD_ROOT%{_sysconfdir}/java/security/security.d/2000-%{classname}
1333f5
1333f5
# install bouncy castle provider
1333f5
install -dm 755 $RPM_BUILD_ROOT%{_javadir}
1333f5
install -pm 644 bcprov.bar \
1333f5
  $RPM_BUILD_ROOT%{_javadir}/bcprov.jar
1333f5
1333f5
install -dm 755 $RPM_BUILD_ROOT%{_javadir}/gcj-endorsed
1333f5
pushd $RPM_BUILD_ROOT%{_javadir}/gcj-endorsed
1333f5
  ln -sf ../bcprov.jar bcprov.jar
1333f5
popd
1333f5
1333f5
# javadoc
1333f5
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{pkg_name}
1333f5
cp -pr docs/* $RPM_BUILD_ROOT%{_javadocdir}/%{pkg_name}
1333f5
1333f5
# maven pom
1333f5
install -dm 755 $RPM_BUILD_ROOT%{_mavenpomdir}
1333f5
install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-bcprov.pom
1333f5
%add_maven_depmap -a "bouncycastle:bcprov-jdk15,org.bouncycastle:bcprov-jdk16,org.bouncycastle:bcprov-jdk15" JPP-bcprov.pom bcprov.jar
1333f5
%{?scl:EOF}
1333f5
1333f5
1333f5
%check
1333f5
%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"}
1333f5
pushd src
1333f5
  export CLASSPATH=$PWD:$(build-classpath junit hamcrest/core)
1333f5
  for test in $(find . -name AllTests.class) ; do
1333f5
    test=${test#./} ; test=${test%.class} ; test=${test//\//.}
1333f5
    # TODO: failures; get them fixed and remove || :
1333f5
    %java org.junit.runner.JUnitCore $test || :
1333f5
  done
1333f5
popd
1333f5
%{?scl:EOF}
1333f5
1333f5
1333f5
1333f5
%post
1333f5
{
1333f5
  # Rebuild the list of security providers in classpath.security
1333f5
  suffix=security/classpath.security
1333f5
  secfiles="/usr/lib/$suffix /usr/lib64/$suffix"
1333f5
1333f5
  for secfile in $secfiles
1333f5
  do
1333f5
    # check if this classpath.security file exists
1333f5
    [ -f "$secfile" ] || continue
1333f5
1333f5
    sed -i '/^security\.provider\./d' "$secfile"
1333f5
1333f5
    count=0
1333f5
    for provider in $(ls /etc/java/security/security.d)
1333f5
    do
1333f5
      count=$((count + 1))
1333f5
      echo "security.provider.${count}=${provider#*-}" >> "$secfile"
1333f5
    done
1333f5
  done
1333f5
} || :
1333f5
1333f5
%postun
1333f5
if [ $1 -eq 0 ] ; then
1333f5
1333f5
  {
1333f5
    # Rebuild the list of security providers in classpath.security
1333f5
    suffix=security/classpath.security
1333f5
    secfiles="/usr/lib/$suffix /usr/lib64/$suffix"
1333f5
1333f5
    for secfile in $secfiles
1333f5
    do
1333f5
      # check if this classpath.security file exists
1333f5
      [ -f "$secfile" ] || continue
1333f5
1333f5
      sed -i '/^security\.provider\./d' "$secfile"
1333f5
1333f5
      count=0
1333f5
      for provider in $(ls /etc/java/security/security.d)
1333f5
      do
1333f5
        count=$((count + 1))
1333f5
        echo "security.provider.${count}=${provider#*-}" >> "$secfile"
1333f5
      done
1333f5
    done
1333f5
  } || :
1333f5
1333f5
fi
1333f5
1333f5
%files -f .mfiles
1333f5
%doc CONTRIBUTORS.html index.html
1333f5
%doc LICENSE.html
1333f5
%{_javadir}/gcj-endorsed/bcprov.jar
1333f5
%{_sysconfdir}/java/security/security.d/2000-%{classname}
1333f5
1333f5
%files javadoc
1333f5
%{_javadocdir}/%{pkg_name}/
1333f5
%doc LICENSE.html
1333f5
1333f5
%changelog
1333f5
* Wed Jul 1 2015 akurtakov <akurtakov@localhost.localdomain> 1.52-5.2
1333f5
- Do not use macro javac/jar but straight executables.
1333f5
1333f5
* Tue Jun 30 2015 Mat Booth <mat.booth@redhat.com> - 1.52-5.1
1333f5
- Import latest from Fedora
1333f5
1333f5
* Tue Jun 23 2015 Roland Grunberg <rgrunber@redhat.com> - 1.52-5
1333f5
- Remove Import/Export-Package statements.
1333f5
- Related: rhbz#1233354
1333f5
1333f5
* Mon Jun 22 2015 Roland Grunberg <rgrunber@redhat.com> - 1.52-4
1333f5
- Fix typo in OSGi metadata file.
1333f5
1333f5
* Thu Jun 18 2015 Mat Booth <mat.booth@redhat.com> - 1.52-3
1333f5
- Resolves: rhbz#1233354 - Add OSGi metadata
1333f5
1333f5
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.52-2
1333f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
1333f5
1333f5
* Wed Apr 22 2015 Alexander Kurtakov <akurtako@redhat.com> 1.52-1
1333f5
- Update to 1.52.
1333f5
- Switch source/target to 1.6 as 1.5 is deprecated
1333f5
1333f5
* Thu Jan 29 2015 gil cattaneo <puntogil@libero.it> 1.50-6
1333f5
- introduce license macro
1333f5
1333f5
* Wed Oct 22 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.50-5
1333f5
- Add alias for org.bouncycastle:bcprov-jdk15
1333f5
1333f5
* Mon Jun 09 2014 Michal Srb <msrb@redhat.com> - 1.50-4
1333f5
- Migrate to .mfiles
1333f5
1333f5
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.50-3
1333f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
1333f5
1333f5
* Wed Feb 26 2014 Michal Srb <msrb@redhat.com> - 1.50-2
1333f5
- Fix java BR/R
1333f5
- Build with -source/target 1.5
1333f5
- s/organised/organized/
1333f5
1333f5
* Fri Feb 21 2014 Michal Srb <msrb@redhat.com> - 1.50-1
1333f5
- Update to upstream version 1.50
1333f5
- Switch to java-headless
1333f5
1333f5
* Mon Jan  6 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.46-12
1333f5
- Add Maven alias for bouncycastle:bcprov-jdk15
1333f5
1333f5
* Tue Oct 22 2013 gil cattaneo <puntogil@libero.it> 1.46-11
1333f5
- remove versioned Jars
1333f5
1333f5
* Thu Aug 29 2013 gil cattaneo <puntogil@libero.it> 1.46-10
1333f5
- remove update_maven_depmap
1333f5
1333f5
* Mon Aug 05 2013 gil cattaneo <puntogil@libero.it> 1.46-9
1333f5
- rebuilt rhbz#992026
1333f5
1333f5
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.46-8
1333f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
1333f5
1333f5
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.46-7
1333f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
1333f5
1333f5
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.46-6
1333f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
1333f5
1333f5
* Tue May 08 2012 Tom Callaway <spot@fedoraproject.org> - 1.46-5
1333f5
- use original sources from here on out
1333f5
1333f5
* Sat Feb 18 2012 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.46-4
1333f5
- Build with -source 1.6 -target 1.6 
1333f5
1333f5
* Thu Jan 12 2012 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.46-3
1333f5
- Update javac target version to 1.7 to build with new java
1333f5
1333f5
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.46-2
1333f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
1333f5
1333f5
* Tue Mar 01 2011 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.46-1
1333f5
- Import Bouncy Castle 1.46.
1333f5
1333f5
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.45-3
1333f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
1333f5
1333f5
* Thu Dec 30 2010 Alexander Kurtakov <akurtako@redhat.com> 1.45-2
1333f5
- Drop gcj.
1333f5
- Adapt to current guidelines.
1333f5
1333f5
* Thu Feb 11 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.45-1
1333f5
- Import Bouncy Castle 1.45.
1333f5
1333f5
* Sat Nov 14 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.44-1
1333f5
- Import Bouncy Castle 1.44.
1333f5
1333f5
* Sun Sep  6 2009 Ville Skyttä <ville.skytta@iki.fi> - 1.43-6
1333f5
- Include improvements from #521475:
1333f5
- Include missing properties files in jar.
1333f5
- Build with javac -encoding UTF-8.
1333f5
- Use %%javac and %%jar macros.
1333f5
- Run test suite during build (ignoring failures for now).
1333f5
- Follow upstream in excluding various test suite classes from jar; drop
1333f5
  dependency on junit4.
1333f5
1333f5
* Wed Aug 26 2009 Andrew Overholt <overholt@redhat.com> 1.43-5
1333f5
- Add maven POM
1333f5
1333f5
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.43-4
1333f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
1333f5
1333f5
* Sat Jul 11 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.43-3
1333f5
- Raise java requirement to >= 1.7 once again.
1333f5
1333f5
* Fri Jul 10 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.43-2
1333f5
- Re-enable AOT bits thanks to Andrew Haley.
1333f5
1333f5
* Mon Apr 20 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.43-1
1333f5
- Import Bouncy Castle 1.43.
1333f5
1333f5
* Sat Apr 18 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.42-3
1333f5
- Don't build AOT bits. The package needs java1.6
1333f5
1333f5
* Thu Apr 09 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.42-2
1333f5
- Add missing Requires: junit4
1333f5
1333f5
* Tue Mar 17 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.42-1
1333f5
- Import Bouncy Castle 1.42.
1333f5
- Update description.
1333f5
- Add javadoc subpackage.
1333f5
1333f5
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.41-3
1333f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
1333f5
1333f5
* Tue Nov 11 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 1.41-2
1333f5
- Fixed license tag (BSD -> MIT).
1333f5
- Minor improvements in the SPEC file for better compatibility with the 
1333f5
  Fedora Java Packaging Guidelines.
1333f5
- Added "Provides: bcprov == %%{version}-%%{release}".
1333f5
1333f5
* Thu Oct  2 2008 Lillian Angel <langel@redhat.com> - 1.41-1
1333f5
- Import Bouncy Castle 1.41.
1333f5
- Resolves: rhbz#465203
1333f5
1333f5
* Thu May 15 2008 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.39-1
1333f5
- Import Bouncy Castle 1.39.
1333f5
- Set target to 1.5.
1333f5
1333f5
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.38-2
1333f5
- Autorebuild for GCC 4.3
1333f5
1333f5
* Thu Nov 29 2007 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.38-1
1333f5
- Import Bouncy Castle 1.38.
1333f5
- Require junit4 for build.
1333f5
- Require java-1.7.0-icedtea-devel for build.
1333f5
- Wrap lines at 80 columns.
1333f5
- Inline rebuild-security-providers in post and postun sections.
1333f5
- Related: rhbz#260161
1333f5
1333f5
* Sat Mar 31 2007 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.34-3
1333f5
- Require java-1.5.0-gcj.
1333f5
1333f5
* Tue Dec 12 2006 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.34-2
1333f5
- Install bcprov jar and unversioned symlink in %%{_javadir}.
1333f5
- Install bcprov symlink in %%{_javadir}/gcj-endorsed.
1333f5
- Change release numbering format to X.fc7.
1333f5
- Include new bcprov files in files list.
1333f5
- Import Bouncy Castle 1.34.
1333f5
- Related: rhbz#218794
1333f5
1333f5
* Tue Jul 25 2006 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.33-3
1333f5
- Bump release number.
1333f5
1333f5
* Mon Jul 10 2006 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.33-2
1333f5
- Fix problems pointed out by reviewer.
1333f5
1333f5
* Fri Jul  7 2006 Thomas Fitzsimmons <fitzsim@redhat.com> - 1.33-1
1333f5
- First release.