]> git.pld-linux.org Git - SPECS.git/blob - java-bcmail.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / java-bcmail.spec
1 #
2 # Conditional build:
3 %bcond_without  javadoc         # don't build javadoc
4 %bcond_without  tests           # don't build and run tests
5
6 %define         archivever      jdk16-%(echo %{version} | tr -d .)
7 %define         srcname         bcmail
8 Summary:        S/MIME and CMS libraries for Bouncy Castle
9 Name:           java-%{srcname}
10 Version:        1.46
11 Release:        3
12 License:        MIT
13 Group:          Libraries/Java
14 URL:            http://www.bouncycastle.org/
15 # Original source http://www.bouncycastle.org/download/bcmail-%{archivever}.tar.gz
16 # is modified to
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}
28 Obsoletes:      bcmail
29 Obsoletes:      bouncycastle-mail
30 BuildArch:      noarch
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
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.
38
39 %package javadoc
40 Summary:        Javadoc for Bouncy Castle S/MIME and CMS libraries
41 Group:          Documentation
42 Requires:       jpackage-utils
43
44 %description javadoc
45 API documentation for the Bouncy Castle S/MIME and CMS libraries.
46
47 %prep
48 %setup -q -n bcmail-%{archivever}
49
50 install -d src
51 unzip -qq src.zip -d src
52
53 # Remove provided binaries
54 find -type f -name "*.class" | xargs -r rm -v
55 find -type f -name "*.jar" | xargs -r rm -v
56
57 %build
58 CLASSPATH=$(build-classpath junit bcprov mail)
59 export CLASSPATH
60
61 cd src
62 %javac -g -target 1.5 -encoding UTF-8 $(find . -type f -name "*.java")
63 jarfile="../bcmail-%{version}.jar"
64
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
69
70 %if %{with tests}
71 CLASSPATH=${PWD:-$(pwd)}:$(build-classpath junit mail bcprov)
72 export CLASSPATH
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 || :
77 done
78 %endif
79
80 %install
81 rm -rf $RPM_BUILD_ROOT
82
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
87
88 # javadoc
89 %if %{with javadoc}
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
93 %endif
94
95 %clean
96 rm -rf $RPM_BUILD_ROOT
97
98 %post javadoc
99 ln -nfs %{srcname}-%{version} %{_javadocdir}/%{srcname}
100
101 %files
102 %defattr(644,root,root,755)
103 %doc *.html
104 %{_javadir}/%{srcname}-%{version}.jar
105 %{_javadir}/%{srcname}.jar
106
107 %if %{with javadoc}
108 %files javadoc
109 %defattr(644,root,root,755)
110 %{_javadocdir}/%{srcname}-%{version}
111 %ghost %{_javadocdir}/%{srcname}
112 %endif
This page took 0.711939 seconds and 3 git commands to generate.