1 |
guillomovitch |
257018 |
%define maj 1.0.0 |
2 |
blino |
733 |
%define engines_name %mklibname openssl-engines %{maj} |
3 |
|
|
%define libname %mklibname openssl %{maj} |
4 |
|
|
%define develname %mklibname openssl -d |
5 |
|
|
%define staticname %mklibname openssl -s -d |
6 |
|
|
|
7 |
|
|
%define conflict1 %mklibname openssl 0.9.7 |
8 |
|
|
%define conflict2 %mklibname openssl 0.9.8 |
9 |
|
|
|
10 |
|
|
# Number of threads to spawn when testing some threading fixes. |
11 |
|
|
#define thread_test_threads %{?threads:%{threads}}%{!?threads:1} |
12 |
|
|
|
13 |
guillomovitch |
494272 |
%define with_krb5 0 |
14 |
blino |
733 |
|
15 |
|
|
Summary: Secure Sockets Layer communications libs & utils |
16 |
|
|
Name: openssl |
17 |
luigiwalser |
660553 |
Version: 1.0.1i |
18 |
umeabot |
683247 |
Release: %mkrel 2 |
19 |
blino |
733 |
License: BSD-like |
20 |
|
|
Group: System/Libraries |
21 |
|
|
URL: http://www.openssl.org/ |
22 |
fwang |
394893 |
Source0: http://www.openssl.org/source/%{name}-%{version}.tar.gz |
23 |
|
|
Source1: http://www.openssl.org/source/%{name}-%{version}.tar.gz.asc |
24 |
blino |
733 |
Source2: Makefile.certificate |
25 |
|
|
Source3: make-dummy-cert |
26 |
|
|
Source4: openssl-thread-test.c |
27 |
|
|
# (gb) 0.9.7b-4mdk: Handle RPM_OPT_FLAGS in Configure |
28 |
guillomovitch |
256937 |
Patch2: openssl-1.0.1c-optflags.patch |
29 |
blino |
733 |
# (oe) support Brazilian Government OTHERNAME X509v3 field (#14158) |
30 |
|
|
# http://www.iti.gov.br/resolucoes/RESOLU__O_13_DE_26_04_2002.PDF |
31 |
|
|
Patch6: openssl-0.9.8-beta6-icpbrasil.diff |
32 |
guillomovitch |
256937 |
# http://qa.mandriva.com/show_bug.cgi?id=32621 |
33 |
luigiwalser |
565222 |
Patch15: openssl-0.9.8e-crt.patch |
34 |
guillomovitch |
256937 |
|
35 |
|
|
# fedora patches |
36 |
guillomovitch |
191618 |
Patch7: openssl-1.0.0f-defaults.patch |
37 |
blino |
733 |
Patch12: openssl-0.9.6-x509.patch |
38 |
guillomovitch |
256937 |
Patch13: openssl-0.9.8j-version-add-engines.patch |
39 |
|
|
Patch16: openssl-1.0.0-beta5-enginesdir.patch |
40 |
guillomovitch |
256938 |
Patch17: openssl-1.0.1-pkgconfig-krb5.patch |
41 |
luigiwalser |
660553 |
Patch18: openssl-1.0.1i-manfix.patch |
42 |
guillomovitch |
256937 |
|
43 |
blino |
733 |
# MIPS and ARM support |
44 |
guillomovitch |
256937 |
Patch300: openssl-1.0.1c-mips.patch |
45 |
|
|
Patch301: openssl-1.0.1c-arm.patch |
46 |
blino |
733 |
Requires: %{libname} = %{version}-%{release} |
47 |
|
|
Requires: rootcerts |
48 |
guillomovitch |
337573 |
%if %with_krb5 |
49 |
guillomovitch |
256938 |
BuildRequires: krb5-devel |
50 |
guillomovitch |
337573 |
%endif |
51 |
blino |
733 |
BuildRequires: multiarch-utils >= 1.0.3 |
52 |
|
|
BuildRequires: chrpath |
53 |
|
|
BuildRequires: zlib-devel |
54 |
|
|
# (tv) for test suite: |
55 |
|
|
BuildRequires: bc |
56 |
|
|
|
57 |
|
|
%description |
58 |
|
|
The openssl certificate management tool and the shared libraries that provide |
59 |
|
|
various encryption and decription algorithms and protocols, including DES, RC4, |
60 |
|
|
RSA and SSL. |
61 |
|
|
|
62 |
|
|
%package -n %{engines_name} |
63 |
|
|
Summary: Engines for openssl |
64 |
|
|
Group: System/Libraries |
65 |
|
|
Obsoletes: openssl-engines < 1.0.0a-5 |
66 |
|
|
Provides: openssl-engines = %{version}-%{release} |
67 |
|
|
|
68 |
|
|
%description -n %{engines_name} |
69 |
|
|
This package provides engines for openssl. |
70 |
|
|
|
71 |
|
|
%package -n %{libname} |
72 |
|
|
Summary: Secure Sockets Layer communications libs |
73 |
|
|
Group: System/Libraries |
74 |
|
|
Requires: %{engines_name} >= %{version}-%{release} |
75 |
|
|
Provides: %{libname} = %{version}-%{release} |
76 |
|
|
|
77 |
|
|
%description -n %{libname} |
78 |
|
|
The libraries files are needed for various cryptographic algorithms |
79 |
|
|
and protocols, including DES, RC4, RSA and SSL. |
80 |
|
|
|
81 |
|
|
%package -n %{develname} |
82 |
|
|
Summary: Secure Sockets Layer communications libs & headers & utils |
83 |
|
|
Group: Development/Other |
84 |
|
|
Requires: %{libname} = %{version}-%{release} |
85 |
|
|
Provides: libopenssl-devel |
86 |
|
|
Provides: openssl-devel = %{version}-%{release} |
87 |
|
|
Obsoletes: openssl-devel |
88 |
|
|
# temporary opsolete, will be a conflict later. a compat package |
89 |
|
|
# with openssl-0.9.7 devel libs will be provided soon |
90 |
|
|
Obsoletes: %{conflict1}-devel |
91 |
|
|
Obsoletes: %{conflict2}-devel |
92 |
|
|
Obsoletes: %{mklibname openssl 1.0.0}-devel |
93 |
|
|
Provides: %{name}-devel = %{version}-%{release} |
94 |
|
|
|
95 |
|
|
%description -n %{develname} |
96 |
|
|
The libraries and include files needed to compile apps with support |
97 |
|
|
for various cryptographic algorithms and protocols, including DES, RC4, RSA |
98 |
|
|
and SSL. |
99 |
|
|
|
100 |
|
|
%package -n %{staticname} |
101 |
|
|
Summary: Secure Sockets Layer communications static libs |
102 |
|
|
Group: Development/Other |
103 |
|
|
Requires: %{develname} = %{version}-%{release} |
104 |
|
|
Provides: libopenssl-static-devel |
105 |
|
|
Provides: openssl-static-devel = %{version}-%{release} |
106 |
|
|
# temporary opsolete, will be a conflict later. a compat package |
107 |
|
|
# with openssl-0.9.7 static-devel libs will be provided soon |
108 |
|
|
Obsoletes: %{conflict1}-static-devel |
109 |
|
|
Obsoletes: %{conflict2}-static-devel |
110 |
|
|
Obsoletes: %{mklibname openssl 1.0.0}-static-devel |
111 |
|
|
Provides: %{name}-static-devel = %{version}-%{release} |
112 |
|
|
|
113 |
|
|
%description -n %{staticname} |
114 |
|
|
The static libraries needed to compile apps with support for various |
115 |
|
|
cryptographic algorithms and protocols, including DES, RC4, RSA and SSL. |
116 |
|
|
|
117 |
|
|
%prep |
118 |
|
|
|
119 |
|
|
%setup -q -n %{name}-%{version} |
120 |
|
|
%patch2 -p1 -b .optflags |
121 |
|
|
%patch6 -p0 -b .icpbrasil |
122 |
|
|
%patch7 -p1 -b .defaults |
123 |
|
|
%patch12 -p1 -b .x509 |
124 |
|
|
%patch13 -p1 -b .version-add-engines |
125 |
|
|
%patch15 -p1 -b .crt |
126 |
guillomovitch |
256937 |
%patch16 -p1 -b .engines |
127 |
guillomovitch |
256938 |
%patch17 -p1 -b .krb5 |
128 |
sander85 |
432014 |
%patch18 -p1 -b .manfix |
129 |
blino |
733 |
|
130 |
|
|
%patch300 -p1 -b .mips |
131 |
|
|
%patch301 -p1 -b .arm |
132 |
|
|
|
133 |
|
|
perl -pi -e "s,^(OPENSSL_LIBNAME=).+$,\1%{_lib}," Makefile.org engines/Makefile |
134 |
|
|
|
135 |
|
|
cp %{SOURCE2} Makefile.certificate |
136 |
|
|
cp %{SOURCE3} make-dummy-cert |
137 |
|
|
cp %{SOURCE4} openssl-thread-test.c |
138 |
|
|
|
139 |
|
|
%build |
140 |
|
|
%serverbuild |
141 |
|
|
|
142 |
|
|
# Figure out which flags we want to use. |
143 |
|
|
# default |
144 |
|
|
sslarch=%{_os}-%{_arch} |
145 |
|
|
%ifarch %ix86 |
146 |
|
|
sslarch=linux-elf |
147 |
|
|
if ! echo %{_target} | grep -q i[56]86 ; then |
148 |
|
|
sslflags="no-asm" |
149 |
|
|
fi |
150 |
|
|
%endif |
151 |
|
|
%ifarch sparcv9 |
152 |
|
|
sslarch=linux-sparcv9 |
153 |
|
|
%endif |
154 |
|
|
%ifarch alpha |
155 |
|
|
sslarch=linux-alpha-gcc |
156 |
|
|
%endif |
157 |
|
|
%ifarch s390 |
158 |
|
|
sslarch="linux-generic32 -DB_ENDIAN -DNO_ASM" |
159 |
|
|
%endif |
160 |
|
|
%ifarch s390x |
161 |
|
|
sslarch="linux-generic64 -DB_ENDIAN -DNO_ASM" |
162 |
|
|
%endif |
163 |
|
|
|
164 |
|
|
# ia64, x86_64, ppc, ppc64 are OK by default |
165 |
|
|
# Configure the build tree. Override OpenSSL defaults with known-good defaults |
166 |
|
|
# usable on all platforms. The Configure script already knows to use -fPIC and |
167 |
|
|
# RPM_OPT_FLAGS, so we can skip specifiying them here. |
168 |
|
|
./Configure \ |
169 |
guillomovitch |
256937 |
--prefix=%{_prefix} \ |
170 |
blino |
733 |
--openssldir=%{_sysconfdir}/pki/tls ${sslflags} \ |
171 |
guillomovitch |
256937 |
--libdir=%{_lib}/ \ |
172 |
guillomovitch |
337573 |
%if %with_krb5 |
173 |
guillomovitch |
256938 |
--with-krb5-flavor=MIT --with-krb5-dir=%{_prefix} \ |
174 |
guillomovitch |
337573 |
%endif |
175 |
guillomovitch |
327008 |
--enginesdir=%{_libdir}/openssl/%{version}/engines \ |
176 |
guillomovitch |
639996 |
zlib no-idea no-rc5 enable-camellia shared enable-tlsext ${sslarch} \ |
177 |
|
|
%ifarch x86_64 |
178 |
|
|
enable-ec_nistp_64_gcc_128 |
179 |
|
|
%endif |
180 |
blino |
733 |
|
181 |
|
|
# Add -Wa,--noexecstack here so that libcrypto's assembler modules will be |
182 |
|
|
# marked as not requiring an executable stack. |
183 |
|
|
RPM_OPT_FLAGS="%{optflags} -Wa,--noexecstack" |
184 |
|
|
make depend |
185 |
|
|
make all build-shared |
186 |
|
|
|
187 |
|
|
# Generate hashes for the included certs. |
188 |
|
|
make rehash build-shared |
189 |
|
|
|
190 |
|
|
%check |
191 |
|
|
# Verify that what was compiled actually works. |
192 |
|
|
export LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} |
193 |
|
|
|
194 |
|
|
make -C test apps tests |
195 |
|
|
|
196 |
|
|
gcc -o openssl-thread-test \ |
197 |
|
|
%{?_with_krb5:`krb5-config --cflags`} \ |
198 |
|
|
-I./include \ |
199 |
|
|
%{optflags} \ |
200 |
|
|
openssl-thread-test.c \ |
201 |
|
|
-L. -lssl -lcrypto \ |
202 |
|
|
%{?_with_krb5:`krb5-config --libs`} \ |
203 |
|
|
-lpthread -lz -ldl |
204 |
|
|
|
205 |
|
|
./openssl-thread-test --threads %{thread_test_threads} |
206 |
|
|
|
207 |
|
|
%install |
208 |
|
|
%makeinstall \ |
209 |
|
|
INSTALL_PREFIX=%{buildroot} \ |
210 |
|
|
MANDIR=%{_mandir} \ |
211 |
|
|
build-shared |
212 |
|
|
|
213 |
guillomovitch |
327008 |
install -d -m 755 %{buildroot}%{_libdir}/openssl/%{version} |
214 |
|
|
mv %{buildroot}%{_libdir}/engines %{buildroot}%{_libdir}/openssl/%{version} |
215 |
blino |
733 |
|
216 |
|
|
# make the rootcerts dir |
217 |
|
|
install -d %{buildroot}%{_sysconfdir}/pki/tls/rootcerts |
218 |
|
|
|
219 |
|
|
# Install a makefile for generating keys and self-signed certs, and a script |
220 |
|
|
# for generating them on the fly. |
221 |
|
|
install -d %{buildroot}%{_sysconfdir}/pki/tls/certs |
222 |
|
|
install -m0644 Makefile.certificate %{buildroot}%{_sysconfdir}/pki/tls/certs/Makefile |
223 |
|
|
install -m0755 make-dummy-cert %{buildroot}%{_sysconfdir}/pki/tls/certs/make-dummy-cert |
224 |
|
|
|
225 |
|
|
# Pick a CA script. |
226 |
|
|
mv %{buildroot}%{_sysconfdir}/pki/tls/misc/CA.sh %{buildroot}%{_sysconfdir}/pki/tls/misc/CA |
227 |
|
|
|
228 |
|
|
install -d %{buildroot}%{_sysconfdir}/pki/CA |
229 |
|
|
install -d %{buildroot}%{_sysconfdir}/pki/CA/private |
230 |
|
|
|
231 |
|
|
# openssl was named ssleay in "ancient" times. |
232 |
|
|
ln -snf openssl %{buildroot}%{_bindir}/ssleay |
233 |
|
|
|
234 |
|
|
# The man pages rand.3 and passwd.1 conflict with other packages |
235 |
|
|
# Rename them to ssl-* and also make a symlink from openssl-* to ssl-* |
236 |
|
|
mv %{buildroot}%{_mandir}/man1/passwd.1 %{buildroot}%{_mandir}/man1/ssl-passwd.1 |
237 |
oden |
330865 |
ln -sf ssl-passwd.1%{_extension} %{buildroot}%{_mandir}/man1/openssl-passwd.1%{_extension} |
238 |
blino |
733 |
|
239 |
|
|
for i in rand err; do |
240 |
|
|
mv %{buildroot}%{_mandir}/man3/$i.3 %{buildroot}%{_mandir}/man3/ssl-$i.3 |
241 |
oden |
330865 |
ln -snf ssl-$i.3%{_extension} %{buildroot}%{_mandir}/man3/openssl-$i.3%{_extension} |
242 |
blino |
733 |
done |
243 |
|
|
|
244 |
|
|
rm -rf {main,devel}-doc-info |
245 |
|
|
mkdir -p {main,devel}-doc-info |
246 |
guillomovitch |
191621 |
cat > main-doc-info/README.mga <<EOF |
247 |
blino |
733 |
Warning: |
248 |
|
|
The man page of passwd, passwd.1, has been renamed to ssl-passwd.1 |
249 |
|
|
to avoid a conflict with passwd.1 man page from the package passwd. |
250 |
|
|
EOF |
251 |
|
|
|
252 |
guillomovitch |
191621 |
cat > devel-doc-info/README.mga <<EOF |
253 |
blino |
733 |
Warning: |
254 |
|
|
The man page of rand, rand.3, has been renamed to ssl-rand.3 |
255 |
|
|
to avoid a conflict with rand.3 from the package man-pages |
256 |
|
|
The man page of err, err.3, has been renamed to ssl-err.3 |
257 |
|
|
to avoid a conflict with err.3 from the package man-pages |
258 |
|
|
EOF |
259 |
|
|
|
260 |
|
|
chmod 755 %{buildroot}%{_libdir}/pkgconfig |
261 |
|
|
|
262 |
|
|
%multiarch_includes %{buildroot}%{_includedir}/openssl/opensslconf.h |
263 |
|
|
|
264 |
|
|
# strip cannot touch these unless 755 |
265 |
guillomovitch |
327008 |
chmod 755 %{buildroot}%{_libdir}/openssl/%{version}/engines/*.so* |
266 |
blino |
733 |
chmod 755 %{buildroot}%{_libdir}/*.so* |
267 |
|
|
chmod 755 %{buildroot}%{_bindir}/* |
268 |
|
|
|
269 |
|
|
# nuke a mistake |
270 |
|
|
rm -f %{buildroot}%{_mandir}/man3/.3 |
271 |
|
|
|
272 |
|
|
# nuke rpath |
273 |
|
|
chrpath -d %{buildroot}%{_bindir}/openssl |
274 |
|
|
|
275 |
|
|
# Fix libdir. |
276 |
|
|
pushd %{buildroot}%{_libdir}/pkgconfig |
277 |
|
|
for i in *.pc ; do |
278 |
|
|
sed 's,^libdir=${exec_prefix}/lib$,libdir=${exec_prefix}/%{_lib},g' \ |
279 |
|
|
$i >$i.tmp && \ |
280 |
|
|
cat $i.tmp >$i && \ |
281 |
|
|
rm -f $i.tmp |
282 |
|
|
done |
283 |
|
|
popd |
284 |
|
|
|
285 |
|
|
# adjust ssldir |
286 |
|
|
perl -pi -e "s|^CATOP=.*|CATOP=%{_sysconfdir}/pki/tls|g" %{buildroot}%{_sysconfdir}/pki/tls/misc/CA |
287 |
|
|
perl -pi -e "s|^\\\$CATOP\=\".*|\\\$CATOP\=\"%{_sysconfdir}/pki/tls\";|g" %{buildroot}%{_sysconfdir}/pki/tls/misc/CA.pl |
288 |
|
|
perl -pi -e "s|\./demoCA|%{_sysconfdir}/pki/tls|g" %{buildroot}%{_sysconfdir}/pki/tls/openssl.cnf |
289 |
|
|
|
290 |
|
|
%files |
291 |
|
|
%doc FAQ INSTALL LICENSE NEWS PROBLEMS main-doc-info/README* |
292 |
guillomovitch |
256937 |
%doc README README.ASN1 README.ENGINE |
293 |
blino |
733 |
%dir %{_sysconfdir}/pki |
294 |
|
|
%dir %{_sysconfdir}/pki/CA |
295 |
|
|
%dir %{_sysconfdir}/pki/CA/private |
296 |
|
|
%dir %{_sysconfdir}/pki/tls |
297 |
|
|
%dir %{_sysconfdir}/pki/tls/certs |
298 |
|
|
%dir %{_sysconfdir}/pki/tls/misc |
299 |
|
|
%dir %{_sysconfdir}/pki/tls/private |
300 |
|
|
%dir %{_sysconfdir}/pki/tls/rootcerts |
301 |
guillomovitch |
191620 |
%config(noreplace) %{_sysconfdir}/pki/tls/openssl.cnf |
302 |
|
|
%{_sysconfdir}/pki/tls/certs/make-dummy-cert |
303 |
|
|
%{_sysconfdir}/pki/tls/certs/Makefile |
304 |
|
|
%{_sysconfdir}/pki/tls/misc/* |
305 |
|
|
%{_bindir}/* |
306 |
|
|
%{_mandir}/man[157]/* |
307 |
blino |
733 |
|
308 |
|
|
%files -n %{libname} |
309 |
|
|
%doc FAQ INSTALL LICENSE NEWS PROBLEMS README* |
310 |
fwang |
257304 |
%{_libdir}/lib*.so.%{maj} |
311 |
blino |
733 |
|
312 |
|
|
%files -n %{engines_name} |
313 |
guillomovitch |
311668 |
%{_libdir}/openssl |
314 |
blino |
733 |
|
315 |
|
|
%files -n %{develname} |
316 |
|
|
%doc CHANGES doc/* devel-doc-info/README* |
317 |
guillomovitch |
191620 |
%dir %{_includedir}/openssl |
318 |
blino |
733 |
%multiarch %{multiarch_includedir}/openssl/opensslconf.h |
319 |
guillomovitch |
191620 |
%{_includedir}/openssl/* |
320 |
|
|
%{_libdir}/lib*.so |
321 |
|
|
%{_mandir}/man3/* |
322 |
|
|
%{_libdir}/pkgconfig/* |
323 |
blino |
733 |
|
324 |
|
|
%files -n %{staticname} |
325 |
fwang |
395433 |
%{_libdir}/lib*.a |