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

Annotation of /updates/8/openssl/current/SPECS/openssl.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30