/[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 256938 - (show annotations) (download)
Thu Jun 7 09:52:03 2012 UTC (11 years, 10 months ago) by guillomovitch
Original Path: cauldron/openssl/current/SPECS/openssl.spec
File size: 10180 byte(s)
- fix krb5 support, and make it mandatory as in fedora

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

  ViewVC Help
Powered by ViewVC 1.1.30