/[packages]/updates/3/openssl/current/SPECS/openssl.spec
ViewVC logotype

Contents of /updates/3/openssl/current/SPECS/openssl.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30