1 | # For the curious:
|
---|
2 | # 0.9.5a soversion = 0
|
---|
3 | # 0.9.6 soversion = 1
|
---|
4 | # 0.9.6a soversion = 2
|
---|
5 | # 0.9.6c soversion = 3
|
---|
6 | # 0.9.7a soversion = 4
|
---|
7 | # 0.9.7ef soversion = 5
|
---|
8 | # 0.9.8ab soversion = 6
|
---|
9 | # 0.9.8g soversion = 7
|
---|
10 | # 0.9.8jk + EAP-FAST soversion = 8
|
---|
11 | # 1.0.0 soversion = 10
|
---|
12 | %define soversion 10
|
---|
13 |
|
---|
14 | # Number of threads to spawn when testing some threading fixes.
|
---|
15 | %define thread_test_threads %{?threads:%{threads}}%{!?threads:1}
|
---|
16 |
|
---|
17 | # Arches on which we need to prevent arch conflicts on opensslconf.h, must
|
---|
18 | # also be handled in opensslconf-new.h.
|
---|
19 | %define multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x sparcv9 sparc64 x86_64
|
---|
20 |
|
---|
21 | Summary: A general purpose cryptography library with TLS implementation
|
---|
22 | Name: openssl
|
---|
23 | Version: 1.0.0a
|
---|
24 | Release: 4%{?dist}
|
---|
25 |
|
---|
26 | Source: openssl-%{version}.tar.gz
|
---|
27 |
|
---|
28 | # Build changes
|
---|
29 | Patch0: openssl-os2.diff
|
---|
30 |
|
---|
31 | License: OpenSSL
|
---|
32 | Group: System Environment/Libraries
|
---|
33 | URL: http://www.openssl.org/
|
---|
34 | BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
---|
35 |
|
---|
36 | #BuildRequires: mktemp, krb5-devel, perl, sed, zlib-devel, /usr/bin/cmp
|
---|
37 | BuildRequires: zlib-devel
|
---|
38 | #BuildRequires: /usr/bin/rename
|
---|
39 | #Requires: mktemp, ca-certificates >= 2008-5
|
---|
40 |
|
---|
41 | %description
|
---|
42 | The OpenSSL toolkit provides support for secure communications between
|
---|
43 | machines. OpenSSL includes a certificate management tool and shared
|
---|
44 | libraries which provide various cryptographic algorithms and
|
---|
45 | protocols.
|
---|
46 |
|
---|
47 | %package devel
|
---|
48 | Summary: Files for development of applications which will use OpenSSL
|
---|
49 | Group: Development/Libraries
|
---|
50 | Requires: %{name} = %{version}-%{release}, zlib-devel
|
---|
51 | Requires: pkgconfig
|
---|
52 |
|
---|
53 | %description devel
|
---|
54 | OpenSSL is a toolkit for supporting cryptography. The openssl-devel
|
---|
55 | package contains include files needed to develop applications which
|
---|
56 | support various cryptographic algorithms and protocols.
|
---|
57 |
|
---|
58 | %package static
|
---|
59 | Summary: Libraries for static linking of applications which will use OpenSSL
|
---|
60 | Group: Development/Libraries
|
---|
61 | Requires: %{name}-devel = %{version}-%{release}
|
---|
62 |
|
---|
63 | %description static
|
---|
64 | OpenSSL is a toolkit for supporting cryptography. The openssl-static
|
---|
65 | package contains static libraries needed for static linking of
|
---|
66 | applications which support various cryptographic algorithms and
|
---|
67 | protocols.
|
---|
68 |
|
---|
69 | %package perl
|
---|
70 | Summary: Perl scripts provided with OpenSSL
|
---|
71 | Group: Applications/Internet
|
---|
72 | Requires: perl
|
---|
73 | Requires: %{name} = %{version}-%{release}
|
---|
74 |
|
---|
75 | %description perl
|
---|
76 | OpenSSL is a toolkit for supporting cryptography. The openssl-perl
|
---|
77 | package provides Perl scripts for converting certificates and keys
|
---|
78 | from other formats to the formats used by the OpenSSL toolkit.
|
---|
79 |
|
---|
80 | %prep
|
---|
81 | %setup -q -n %{name}-%{version}
|
---|
82 | %patch0 -p1 -b .os2~
|
---|
83 |
|
---|
84 | # Modify the various perl scripts to reference perl in the right location.
|
---|
85 | perl util/perlpath.pl `dirname %{__perl}`
|
---|
86 |
|
---|
87 | # Generate a table with the compile settings for my perusal.
|
---|
88 | touch Makefile
|
---|
89 | make TABLE PERL=%{__perl}
|
---|
90 |
|
---|
91 | %build
|
---|
92 | # Figure out which flags we want to use.
|
---|
93 | # default
|
---|
94 | sslarch=OS2-KNIX
|
---|
95 |
|
---|
96 | # Configure the build tree. Override OpenSSL defaults with known-good defaults
|
---|
97 | # usable on all platforms. The Configure script already knows to use -fPIC and
|
---|
98 | # RPM_OPT_FLAGS, so we can skip specifiying them here.
|
---|
99 | export CONFIG_SHELL="/@unixroot/usr/bin/sh.exe"
|
---|
100 | export MAKESHELL="/@unixroot/usr/bin/sh.exe"
|
---|
101 | export CFLAGS="${CFLAGS:-%optflags}" ; \
|
---|
102 | ./Configure \
|
---|
103 | --prefix=%{_usr} --openssldir=%{_sysconfdir}/pki/tls ${sslflags} \
|
---|
104 | zlib enable-camellia enable-seed enable-tlsext enable-rfc3779 \
|
---|
105 | enable-cms no-idea no-mdc2 no-rc5 no-ec no-ecdh no-ecdsa \
|
---|
106 | no-krb5 \
|
---|
107 | ${sslarch} shared
|
---|
108 |
|
---|
109 | # Add -Wa,--noexecstack here so that libcrypto's assembler modules will be
|
---|
110 | # marked as not requiring an executable stack.
|
---|
111 | #RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wa,--noexecstack"
|
---|
112 | make depend
|
---|
113 | # YD smp build not supported
|
---|
114 | make all
|
---|
115 |
|
---|
116 | # Generate hashes for the included certs.
|
---|
117 | make rehash
|
---|
118 |
|
---|
119 | # Overwrite FIPS README
|
---|
120 | #cp -f %{SOURCE11} .
|
---|
121 |
|
---|
122 | %check
|
---|
123 | # Verify that what was compiled actually works.
|
---|
124 |
|
---|
125 | # We must revert patch33 before tests otherwise they will fail
|
---|
126 | #patch -p1 -R < %{PATCH33}
|
---|
127 |
|
---|
128 | #LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
|
---|
129 | #export LD_LIBRARY_PATH
|
---|
130 | #make -C test apps tests
|
---|
131 | #%{__cc} -o openssl-thread-test \
|
---|
132 | # `krb5-config --cflags` \
|
---|
133 | # -I./include \
|
---|
134 | # $RPM_OPT_FLAGS \
|
---|
135 | # %{SOURCE8} \
|
---|
136 | # -L. \
|
---|
137 | # -lssl -lcrypto \
|
---|
138 | # `krb5-config --libs` \
|
---|
139 | # -lpthread -lz -ldl
|
---|
140 | #./openssl-thread-test --threads %{thread_test_threads}
|
---|
141 |
|
---|
142 | # Add generation of HMAC checksum of the final stripped library
|
---|
143 | #%define __spec_install_post \
|
---|
144 | # %{?__debug_package:%{__debug_install_post}} \
|
---|
145 | # %{__arch_install_post} \
|
---|
146 | # %{__os_install_post} \
|
---|
147 | # crypto/fips/fips_standalone_sha1 $RPM_BUILD_ROOT/%{_lib}/libcrypto.so.%{version} >$RPM_BUILD_ROOT/%{_lib}/.libcrypto.so.%{version}.hmac \
|
---|
148 | # ln -sf .libcrypto.so.%{version}.hmac $RPM_BUILD_ROOT/%{_lib}/.libcrypto.so.%{soversion}.hmac \
|
---|
149 | # crypto/fips/fips_standalone_sha1 $RPM_BUILD_ROOT%{_libdir}/libssl.so.%{version} >$RPM_BUILD_ROOT%{_libdir}/.libssl.so.%{version}.hmac \
|
---|
150 | # ln -sf .libssl.so.%{version}.hmac $RPM_BUILD_ROOT%{_libdir}/.libssl.so.%{soversion}.hmac \
|
---|
151 | #%{nil}
|
---|
152 |
|
---|
153 | %install
|
---|
154 | [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
---|
155 |
|
---|
156 | export MAKESHELL="/@unixroot/usr/bin/sh.exe"
|
---|
157 |
|
---|
158 | # Install OpenSSL.
|
---|
159 | install -d $RPM_BUILD_ROOT%{_bindir}
|
---|
160 | install -d $RPM_BUILD_ROOT%{_includedir}
|
---|
161 | install -d $RPM_BUILD_ROOT%{_libdir}
|
---|
162 | install -d $RPM_BUILD_ROOT%{_mandir}
|
---|
163 | install -d $RPM_BUILD_ROOT%{_libdir}/openssl
|
---|
164 | make INSTALL_PREFIX=$RPM_BUILD_ROOT install
|
---|
165 | make INSTALL_PREFIX=$RPM_BUILD_ROOT install_docs
|
---|
166 |
|
---|
167 | cp ssl_s.a $RPM_BUILD_ROOT%{_libdir}
|
---|
168 | cp ssl%{soversion}.dll $RPM_BUILD_ROOT%{_libdir}
|
---|
169 | cp crypto_s.a $RPM_BUILD_ROOT%{_libdir}
|
---|
170 | cp crypto%{soversion}.dll $RPM_BUILD_ROOT%{_libdir}
|
---|
171 |
|
---|
172 | mv $RPM_BUILD_ROOT%{_libdir}/engines $RPM_BUILD_ROOT%{_libdir}/openssl
|
---|
173 | mv $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/man/* $RPM_BUILD_ROOT%{_mandir}/
|
---|
174 | rmdir $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/man
|
---|
175 |
|
---|
176 | #rename so.%{soversion} so.%{version} $RPM_BUILD_ROOT%{_libdir}/*.so.%{soversion}
|
---|
177 | #mkdir $RPM_BUILD_ROOT/%{_lib}
|
---|
178 | #mv $RPM_BUILD_ROOT%{_libdir}/libcrypto.so.%{version} $RPM_BUILD_ROOT/%{_lib}
|
---|
179 | #for lib in $RPM_BUILD_ROOT%{_libdir}/*.so.%{version} ; do
|
---|
180 | # chmod 755 ${lib}
|
---|
181 | # ln -s -f `basename ${lib}` $RPM_BUILD_ROOT%{_libdir}/`basename ${lib} .%{version}`
|
---|
182 | # ln -s -f `basename ${lib}` $RPM_BUILD_ROOT%{_libdir}/`basename ${lib} .%{version}`.%{soversion}
|
---|
183 | #done
|
---|
184 | #for lib in $RPM_BUILD_ROOT/%{_lib}/*.so.%{version} ; do
|
---|
185 | # chmod 755 ${lib}
|
---|
186 | # ln -s -f ../../%{_lib}/`basename ${lib}` $RPM_BUILD_ROOT%{_libdir}/`basename ${lib} .%{version}`
|
---|
187 | # ln -s -f `basename ${lib}` $RPM_BUILD_ROOT/%{_lib}/`basename ${lib} .%{version}`.%{soversion}
|
---|
188 | #done
|
---|
189 |
|
---|
190 | # Install a makefile for generating keys and self-signed certs, and a script
|
---|
191 | # for generating them on the fly.
|
---|
192 | mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/certs
|
---|
193 | #install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/certs/Makefile
|
---|
194 | #install -m755 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/certs/make-dummy-cert
|
---|
195 |
|
---|
196 | # Make sure we actually include the headers we built against.
|
---|
197 | for header in $RPM_BUILD_ROOT%{_includedir}/openssl/* ; do
|
---|
198 | if [ -f ${header} -a -f include/openssl/$(basename ${header}) ] ; then
|
---|
199 | install -m644 include/openssl/`basename ${header}` ${header}
|
---|
200 | fi
|
---|
201 | done
|
---|
202 |
|
---|
203 | # Rename man pages so that they don't conflict with other system man pages.
|
---|
204 | #pushd $RPM_BUILD_ROOT%{_mandir}
|
---|
205 | for manpage in $RPM_BUILD_ROOT%{_mandir}/man*/* ; do
|
---|
206 | if [ -L ${manpage} ]; then
|
---|
207 | TARGET=`ls -l ${manpage} | awk '{ print $NF }'`
|
---|
208 | ln -snf ${TARGET}ssl ${manpage}ssl
|
---|
209 | rm -f ${manpage}
|
---|
210 | else
|
---|
211 | mv ${manpage} ${manpage}ssl
|
---|
212 | fi
|
---|
213 | done
|
---|
214 | #for conflict in passwd rand ; do
|
---|
215 | # rename ${conflict} ssl${conflict} man*/${conflict}*
|
---|
216 | #done
|
---|
217 | #popd
|
---|
218 |
|
---|
219 | # Pick a CA script.
|
---|
220 | #pushd $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/misc
|
---|
221 | mv $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/misc/CA.sh $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/misc/CA
|
---|
222 | #popd
|
---|
223 |
|
---|
224 | mkdir -m755 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA
|
---|
225 | mkdir -m700 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA/private
|
---|
226 | mkdir -m755 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA/certs
|
---|
227 | mkdir -m755 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA/crl
|
---|
228 | mkdir -m755 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA/newcerts
|
---|
229 |
|
---|
230 | # Ensure the openssl.cnf timestamp is identical across builds to avoid
|
---|
231 | # mulitlib conflicts and unnecessary renames on upgrade
|
---|
232 | #touch -r %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/openssl.cnf
|
---|
233 |
|
---|
234 | # Determine which arch opensslconf.h is going to try to #include.
|
---|
235 | #basearch=i386
|
---|
236 | #%ifarch %{multilib_arches}
|
---|
237 | # Do an opensslconf.h switcheroo to avoid file conflicts on systems where you
|
---|
238 | # can have both a 32- and 64-bit version of the library, and they each need
|
---|
239 | # their own correct-but-different versions of opensslconf.h to be usable.
|
---|
240 | #install -m644 %{SOURCE10} \
|
---|
241 | # $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf-${basearch}.h
|
---|
242 | #cat $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf.h >> \
|
---|
243 | # $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf-${basearch}.h
|
---|
244 | #install -m644 %{SOURCE9} \
|
---|
245 | # $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf.h
|
---|
246 | #%endif
|
---|
247 |
|
---|
248 | # Remove unused files from upstream fips support
|
---|
249 | rm -rf $RPM_BUILD_ROOT/%{_bindir}/openssl_fips_fingerprint
|
---|
250 | rm -rf $RPM_BUILD_ROOT/%{_libdir}/fips_premain.*
|
---|
251 | rm -rf $RPM_BUILD_ROOT/%{_libdir}/fipscanister.*
|
---|
252 |
|
---|
253 | %clean
|
---|
254 | [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
---|
255 |
|
---|
256 | %files
|
---|
257 | %defattr(-,root,root)
|
---|
258 | %doc FAQ LICENSE CHANGES NEWS INSTALL README
|
---|
259 | %doc doc/c-indentation.el doc/openssl.txt
|
---|
260 | %doc doc/openssl_button.html doc/openssl_button.gif
|
---|
261 | %doc doc/ssleay.txt
|
---|
262 | #%doc README.FIPS
|
---|
263 | %dir %{_sysconfdir}/pki/tls
|
---|
264 | %dir %{_sysconfdir}/pki/tls/certs
|
---|
265 | #%{_sysconfdir}/pki/tls/certs/make-dummy-cert
|
---|
266 | #%{_sysconfdir}/pki/tls/certs/Makefile
|
---|
267 | %dir %{_sysconfdir}/pki/tls/misc
|
---|
268 | %{_sysconfdir}/pki/tls/misc/CA
|
---|
269 | %dir %{_sysconfdir}/pki/CA
|
---|
270 | %dir %{_sysconfdir}/pki/CA/private
|
---|
271 | %dir %{_sysconfdir}/pki/CA/certs
|
---|
272 | %dir %{_sysconfdir}/pki/CA/crl
|
---|
273 | %dir %{_sysconfdir}/pki/CA/newcerts
|
---|
274 | %{_sysconfdir}/pki/tls/misc/c_*
|
---|
275 | %{_sysconfdir}/pki/tls/private
|
---|
276 |
|
---|
277 | %config(noreplace) %{_sysconfdir}/pki/tls/openssl.cnf
|
---|
278 |
|
---|
279 | %attr(0755,root,root) %{_bindir}/openssl.exe
|
---|
280 | %attr(0755,root,root) %{_libdir}/crypto%{soversion}.dll
|
---|
281 | %attr(0755,root,root) %{_libdir}/ssl%{soversion}.dll
|
---|
282 | #%attr(0644,root,root) /%{_lib}/.libcrypto.so.*.hmac
|
---|
283 | #%attr(0644,root,root) %{_libdir}/.libssl.so.*.hmac
|
---|
284 | %attr(0755,root,root) %{_libdir}/openssl
|
---|
285 | %attr(0644,root,root) %{_mandir}/man1*/[ABD-Zabcd-z]*
|
---|
286 | %attr(0644,root,root) %{_mandir}/man5*/*
|
---|
287 | %attr(0644,root,root) %{_mandir}/man7*/*
|
---|
288 |
|
---|
289 | %files devel
|
---|
290 | %defattr(-,root,root)
|
---|
291 | %{_prefix}/include/openssl
|
---|
292 | %attr(0755,root,root) %{_libdir}/*%{soversion}.dll
|
---|
293 | %attr(0755,root,root) %{_libdir}/lib*.a
|
---|
294 | %attr(0644,root,root) %{_mandir}/man3*/*
|
---|
295 | %attr(0644,root,root) %{_libdir}/pkgconfig/*.pc
|
---|
296 |
|
---|
297 | %files static
|
---|
298 | %defattr(-,root,root)
|
---|
299 | %attr(0644,root,root) %{_libdir}/*_s.a
|
---|
300 |
|
---|
301 | %files perl
|
---|
302 | %defattr(-,root,root)
|
---|
303 | %attr(0755,root,root) %{_bindir}/c_rehash
|
---|
304 | %attr(0644,root,root) %{_mandir}/man1*/*.pl*
|
---|
305 | %{_sysconfdir}/pki/tls/misc/*.pl
|
---|
306 | %{_sysconfdir}/pki/tls/misc/tsget
|
---|
307 |
|
---|
308 | #%post -p /sbin/ldconfig
|
---|
309 |
|
---|
310 | #%postun -p /sbin/ldconfig
|
---|
311 |
|
---|
312 | %changelog
|
---|
313 | * Mon Jan 16 2012 yd
|
---|
314 | - rebuild with libc 0.6.4 runtime.
|
---|