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

  ViewVC Help
Powered by ViewVC 1.1.30