3 %bcond_without javadoc # don't build javadoc
4 %bcond_without tests # don't build and run tests
6 %define archivever jdk16-%(echo %{version} | tr -d .)
8 Summary: S/MIME and CMS libraries for Bouncy Castle
14 URL: http://www.bouncycastle.org/
15 # Original source http://www.bouncycastle.org/download/bcmail-%{archivever}.tar.gz
17 # bcmail-%{archivever}-FEDORA.tar.gz with references to patented algorithms removed.
18 # Speciifically: IDEA algorithms got removed.
19 Source0: bcmail-%{archivever}-FEDORA.tar.gz
20 # Source0-md5: d7b27678d5fdebaf79a19ef34ae9d9b3
21 BuildRequires: java(javamail)
22 BuildRequires: java-bcprov = %{version}
23 BuildRequires: java-junit
24 BuildRequires: jdk >= 1.6
25 BuildRequires: jpackage-utils >= 1.5
26 Requires: java(javamail)
27 Requires: java-bcprov = %{version}
29 Obsoletes: bouncycastle-mail
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 Bouncy Castle consists of a lightweight cryptography API and is a
35 provider for the Java Cryptography Extension and the Java Cryptography
36 Architecture. This library package offers additional classes, in
37 particuar generators/processors for S/MIME and CMS, for Bouncy Castle.
40 Summary: Javadoc for Bouncy Castle S/MIME and CMS libraries
42 Requires: jpackage-utils
45 API documentation for the Bouncy Castle S/MIME and CMS libraries.
48 %setup -q -n bcmail-%{archivever}
51 unzip -qq src.zip -d src
53 # Remove provided binaries
54 find -type f -name "*.class" | xargs -r rm -v
55 find -type f -name "*.jar" | xargs -r rm -v
58 CLASSPATH=$(build-classpath junit bcprov mail)
62 %javac -g -target 1.5 -encoding UTF-8 $(find . -type f -name "*.java")
63 jarfile="../bcmail-%{version}.jar"
65 # Exclude all */test/* , cf. upstream
66 files="$(find . -type f \( -name '*.class' -o -name '*.properties' \) -not -path '*/test/*')"
67 test ! -d classes && mf="" || mf="`find classes/ -type f -name "*.mf" 2>/dev/null`"
68 test -n "$mf" && %jar cvfm $jarfile $mf $files || %jar cvf $jarfile $files
71 CLASSPATH=${PWD:-$(pwd)}:$(build-classpath junit mail bcprov)
73 for test in $(find -name AllTests.class); do
74 test=${test#./}; test=${test%.class}; test=$(echo $test | tr / .)
75 # TODO: failures; get them fixed and remove || :
76 %java org.junit.runner.JUnitCore $test || :
81 rm -rf $RPM_BUILD_ROOT
83 # install bouncy castle mail
84 install -d $RPM_BUILD_ROOT%{_javadir}
85 cp -p %{srcname}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}-%{version}.jar
86 ln -s %{srcname}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}.jar
90 install -d $RPM_BUILD_ROOT%{_javadocdir}/%{srcname}-%{version}
91 cp -a docs/* $RPM_BUILD_ROOT%{_javadocdir}/%{srcname}-%{version}
92 ln -s %{srcname}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{srcname} # ghost symlink
96 rm -rf $RPM_BUILD_ROOT
99 ln -nfs %{srcname}-%{version} %{_javadocdir}/%{srcname}
102 %defattr(644,root,root,755)
104 %{_javadir}/%{srcname}-%{version}.jar
105 %{_javadir}/%{srcname}.jar
109 %defattr(644,root,root,755)
110 %{_javadocdir}/%{srcname}-%{version}
111 %ghost %{_javadocdir}/%{srcname}