]>
Commit | Line | Data |
---|---|---|
7f5657d3 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | %bcond_without apidocs # do not build and package API docs | |
5 | %bcond_without static_libs # don't build static libraries | |
6 | ||
7 | Summary: Crypto library written in C++ | |
8 | Name: botan | |
6f955439 | 9 | Version: 1.8.14 |
f7749ed3 | 10 | Release: 2 |
7f5657d3 ER |
11 | License: BSD |
12 | Group: Libraries | |
13 | URL: http://botan.randombit.net/ | |
14 | # tarfile is stripped using repack.sh. original tarfile to be found | |
15 | # here: http://files.randombit.net/botan/Botan-%%{version}.tbz | |
6f955439 AM |
16 | Source0: http://pkgs.fedoraproject.org/repo/pkgs/botan/Botan-%{version}.stripped.tbz/4b5ce78b1cfc0735eb7ec4f6903068ca/Botan-%{version}.stripped.tbz |
17 | # Source0-md5: 4b5ce78b1cfc0735eb7ec4f6903068ca | |
7f5657d3 ER |
18 | Source1: README.fedora |
19 | # soname was changed unintentionally upstream, revert it. | |
20 | Patch0: soname.patch | |
21 | BuildRequires: bzip2-devel | |
22 | BuildRequires: gmp-devel | |
23 | BuildRequires: libstdc++-devel | |
24 | BuildRequires: openssl-devel | |
25 | BuildRequires: python | |
26 | BuildRequires: zlib-devel | |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %description | |
30 | Botan is a BSD-licensed crypto library written in C++. It provides a | |
31 | wide variety of basic cryptographic algorithms, X.509 certificates and | |
32 | CRLs, PKCS \#10 certificate requests, a filter/pipe message processing | |
33 | system, and a wide variety of other features, all written in portable | |
34 | C++. The API reference, tutorial, and examples may help impart the | |
35 | flavor of the library. | |
36 | ||
37 | %package devel | |
38 | Summary: Development files for botan | |
39 | Group: Development/Libraries | |
40 | Requires: %{name} = %{version}-%{release} | |
41 | Requires: bzip2-devel | |
42 | Requires: gmp-devel | |
43 | Requires: openssl-devel | |
44 | Requires: pkgconfig | |
45 | Requires: zlib-devel | |
46 | ||
47 | %description devel | |
48 | This package contains libraries and header files for developing | |
49 | applications that use botan. | |
50 | ||
51 | %package static | |
52 | Summary: Static botan library | |
53 | Summary(pl.UTF-8): Statyczna biblioteka botan | |
54 | Group: Development/Libraries | |
55 | Requires: %{name}-devel = %{version}-%{release} | |
56 | ||
57 | %description static | |
58 | Static botan library. | |
59 | ||
60 | %description static -l pl.UTF-8 | |
61 | Statyczna biblioteka botan. | |
62 | ||
63 | %package apidocs | |
64 | Summary: botan API documentation | |
65 | Summary(pl.UTF-8): Dokumentacja API biblioteki botan | |
66 | Group: Documentation | |
67 | ||
68 | %description apidocs | |
69 | API and internal documentation for botan library. | |
70 | ||
71 | %description apidocs -l pl.UTF-8 | |
72 | Dokumentacja API biblioteki botan. | |
73 | ||
74 | %prep | |
75 | %setup -q -n Botan-%{version} | |
76 | %patch0 -p0 | |
77 | cp -p %{SOURCE1} . | |
78 | ||
79 | %build | |
80 | # we have the necessary prerequisites, so enable optional modules | |
81 | %define enable_modules gnump,bzip2,zlib,openssl | |
82 | ||
83 | # fixme: maybe disable unix_procs, very slow. | |
84 | %define disable_modules %{nil} | |
85 | ||
86 | ./configure.py \ | |
87 | --prefix=%{_prefix} \ | |
88 | --libdir=%{_lib} \ | |
89 | --cc=gcc \ | |
90 | --os=linux \ | |
91 | --cpu=%{_arch} \ | |
92 | --enable-modules=%{enable_modules} \ | |
93 | --disable-modules=%{disable_modules} | |
94 | ||
95 | # (ab)using CXX as an easy way to inject our CXXFLAGS | |
96 | %{__make} \ | |
97 | CXX="%{__cxx} %{rpmcxxflags}" | |
98 | ||
99 | %if %{with tests} | |
100 | %{__make} \ | |
101 | CXX="%{__cxx} %{rpmcxxflags}" check | |
102 | ||
103 | # these checks would fail | |
104 | mv checks/validate.dat{,.orig} | |
105 | awk '/\[.*\]/{f=0} /\[(RC5.*|RC6|IDEA)\]/{f=1} (f && !/^#/){sub(/^/,"#")} {print}' \ | |
106 | checks/validate.dat.orig > checks/validate.dat | |
107 | LD_LIBRARY_PATH=. ./check --validate | |
108 | %endif | |
109 | ||
110 | %install | |
111 | rm -rf $RPM_BUILD_ROOT | |
112 | %{__make} install \ | |
113 | INSTALL_CMD_EXEC="install -p -m 755" \ | |
114 | INSTALL_CMD_DATA="install -p -m 644" \ | |
115 | DOCDIR=_doc \ | |
116 | DESTDIR=$RPM_BUILD_ROOT%{_prefix} | |
117 | ||
f7749ed3 AM |
118 | rm $RPM_BUILD_ROOT%{_bindir}/botan-config |
119 | ||
7f5657d3 ER |
120 | %clean |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
923e0086 ER |
123 | # NOTE: only update ld.so cache, there are no symlinks |
124 | %post -p /sbin/postshell | |
125 | /sbin/ldconfig -X | |
126 | %postun -p /sbin/postshell | |
127 | /sbin/ldconfig -X | |
7f5657d3 ER |
128 | |
129 | %files | |
130 | %defattr(644,root,root,755) | |
131 | %doc _doc/readme.txt _doc/log.txt _doc/thanks.txt _doc/credits.txt | |
132 | %doc _doc/license.txt _doc/fips140.tex _doc/pgpkeys.asc | |
133 | %doc README.fedora | |
134 | %attr(755,root,root) %{_libdir}/libbotan-1.8.*.so | |
135 | ||
136 | %files devel | |
137 | %defattr(644,root,root,755) | |
7f5657d3 ER |
138 | %{_includedir}/botan |
139 | %{_libdir}/libbotan.so | |
140 | %{_pkgconfigdir}/botan-1.8.pc | |
141 | ||
142 | %if %{with static_libs} | |
143 | %files static | |
144 | %defattr(644,root,root,755) | |
145 | %{_libdir}/libbotan.a | |
146 | %endif | |
147 | ||
148 | %if %{with apidocs} | |
149 | %files apidocs | |
150 | %defattr(644,root,root,755) | |
151 | %doc doc/examples | |
152 | %doc _doc/api* _doc/tutorial* | |
153 | %endif |