source: spec/trunk/SPECS/openssl.spec@ 150

Last change on this file since 150 was 117, checked in by Yuri Dario, 15 years ago

spec: added dist tag to release build number.

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