/[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 397936 - (show annotations) (download)
Mon Feb 11 22:50:26 2013 UTC (11 years, 2 months ago) by luigiwalser
Original Path: cauldron/openssl/current/SPECS/openssl.spec
File size: 10165 byte(s)
- 1.0.1e
- remove upstreamed patch

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 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.1c-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-0.9.8-beta6-icpbrasil.diff
32 # http://qa.mandriva.com/show_bug.cgi?id=32621
33 Patch15: openssl-0.9.8e-crt.patch
34
35 # fedora patches
36 Patch7: openssl-1.0.0f-defaults.patch
37 Patch12: openssl-0.9.6-x509.patch
38 Patch13: openssl-0.9.8j-version-add-engines.patch
39 Patch16: openssl-1.0.0-beta5-enginesdir.patch
40 Patch17: openssl-1.0.1-pkgconfig-krb5.patch
41
42 # MIPS and ARM support
43 Patch300: openssl-1.0.1c-mips.patch
44 Patch301: openssl-1.0.1c-arm.patch
45 Requires: %{libname} = %{version}-%{release}
46 Requires: perl-base
47 Requires: rootcerts
48 %if %with_krb5
49 BuildRequires: krb5-devel
50 %endif
51 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 %patch16 -p1 -b .engines
127 %patch17 -p1 -b .krb5
128
129 %patch300 -p1 -b .mips
130 %patch301 -p1 -b .arm
131
132 perl -pi -e "s,^(OPENSSL_LIBNAME=).+$,\1%{_lib}," Makefile.org engines/Makefile
133
134 cp %{SOURCE2} Makefile.certificate
135 cp %{SOURCE3} make-dummy-cert
136 cp %{SOURCE4} openssl-thread-test.c
137
138 %build
139 %serverbuild
140
141 # Figure out which flags we want to use.
142 # default
143 sslarch=%{_os}-%{_arch}
144 %ifarch %ix86
145 sslarch=linux-elf
146 if ! echo %{_target} | grep -q i[56]86 ; then
147 sslflags="no-asm"
148 fi
149 %endif
150 %ifarch sparcv9
151 sslarch=linux-sparcv9
152 %endif
153 %ifarch alpha
154 sslarch=linux-alpha-gcc
155 %endif
156 %ifarch s390
157 sslarch="linux-generic32 -DB_ENDIAN -DNO_ASM"
158 %endif
159 %ifarch s390x
160 sslarch="linux-generic64 -DB_ENDIAN -DNO_ASM"
161 %endif
162
163 # ia64, x86_64, ppc, ppc64 are OK by default
164 # Configure the build tree. Override OpenSSL defaults with known-good defaults
165 # usable on all platforms. The Configure script already knows to use -fPIC and
166 # RPM_OPT_FLAGS, so we can skip specifiying them here.
167 ./Configure \
168 --prefix=%{_prefix} \
169 --openssldir=%{_sysconfdir}/pki/tls ${sslflags} \
170 --libdir=%{_lib}/ \
171 %if %with_krb5
172 --with-krb5-flavor=MIT --with-krb5-dir=%{_prefix} \
173 %endif
174 --enginesdir=%{_libdir}/openssl/%{version}/engines \
175 zlib no-idea no-rc5 enable-camellia shared enable-tlsext ${sslarch}
176
177 # Add -Wa,--noexecstack here so that libcrypto's assembler modules will be
178 # marked as not requiring an executable stack.
179 RPM_OPT_FLAGS="%{optflags} -Wa,--noexecstack"
180 make depend
181 make all build-shared
182
183 # Generate hashes for the included certs.
184 make rehash build-shared
185
186 %check
187 # Verify that what was compiled actually works.
188 export LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
189
190 make -C test apps tests
191
192 gcc -o openssl-thread-test \
193 %{?_with_krb5:`krb5-config --cflags`} \
194 -I./include \
195 %{optflags} \
196 openssl-thread-test.c \
197 -L. -lssl -lcrypto \
198 %{?_with_krb5:`krb5-config --libs`} \
199 -lpthread -lz -ldl
200
201 ./openssl-thread-test --threads %{thread_test_threads}
202
203 %install
204 rm -fr %{buildroot}
205
206 %makeinstall \
207 INSTALL_PREFIX=%{buildroot} \
208 MANDIR=%{_mandir} \
209 build-shared
210
211 install -d -m 755 %{buildroot}%{_libdir}/openssl/%{version}
212 mv %{buildroot}%{_libdir}/engines %{buildroot}%{_libdir}/openssl/%{version}
213
214 # make the rootcerts dir
215 install -d %{buildroot}%{_sysconfdir}/pki/tls/rootcerts
216
217 # Install a makefile for generating keys and self-signed certs, and a script
218 # for generating them on the fly.
219 install -d %{buildroot}%{_sysconfdir}/pki/tls/certs
220 install -m0644 Makefile.certificate %{buildroot}%{_sysconfdir}/pki/tls/certs/Makefile
221 install -m0755 make-dummy-cert %{buildroot}%{_sysconfdir}/pki/tls/certs/make-dummy-cert
222
223 # Pick a CA script.
224 mv %{buildroot}%{_sysconfdir}/pki/tls/misc/CA.sh %{buildroot}%{_sysconfdir}/pki/tls/misc/CA
225
226 install -d %{buildroot}%{_sysconfdir}/pki/CA
227 install -d %{buildroot}%{_sysconfdir}/pki/CA/private
228
229 # openssl was named ssleay in "ancient" times.
230 ln -snf openssl %{buildroot}%{_bindir}/ssleay
231
232 # The man pages rand.3 and passwd.1 conflict with other packages
233 # Rename them to ssl-* and also make a symlink from openssl-* to ssl-*
234 mv %{buildroot}%{_mandir}/man1/passwd.1 %{buildroot}%{_mandir}/man1/ssl-passwd.1
235 ln -sf ssl-passwd.1%{_extension} %{buildroot}%{_mandir}/man1/openssl-passwd.1%{_extension}
236
237 for i in rand err; do
238 mv %{buildroot}%{_mandir}/man3/$i.3 %{buildroot}%{_mandir}/man3/ssl-$i.3
239 ln -snf ssl-$i.3%{_extension} %{buildroot}%{_mandir}/man3/openssl-$i.3%{_extension}
240 done
241
242 rm -rf {main,devel}-doc-info
243 mkdir -p {main,devel}-doc-info
244 cat > main-doc-info/README.mga <<EOF
245 Warning:
246 The man page of passwd, passwd.1, has been renamed to ssl-passwd.1
247 to avoid a conflict with passwd.1 man page from the package passwd.
248 EOF
249
250 cat > devel-doc-info/README.mga <<EOF
251 Warning:
252 The man page of rand, rand.3, has been renamed to ssl-rand.3
253 to avoid a conflict with rand.3 from the package man-pages
254 The man page of err, err.3, has been renamed to ssl-err.3
255 to avoid a conflict with err.3 from the package man-pages
256 EOF
257
258 chmod 755 %{buildroot}%{_libdir}/pkgconfig
259
260 %multiarch_includes %{buildroot}%{_includedir}/openssl/opensslconf.h
261
262 # strip cannot touch these unless 755
263 chmod 755 %{buildroot}%{_libdir}/openssl/%{version}/engines/*.so*
264 chmod 755 %{buildroot}%{_libdir}/*.so*
265 chmod 755 %{buildroot}%{_bindir}/*
266
267 # nuke a mistake
268 rm -f %{buildroot}%{_mandir}/man3/.3
269
270 # nuke rpath
271 chrpath -d %{buildroot}%{_bindir}/openssl
272
273 # Fix libdir.
274 pushd %{buildroot}%{_libdir}/pkgconfig
275 for i in *.pc ; do
276 sed 's,^libdir=${exec_prefix}/lib$,libdir=${exec_prefix}/%{_lib},g' \
277 $i >$i.tmp && \
278 cat $i.tmp >$i && \
279 rm -f $i.tmp
280 done
281 popd
282
283 # adjust ssldir
284 perl -pi -e "s|^CATOP=.*|CATOP=%{_sysconfdir}/pki/tls|g" %{buildroot}%{_sysconfdir}/pki/tls/misc/CA
285 perl -pi -e "s|^\\\$CATOP\=\".*|\\\$CATOP\=\"%{_sysconfdir}/pki/tls\";|g" %{buildroot}%{_sysconfdir}/pki/tls/misc/CA.pl
286 perl -pi -e "s|\./demoCA|%{_sysconfdir}/pki/tls|g" %{buildroot}%{_sysconfdir}/pki/tls/openssl.cnf
287
288 %files
289 %doc FAQ INSTALL LICENSE NEWS PROBLEMS main-doc-info/README*
290 %doc README README.ASN1 README.ENGINE
291 %dir %{_sysconfdir}/pki
292 %dir %{_sysconfdir}/pki/CA
293 %dir %{_sysconfdir}/pki/CA/private
294 %dir %{_sysconfdir}/pki/tls
295 %dir %{_sysconfdir}/pki/tls/certs
296 %dir %{_sysconfdir}/pki/tls/misc
297 %dir %{_sysconfdir}/pki/tls/private
298 %dir %{_sysconfdir}/pki/tls/rootcerts
299 %config(noreplace) %{_sysconfdir}/pki/tls/openssl.cnf
300 %{_sysconfdir}/pki/tls/certs/make-dummy-cert
301 %{_sysconfdir}/pki/tls/certs/Makefile
302 %{_sysconfdir}/pki/tls/misc/*
303 %{_bindir}/*
304 %{_mandir}/man[157]/*
305
306 %files -n %{libname}
307 %doc FAQ INSTALL LICENSE NEWS PROBLEMS README*
308 %{_libdir}/lib*.so.%{maj}
309
310 %files -n %{engines_name}
311 %{_libdir}/openssl
312
313 %files -n %{develname}
314 %doc CHANGES doc/* devel-doc-info/README*
315 %dir %{_includedir}/openssl
316 %multiarch %{multiarch_includedir}/openssl/opensslconf.h
317 %{_includedir}/openssl/*
318 %{_libdir}/lib*.so
319 %{_mandir}/man3/*
320 %{_libdir}/pkgconfig/*
321
322 %files -n %{staticname}
323 %{_libdir}/lib*.a

  ViewVC Help
Powered by ViewVC 1.1.30