]> git.pld-linux.org Git - packages/openssl.git/blob - openssl.spec
trigger improvements
[packages/openssl.git] / openssl.spec
1 #
2 # Conditional build:
3 %bcond_with purify      # Compile openssl with \-DPURIFY, usefull when one wants to
4                         # use valgrind debugger against openssl-linked programs
5
6 %include        /usr/lib/rpm/macros.perl
7 Summary:        OpenSSL Toolkit libraries for the "Secure Sockets Layer" (SSL v2/v3)
8 Summary(de.UTF-8):      Secure Sockets Layer (SSL)-Kommunikationslibrary
9 Summary(es.UTF-8):      Biblioteca C que suministra algoritmos y protocolos criptográficos
10 Summary(fr.UTF-8):      Utilitaires de communication SSL (Secure Sockets Layer)
11 Summary(pl.UTF-8):      Biblioteki OpenSSL (SSL v2/v3)
12 Summary(pt_BR.UTF-8):   Uma biblioteca C que fornece vários algoritmos e protocolos criptográficos
13 Summary(ru.UTF-8):      Библиотеки и утилиты для соединений через Secure Sockets Layer
14 Summary(uk.UTF-8):      Бібліотеки та утиліти для з'єднань через Secure Sockets Layer
15 Name:           openssl
16 Version:        0.9.7m
17 Release:        7
18 License:        Apache-like
19 Group:          Libraries
20 Source0:        ftp://ftp.openssl.org/source/%{name}-%{version}.tar.gz
21 # Source0-md5:  74a4d1b87e1e6e1ec95dbe58cb4c5b9a
22 Source2:        %{name}.1.pl
23 Source3:        %{name}-ssl-certificate.sh
24 Source4:        %{name}-c_rehash.sh
25 Patch0:         %{name}-alpha-ccc.patch
26 Patch1:         %{name}-optflags.patch
27 Patch2:         %{name}-globalCA.diff
28 Patch3:         %{name}-include.patch
29 Patch4:         %{name}-md5-sparcv9.patch
30 Patch5:         %{name}-ssl-algs.patch
31 Patch6:         %{name}-CVE-2007-3108.patch
32 Patch7:         %{name}-c_rehash.patch
33 Patch15:        %{name}-0.9.8b-cve-2007-5135.patch
34 Patch16:        %{name}-0.9.7a-cve-2008-5077.patch
35 Patch18:        %{name}-0.9.7a-cve-2009-2409.patch
36 #Patch19:       %{name}-0.9.7a-cve-2009-3555.patch
37 URL:            http://www.openssl.org/
38 BuildRequires:  perl-devel >= 1:5.6.1
39 BuildRequires:  rpm-perlprov >= 4.1-13
40 BuildRequires:  rpmbuild(macros) >= 1.213
41 BuildRequires:  sed >= 4.0
42 Requires:       ca-certificates >= 20120623-1.1
43 Obsoletes:      SSLeay
44 Obsoletes:      SSLeay-devel
45 Obsoletes:      SSLeay-perl
46 Obsoletes:      libopenssl0
47 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49 %description
50 The OpenSSL Project is a collaborative effort to develop a robust,
51 commercial-grade, full-featured, and Open Source toolkit implementing
52 the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS
53 v1) protocols with full-strength cryptography world-wide. The project
54 is managed by a worldwide community of volunteers that use the
55 Internet to communicate, plan, and develop the OpenSSL tookit and its
56 related documentation.
57
58 OpenSSL is based on the excellent SSLeay library developed by Eric A.
59 Young and Tim J. Hudson. The OpenSSL toolkit is licensed under an
60 Apache-style licence, which basically means that you are free to get
61 and use it for commercial and non-commercial purposes subject to some
62 simple license conditions.
63
64 This package contains shared libraries only, install openssl-tools if
65 you want to use openssl cmdline tool.
66
67 %description -l de.UTF-8
68 Openssl enthält das OpenSSL Zertifikatsmanagementtool und shared
69 libraries, die verschiedene Verschlüsselungs- und
70 Entschlüsselungsalgorithmen und -protokolle, wie DES, RC4, RSA und SSL
71 zur Verfügung stellen.
72
73 %description -l es.UTF-8
74 Biblioteca C que suministra algoritmos y protocolos criptográficos.
75
76 %description -l fr.UTF-8
77 OpenSSL est un outiil de gestion des certificats et les librairies
78 partagees qui fournit plusieurs protocoles et algorithmes de
79 codage/decodage, incluant DES, RC4, RSA et SSL.
80
81 %description -l pl.UTF-8
82 Implementacja protokołów kryptograficznych Secure Socket Layer (SSL)
83 v2/v3 oraz Transport Layer Security (TLS v1).
84
85 %description -l pt_BR.UTF-8
86 Uma biblioteca C que fornece vários algoritmos e protocolos
87 criptográficos, incluindo DES, RC4, RSA e SSL. Inclui bibliotecas
88 compartilhadas e utilitários.
89
90 %description -l ru.UTF-8
91 Программа openssl для работы с сертификатами и разделяемые библиотеки,
92 которые реализуют множетсво криптографических алгоритмов, включая DES,
93 RC4, RSA и SSL.
94
95 %description -l uk.UTF-8
96 Програма openssl для роботи з сертифікатами та бібліотеки спільного
97 користування, що реалізують велику кількість криптографічних
98 алгоритмів, включаючи DES, RC4, RSA та SSL.
99
100 %package tools
101 Summary:        OpenSSL command line tool and utilities
102 Summary(pl.UTF-8):      Zestaw narzędzi i skryptów
103 Group:          Applications/Communications
104 Requires:       %{name} = %{version}-%{release}
105 Requires:       which
106
107 %description tools
108 The OpenSSL Toolkit cmdline tool openssl and utility scripts.
109
110 %description tools -l pl.UTF-8
111 Zestaw narzędzi i skryptów wywoływanych z linii poleceń.
112
113 %package tools-perl
114 Summary:        OpenSSL utilities written in Perl
115 Summary(pl.UTF-8):      Narzędzia OpenSSL napisane w perlu
116 Group:          Applications/Communications
117 Requires:       %{name} = %{version}-%{release}
118
119 %description tools-perl
120 OpenSSL Toolkit tools written in Perl.
121
122 %description tools-perl -l pl.UTF-8
123 Narzędzia OpenSSL napisane w perlu.
124
125 %package devel
126 Summary:        Development part of OpenSSL Toolkit libraries
127 Summary(de.UTF-8):      Secure Sockets Layer Kommunikationslibrary: statische libraries+header
128 Summary(es.UTF-8):      Bibliotecas y archivos de inclusión para desarrollo OpenSSL
129 Summary(fr.UTF-8):      Librairies statiques, headers et utilitaires pour communication SSL
130 Summary(pl.UTF-8):      Część bibiloteki OpenSSL przeznaczona dla programistów
131 Summary(pt_BR.UTF-8):   Bibliotecas e arquivos de inclusão para desenvolvimento OpenSSL
132 Summary(ru.UTF-8):      Библиотеки, хедеры и утилиты для Secure Sockets Layer
133 Summary(uk.UTF-8):      Бібліотеки, хедери та утиліти для Secure Sockets Layer
134 Group:          Development/Libraries
135 Requires:       %{name} = %{version}-%{release}
136 Obsoletes:      libopenssl0-devel
137
138 %description devel
139 Development part of OpenSSL library.
140
141 %description devel -l es.UTF-8
142 Bibliotecas y archivos de inclusión para desarrollo OpenSSL
143
144 %description devel -l pl.UTF-8
145 Część biblioteki OpenSSL przeznaczona dla programistów.
146
147 %description devel -l pt_BR.UTF-8
148 Uma biblioteca C que fornece vários algoritmos e protocolos
149 criptográficos, incluindo DES, RC4, RSA e SSL. Inclui bibliotecas e
150 arquivos de inclusão para desenvolvimento.
151
152 %description devel -l ru.UTF-8
153 Программа openssl для работы с сертификатами и разделяемые библиотеки,
154 которые реализуют множетсво криптографических алгоритмов, включая DES,
155 RC4, RSA и SSL. Включает библиотеки и хедеры для разработки приложений
156 с использованием SSL.
157
158 %description devel -l uk.UTF-8
159 Програма openssl для роботи з сертифікатами та бібліотеки спільного
160 користування, що реалізують велику кількість криптографічних
161 алгоритмів, включаючи DES, RC4, RSA та SSL. Містить бібліотеки та
162 хедери для розробки програм з використанням SSL.
163
164 %package static
165 Summary:        Static OpenSSL libraries
166 Summary(pl.UTF-8):      Statyczne wersje bibliotek z OpenSSL
167 Summary(pt_BR.UTF-8):   Bibliotecas estáticas para desenvolvimento com openssl
168 Summary(ru.UTF-8):      Статические библиотеки разработчика для OpenSSL
169 Summary(uk.UTF-8):      Статичні бібліотеки програміста для OpenSSL
170 Group:          Development/Libraries
171 Requires:       %{name}-devel = %{version}-%{release}
172
173 %description static
174 Static OpenSSL Toolkit libraries.
175
176 %description static -l pl.UTF-8
177 Statyczne wersje bibliotek z OpenSSL.
178
179 %description static -l pt_BR.UTF-8
180 Bibliotecas estáticas para desenvolvimento com openssl.
181
182 %description static -l ru.UTF-8
183 Программа openssl для работы с сертификатами и разделяемые библиотеки,
184 которые реализуют множетсво криптографических алгоритмов, включая DES,
185 RC4, RSA и SSL. Включает статические библиотеки для разработки
186 приложений с использованием OpenSSL.
187
188 %description static -l uk.UTF-8
189 Програма openssl для роботи з сертифікатами та бібліотеки спільного
190 користування, що реалізують велику кількість криптографічних
191 алгоритмів, включаючи DES, RC4, RSA та SSL. Містить статичні
192 бібліотеки для розробки програм з використанням SSL.
193
194 %prep
195 %setup -q
196 %patch0 -p1
197 %patch1 -p1
198 %patch2 -p1
199 %patch3 -p1
200 %patch4 -p1
201 %patch5 -p1
202 %patch6 -p1
203 cp -a %{SOURCE4} c_rehash.sh
204 %patch7 -p1
205 %patch15 -p1
206 %patch16 -p1
207 %patch18 -p1
208 #%patch19 -p1
209
210 # conflicts with i386-only DES implementation
211 # (missing #ifdef OPENSSL_FIPS  ...  #endif)
212 :> fips-1.0/des/asm/fips-dx86-elf.s
213
214 %build
215 %{__perl} -pi -e 's#%{_prefix}/local/bin/perl#%{__perl}#g' \
216         `grep -l -r "%{_prefix}/local/bin/perl" *`
217
218 touch Makefile.*
219
220 %{__perl} util/perlpath.pl %{__perl}
221
222 OPTFLAGS="%{rpmcflags} %{rpmcppflags} %{?with_purify:-DPURIFY}" \
223 ./Configure \
224         --openssldir=%{_sysconfdir}/%{name} \
225         shared \
226 %ifarch %{ix86}
227 %ifarch i386
228         linux-elf 386
229 # ^- allow running on 80386 (default code uses bswapl available on i486+)
230 %else
231         linux-elf
232 %endif
233 %endif
234 %ifarch alpha
235         threads linux-alpha+bwx-gcc
236 %endif
237 %ifarch %{x8664}
238         linux-x86_64
239 %endif
240 %ifarch ia64
241         linux-ia64
242 %endif
243 %ifarch ppc
244         linux-ppc
245 %endif
246 %ifarch sparc
247         threads linux-sparcv8
248 %endif
249 %ifarch sparcv9
250         threads linux-sparcv9
251 %endif
252 %ifarch sparc64
253         threads linux64-sparcv9
254 %endif
255
256 %{__make} \
257         CC="%{__cc}" \
258         INSTALLTOP=%{_prefix}
259
260 %{__make} rehash \
261         CC="%{__cc}" \
262         INSTALLTOP=%{_prefix}
263
264 # Conv PODs to man pages. "openssl_" prefix is added to each manpage
265 # to avoid potential conflicts with others packages.
266 center="OpenSSL 0.9.7"
267 rel="OpenSSL 0.9.7"
268
269 cd doc/apps || exit 1
270 %{__perl} -pi -e 's/(\W)((?<!openssl_)\w+)(\(\d\))/$1openssl_$2$3/g; s/openssl_openssl/openssl/g;' *.pod;
271
272 for pod in *.pod; do
273         if [ $pod != "openssl.pod" ]; then
274                 mv -f $pod openssl_$pod;
275                 pod=openssl_$pod;
276         fi
277
278         sec=1
279         if [ $pod = "openssl_config.pod" ]; then
280                 sec=5
281         fi
282
283         manpage=`basename $pod .pod`.$sec;
284         pod2man --section="$sec" --release="$rel" --center="$center" \
285                 $pod > $manpage;
286         echo "$manpage";
287 done
288 cd ..
289
290 sec=3
291 for dir in ssl crypto; do
292         cd $dir || exit 1;
293         if [ $dir = "ssl" ]; then
294                 rel="OpenSSL SSL/TLS library"
295         elif [ $dir = "crypto" ]; then
296                 rel="OpenSSL cryptographic library"
297         fi
298
299         %{__perl} -pi -e 's/(\W)((?<!openssl_)\w+)(\(\d\))/$1openssl_$2$3/g; s/openssl_openssl/openssl/g;' *.pod;
300
301         for pod in *.pod; do
302                 sec=`[ "$pod" = "des_modes.pod" ] && echo 7 || echo 3`;
303                 mv -f $pod openssl_$pod;
304                 pod=openssl_$pod;
305                 manpage=`basename $pod .pod`.$sec;
306                 pod2man --section="$sec" --release="$rel" --center=" " $pod > $manpage;
307                 echo "$manpage";
308         done
309         cd ..
310 done
311
312 #cd perl
313 #%%{__perl} Makefile.PL \
314 #       INSTALLDIRS=vendor
315 #%{__make}
316
317 %install
318 rm -rf $RPM_BUILD_ROOT
319 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_libdir}/%{name}} \
320         $RPM_BUILD_ROOT{%{_mandir}/{pl/man1,man{1,3,5,7}},%{_datadir}/ssl} \
321         $RPM_BUILD_ROOT%{_pkgconfigdir}
322
323 %{__make} install \
324         CC="%{__cc}" \
325         INSTALLTOP=%{_prefix} \
326         INSTALL_PREFIX=$RPM_BUILD_ROOT \
327         MANDIR=%{_mandir}
328
329 if [ "%{_prefix}/lib/pkgconfig" != "%{_pkgconfigdir}" ] ; then
330         mv $RPM_BUILD_ROOT%{_prefix}/lib/pkgconfig/* \
331                 $RPM_BUILD_ROOT%{_pkgconfigdir}
332 fi
333 sed -i -e 's,^libdir=.*,libdir=%{_libdir},' $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
334
335 install libcrypto.a libssl.a $RPM_BUILD_ROOT%{_libdir}
336 install lib*.so.*.* $RPM_BUILD_ROOT%{_libdir}
337 ln -sf libcrypto.so.*.* $RPM_BUILD_ROOT%{_libdir}/libcrypto.so
338 ln -sf libssl.so.*.* $RPM_BUILD_ROOT%{_libdir}/libssl.so
339
340 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/misc/* $RPM_BUILD_ROOT%{_libdir}/%{name}
341 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/misc
342
343 find $RPM_BUILD_ROOT%{_mandir} -type f | xargs rm -f
344 install doc/apps/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
345 install doc/apps/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
346 install doc/ssl/*.3 doc/crypto/*.3 $RPM_BUILD_ROOT%{_mandir}/man3
347 install doc/crypto/*.7 $RPM_BUILD_ROOT%{_mandir}/man7
348 install %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/pl/man1/openssl.1
349 install %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/ssl-certificate
350 install -p c_rehash.sh $RPM_BUILD_ROOT%{_bindir}/c_rehash.sh
351 install fips-1.0/openssl_fips_fingerprint $RPM_BUILD_ROOT%{_bindir}
352
353 %clean
354 rm -rf $RPM_BUILD_ROOT
355
356 %post   -p /sbin/ldconfig
357 %postun -p /sbin/ldconfig
358
359 %triggerpostun -- %{name} < 0.9.7m-6.3
360 # don't do anything on --downgrade
361 if [ $1 -le 1 ]; then
362         exit 0
363 fi
364 if [ -d /var/lib/openssl/certs ]; then
365         mv /var/lib/openssl/certs/* %{_sysconfdir}/%{name}/certs 2>/dev/null || :
366 fi
367 if [ -d /var/lib/openssl/private ]; then
368         mv /var/lib/openssl/private/* %{_sysconfdir}/%{name}/private 2>/dev/null || :
369 fi
370 if [ -d /var/lib/openssl ]; then
371         for f in /var/lib/openssl/*; do
372                 [ -f "$f" ] && mv "$f" %{_sysconfdir}/%{name} 2>/dev/null || :
373         done
374         rmdir in /var/lib/openssl/* 2>/dev/null || :
375         rmdir in /var/lib/openssl 2>/dev/null || :
376 fi
377
378 %files
379 %defattr(644,root,root,755)
380 %doc CHANGES CHANGES.SSLeay LICENSE NEWS README doc/*.txt
381 %doc doc/openssl_button.gif doc/openssl_button.html
382 %attr(755,root,root) %{_libdir}/libcrypto.so.*.*.*
383 %attr(755,root,root) %{_libdir}/libssl.so.*.*.*
384 %dir %{_sysconfdir}/%{name}
385 %dir %{_sysconfdir}/%{name}/certs
386 %dir %{_sysconfdir}/%{name}/private
387 %dir %{_datadir}/ssl
388
389 %files tools
390 %defattr(644,root,root,755)
391
392 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/openssl.cnf
393
394 %attr(755,root,root) %{_bindir}/c_rehash.sh
395 %attr(755,root,root) %{_bindir}/openssl
396 %attr(755,root,root) %{_bindir}/openssl_fips_fingerprint
397 %attr(754,root,root) %{_bindir}/ssl-certificate
398
399 %dir %{_libdir}/%{name}
400 %attr(755,root,root) %{_libdir}/%{name}/CA.sh
401 %attr(755,root,root) %{_libdir}/%{name}/c_hash
402 %attr(755,root,root) %{_libdir}/%{name}/c_info
403 %attr(755,root,root) %{_libdir}/%{name}/c_issuer
404 %attr(755,root,root) %{_libdir}/%{name}/c_name
405
406 %{_mandir}/man1/openssl.1*
407 %{_mandir}/man1/openssl_asn1parse.1*
408 %{_mandir}/man1/openssl_ca.1*
409 %{_mandir}/man1/openssl_ciphers.1*
410 %{_mandir}/man1/openssl_crl.1*
411 %{_mandir}/man1/openssl_crl2pkcs7.1*
412 %{_mandir}/man1/openssl_dgst.1*
413 %{_mandir}/man1/openssl_dhparam.1*
414 %{_mandir}/man1/openssl_dsa.1*
415 %{_mandir}/man1/openssl_dsaparam.1*
416 %{_mandir}/man1/openssl_enc.1*
417 %{_mandir}/man1/openssl_errstr.1*
418 %{_mandir}/man1/openssl_gendsa.1*
419 %{_mandir}/man1/openssl_genrsa.1*
420 %{_mandir}/man1/openssl_nseq.1*
421 %{_mandir}/man1/openssl_ocsp.1*
422 %{_mandir}/man1/openssl_passwd.1*
423 %{_mandir}/man1/openssl_pkcs12.1*
424 %{_mandir}/man1/openssl_pkcs7.1*
425 %{_mandir}/man1/openssl_pkcs8.1*
426 %{_mandir}/man1/openssl_rand.1*
427 %{_mandir}/man1/openssl_req.1*
428 %{_mandir}/man1/openssl_rsa.1*
429 %{_mandir}/man1/openssl_rsautl.1*
430 %{_mandir}/man1/openssl_s_client.1*
431 %{_mandir}/man1/openssl_s_server.1*
432 %{_mandir}/man1/openssl_s_time.1*
433 %{_mandir}/man1/openssl_sess_id.1*
434 %{_mandir}/man1/openssl_smime.1*
435 %{_mandir}/man1/openssl_speed.1*
436 %{_mandir}/man1/openssl_spkac.1*
437 %{_mandir}/man1/openssl_verify.1*
438 %{_mandir}/man1/openssl_version.1*
439 %{_mandir}/man1/openssl_x509.1*
440 %{_mandir}/man5/*.5*
441 %lang(pl) %{_mandir}/pl/man1/openssl.1*
442
443 %files tools-perl
444 %defattr(644,root,root,755)
445 %attr(755,root,root) %{_libdir}/%{name}/CA.pl
446 %attr(755,root,root) %{_bindir}/c_rehash
447 %{_mandir}/man1/openssl_CA.pl.1*
448
449 %files devel
450 %defattr(644,root,root,755)
451 %attr(755,root,root) %{_libdir}/libcrypto.so
452 %attr(755,root,root) %{_libdir}/libssl.so
453 %{_includedir}/%{name}
454 %{_pkgconfigdir}/openssl.pc
455 %{_mandir}/man3/openssl*.3*
456 %{_mandir}/man7/openssl_des_modes.7*
457
458 %files static
459 %defattr(644,root,root,755)
460 %{_libdir}/lib*.a
This page took 0.062988 seconds and 3 git commands to generate.