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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 818950 - (show annotations) (download)
Thu Mar 19 14:49:40 2015 UTC (9 years, 1 month ago) by luigiwalser
Original Path: cauldron/openssl/current/SPECS/openssl.spec
File size: 10352 byte(s)
- 1.0.2a
- rediff patches 2, 300, 301

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

  ViewVC Help
Powered by ViewVC 1.1.30