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

Last change on this file since 1330 was 1042, checked in by Silvan Scherrer, 9 years ago

spec: openssl: Release version 1.0.2k-1.

File size: 13.1 KB
Line 
1# Note: this .spec is borrowed from:
2# http://pkgs.fedoraproject.org/cgit/rpms/openssl.git/tree/openssl.spec
3
4# For the curious:
5# 0.9.5a soversion = 0
6# 0.9.6 soversion = 1
7# 0.9.6a soversion = 2
8# 0.9.6c soversion = 3
9# 0.9.7a soversion = 4
10# 0.9.7ef soversion = 5
11# 0.9.8ab soversion = 6
12# 0.9.8g soversion = 7
13# 0.9.8jk + EAP-FAST soversion = 8
14# 1.0.0 soversion = 10
15%define soversion 10
16
17# Number of threads to spawn when testing some threading fixes.
18%define thread_test_threads %{?threads:%{threads}}%{!?threads:1}
19
20# Arches on which we need to prevent arch conflicts on opensslconf.h, must
21# also be handled in opensslconf-new.h.
22%define multilib_arches %{ix86} ia64 %{mips} ppc %{power64} s390 s390x sparcv9 sparc64 x86_64
23
24%global _performance_build 1
25
26Summary: A general purpose cryptography library with TLS implementation
27Name: openssl
28Version: 1.0.2k
29Release: 1%{?dist}
30
31License: OpenSSL
32Group: System Environment/Libraries
33URL: http://www.openssl.org/
34
35BuildRoot: %{_tmppath}/%{name}-%{version}-root
36BuildRequires: coreutils, perl, sed, zlib-devel, diffutils
37BuildRequires: gcc, make, subversion, zip
38#BuildRequires: krb5-devel, perl-generators,
39#BuildRequires: lksctp-tools-devel
40#BuildRequires: /usr/bin/pod2man
41
42Requires: coreutils
43Requires: %{name}-libs = %{version}-%{release}
44
45%scm_source svn http://svn.netlabs.org/repos/ports/openssl/trunk 2112
46
47%description
48The OpenSSL toolkit provides support for secure communications between
49machines. OpenSSL includes a certificate management tool and shared
50libraries which provide various cryptographic algorithms and
51protocols.
52
53%package libs
54Summary: A general purpose cryptography library with TLS implementation
55Group: System Environment/Libraries
56Requires: ca-certificates >= 2008-5
57#Requires: crypto-policies
58# Needed requires due to the base/lib subpackage split
59Requires: %{name} = %{version}-%{release}
60Provides: openssl-fips = %{version}-%{release}
61
62%description libs
63OpenSSL is a toolkit for supporting cryptography. The openssl-libs
64package contains the libraries that are used by various applications which
65support cryptographic algorithms and protocols.
66
67%package devel
68Summary: Files for development of applications which will use OpenSSL
69Group: Development/Libraries
70Requires: %{name}-libs = %{version}-%{release}
71Requires: zlib-devel
72#Requires: krb5-devel
73Requires: pkgconfig
74
75%description devel
76OpenSSL is a toolkit for supporting cryptography. The openssl-devel
77package contains include files needed to develop applications which
78support various cryptographic algorithms and protocols.
79
80%package static
81Summary: Libraries for static linking of applications which will use OpenSSL
82Group: Development/Libraries
83Requires: %{name}-devel = %{version}-%{release}
84
85%description static
86OpenSSL is a toolkit for supporting cryptography. The openssl-static
87package contains static libraries needed for static linking of
88applications which support various cryptographic algorithms and
89protocols.
90
91%package perl
92Summary: Perl scripts provided with OpenSSL
93Group: Applications/Internet
94Requires: perl
95Requires: %{name} = %{version}-%{release}
96
97%description perl
98OpenSSL is a toolkit for supporting cryptography. The openssl-perl
99package provides Perl scripts for converting certificates and keys
100from other formats to the formats used by the OpenSSL toolkit.
101
102%debug_package
103
104%prep
105%scm_setup
106
107sed -i 's/SHLIB_VERSION_NUMBER "1.0.0"/SHLIB_VERSION_NUMBER "%{version}"/' crypto/opensslv.h
108
109# Modify the various perl scripts to reference perl in the right location.
110%{__perl} util/perlpath.pl `dirname %{__perl}`
111
112# Generate a table with the compile settings for my perusal.
113# This part is not really necessary, as it gains nothing
114#touch Makefile
115#make TABLE PERL=%{__perl}
116
117%build
118# Figure out which flags we want to use.
119# default
120sslarch=OS2-KNIX
121
122# Configure the build tree. Override OpenSSL defaults with known-good defaults
123# usable on all platforms. The Configure script already knows to use -fPIC and
124# RPM_OPT_FLAGS, so we can skip specifiying them here.
125
126export CFLAGS="${CFLAGS:-%optflags}"
127export VENDOR="%{vendor}"
128export PERL="%{__perl}"
129
130./Configure \
131 --prefix=%{_prefix} --openssldir=%{_sysconfdir}/pki/tls ${sslflags} \
132 zlib enable-camellia enable-seed enable-tlsext enable-rfc3779 \
133 enable-cms enable-md2 enable-rc5 experimental-jpake \
134 no-mdc2 no-ec2m no-gost no-srp \
135 shared ${sslarch}
136
137# Original Fedora's openssl-1.0.2h flags:
138# --prefix=%{_prefix} --openssldir=%{_sysconfdir}/pki/tls ${sslflags} \
139# --system-ciphers-file=%{_sysconfdir}/crypto-policies/back-ends/openssl.config \
140# zlib sctp enable-camellia enable-seed enable-tlsext enable-rfc3779 \
141# enable-cms enable-md2 enable-rc5 \
142# no-mdc2 no-ec2m no-gost no-srp \
143# --with-krb5-flavor=MIT --enginesdir=%{_libdir}/openssl/engines \
144# --with-krb5-dir=/usr shared ${sslarch} %{?!nofips:fips}
145
146# Add -Wa,--noexecstack here so that libcrypto's assembler modules will be
147# marked as not requiring an executable stack.
148# Also add -DPURIFY to make using valgrind with openssl easier as we do not
149# want to depend on the uninitialized memory as a source of entropy anyway.
150#RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wa,--noexecstack -DPURIFY"
151make depend
152make all
153
154# Generate hashes for the included certs.
155make rehash
156
157# Clean up the .pc files
158for i in libcrypto.pc libssl.pc openssl.pc ; do
159 sed -i '/^Libs.private:/{s/-L[^ ]* //;s/-Wl[^ ]* //}' $i
160done
161
162%check
163# Verify that what was compiled actually works.
164
165#OPENSSL_ENABLE_MD5_VERIFY=
166#export OPENSSL_ENABLE_MD5_VERIFY
167# this need to be set, as else it might use a already loaded one
168#export LIBPATHSTRICT=T
169#export BEGINLIBPATH=%{_builddir}/%{buildsubdir}
170# tests are still disabled, as one is still falling
171#make -C test apps tests
172#%{__cc} -o openssl-thread-test \
173# `krb5-config --cflags` \
174# -I./include \
175# $RPM_OPT_FLAGS \
176# %{SOURCE8} \
177# -L. \
178# -lssl -lcrypto \
179# `krb5-config --libs` \
180# -lpthread -lz -ldl
181#./openssl-thread-test --threads %{thread_test_threads}
182
183# Add generation of HMAC checksum of the final stripped library
184#%define __spec_install_post \
185# %{?__debug_package:%{__debug_install_post}} \
186# %{__arch_install_post} \
187# %{__os_install_post} \
188# crypto/fips/fips_standalone_sha1 $RPM_BUILD_ROOT/%{_lib}/libcrypto.so.%{version} >$RPM_BUILD_ROOT/%{_lib}/.libcrypto.so.%{version}.hmac \
189# ln -sf .libcrypto.so.%{version}.hmac $RPM_BUILD_ROOT/%{_lib}/.libcrypto.so.%{soversion}.hmac \
190# crypto/fips/fips_standalone_sha1 $RPM_BUILD_ROOT%{_libdir}/libssl.so.%{version} >$RPM_BUILD_ROOT%{_libdir}/.libssl.so.%{version}.hmac \
191# ln -sf .libssl.so.%{version}.hmac $RPM_BUILD_ROOT%{_libdir}/.libssl.so.%{soversion}.hmac \
192#%{nil}
193
194%define __provides_exclude_from %{_libdir}/openssl
195
196%install
197[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
198
199# Install OpenSSL.
200install -d $RPM_BUILD_ROOT%{_bindir}
201install -d $RPM_BUILD_ROOT%{_includedir}
202install -d $RPM_BUILD_ROOT%{_libdir}
203install -d $RPM_BUILD_ROOT%{_mandir}
204install -d $RPM_BUILD_ROOT%{_libdir}/openssl
205make INSTALL_PREFIX=$RPM_BUILD_ROOT install
206# already done in install above
207# make INSTALL_PREFIX=$RPM_BUILD_ROOT install_docs
208
209cp ssl_s.a $RPM_BUILD_ROOT%{_libdir}
210cp ssl%{soversion}.dll $RPM_BUILD_ROOT%{_libdir}
211cp crypto_s.a $RPM_BUILD_ROOT%{_libdir}
212cp crypto%{soversion}.dll $RPM_BUILD_ROOT%{_libdir}
213
214# Remove duplicate DLLs with lib* prefix (todo: fix it in Makefiles)
215rm -f $RPM_BUILD_ROOT%{_libdir}/lib*%{soversion}.dll
216
217mv $RPM_BUILD_ROOT%{_libdir}/engines $RPM_BUILD_ROOT%{_libdir}/openssl
218mv $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/man/* $RPM_BUILD_ROOT%{_mandir}/
219rmdir $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/man
220
221#rename so.%{soversion} so.%{version} $RPM_BUILD_ROOT%{_libdir}/*.so.%{soversion}
222#mkdir $RPM_BUILD_ROOT/%{_lib}
223#for lib in $RPM_BUILD_ROOT%{_libdir}/*.so.%{version} ; do
224# chmod 755 ${lib}
225# ln -s -f `basename ${lib}` $RPM_BUILD_ROOT%{_libdir}/`basename ${lib} .%{version}`
226# ln -s -f `basename ${lib}` $RPM_BUILD_ROOT%{_libdir}/`basename ${lib} .%{version}`.%{soversion}
227#done
228
229# Install a makefile for generating keys and self-signed certs, and a script
230# for generating them on the fly.
231mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/certs
232#install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/certs/Makefile
233#install -m755 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/certs/make-dummy-cert
234
235# Make sure we actually include the headers we built against.
236for header in $RPM_BUILD_ROOT%{_includedir}/openssl/* ; do
237 if [ -f ${header} -a -f include/openssl/$(basename ${header}) ] ; then
238 install -m644 include/openssl/`basename ${header}` ${header}
239 fi
240done
241
242# Rename man pages so that they don't conflict with other system man pages.
243#pushd $RPM_BUILD_ROOT%{_mandir}
244pwd_save=`pwd`
245cd $RPM_BUILD_ROOT%{_mandir}
246ln -s -f config.5 man5/openssl.cnf.5
247for manpage in man*/* ; do
248 if [ -L ${manpage} ]; then
249 TARGET=`ls -l ${manpage} | awk '{ print $NF }'`
250 ln -snf ${TARGET}ssl ${manpage}ssl
251 rm -f ${manpage}
252 else
253 mv ${manpage} ${manpage}ssl
254 fi
255done
256#for conflict in passwd rand ; do
257# rename ${conflict} ssl${conflict} man*/${conflict}*
258#done
259#popd
260cd $pwd_save
261
262# Pick a CA script.
263#pushd $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/misc
264mv $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/misc/CA.sh $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/misc/CA
265#popd
266
267mkdir -m755 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA
268mkdir -m700 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA/private
269mkdir -m755 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA/certs
270mkdir -m755 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA/crl
271mkdir -m755 $RPM_BUILD_ROOT%{_sysconfdir}/pki/CA/newcerts
272
273# Ensure the openssl.cnf timestamp is identical across builds to avoid
274# mulitlib conflicts and unnecessary renames on upgrade
275#touch -r %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/openssl.cnf
276
277# Determine which arch opensslconf.h is going to try to #include.
278#basearch=i386
279#%ifarch %{multilib_arches}
280# Do an opensslconf.h switcheroo to avoid file conflicts on systems where you
281# can have both a 32- and 64-bit version of the library, and they each need
282# their own correct-but-different versions of opensslconf.h to be usable.
283#install -m644 %{SOURCE10} \
284# $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf-${basearch}.h
285#cat $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf.h >> \
286# $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf-${basearch}.h
287#install -m644 %{SOURCE9} \
288# $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf.h
289#%endif
290
291# Remove unused files from upstream fips support
292rm -rf $RPM_BUILD_ROOT/%{_bindir}/openssl_fips_fingerprint
293rm -rf $RPM_BUILD_ROOT/%{_libdir}/fips_premain.*
294rm -rf $RPM_BUILD_ROOT/%{_libdir}/fipscanister.*
295
296%clean
297[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
298
299%files
300%defattr(-,root,root)
301%doc LICENSE
302%doc FAQ NEWS README
303#%doc README.FIPS
304#%{_sysconfdir}/pki/tls/certs/make-dummy-cert
305#%{_sysconfdir}/pki/tls/certs/renew-dummy-cert
306#%{_sysconfdir}/pki/tls/certs/Makefile
307%{_sysconfdir}/pki/tls/misc/CA
308%dir %{_sysconfdir}/pki/CA
309%dir %{_sysconfdir}/pki/CA/private
310%dir %{_sysconfdir}/pki/CA/certs
311%dir %{_sysconfdir}/pki/CA/crl
312%dir %{_sysconfdir}/pki/CA/newcerts
313%{_sysconfdir}/pki/tls/misc/c_*
314%attr(0755,root,root) %{_bindir}/openssl.exe
315%attr(0644,root,root) %{_mandir}/man1*/[ABD-Zabcd-z]*
316%attr(0644,root,root) %{_mandir}/man5*/*
317%attr(0644,root,root) %{_mandir}/man7*/*
318
319
320%files libs
321%defattr(-,root,root)
322%doc LICENSE
323%dir %{_sysconfdir}/pki/tls
324%dir %{_sysconfdir}/pki/tls/certs
325%dir %{_sysconfdir}/pki/tls/misc
326%dir %{_sysconfdir}/pki/tls/private
327%config(noreplace) %{_sysconfdir}/pki/tls/openssl.cnf
328%attr(0755,root,root) %{_libdir}/crypto%{soversion}.dll
329%attr(0755,root,root) %{_libdir}/ssl%{soversion}.dll
330#%attr(0644,root,root) %{_libdir}/.libcrypto.so.*.hmac
331#%attr(0644,root,root) %{_libdir}/.libssl.so.*.hmac
332%attr(0755,root,root) %{_libdir}/openssl
333
334
335%files devel
336%defattr(-,root,root)
337%doc doc/c-indentation.el doc/openssl.txt CHANGES
338%{_prefix}/include/openssl
339%attr(0755,root,root) %{_libdir}/lib*.a
340%attr(0644,root,root) %{_mandir}/man3*/*
341%attr(0644,root,root) %{_libdir}/pkgconfig/*.pc
342
343
344%files static
345%defattr(-,root,root)
346%attr(0644,root,root) %{_libdir}/*_s.a
347
348%files perl
349%defattr(-,root,root)
350%attr(0755,root,root) %{_bindir}/c_rehash
351%attr(0644,root,root) %{_mandir}/man1*/*.pl*
352%{_sysconfdir}/pki/tls/misc/*.pl
353%{_sysconfdir}/pki/tls/misc/tsget
354
355%changelog
356* Wed Mar 01 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> 1.0.2k-1
357- Update to version 1.0.2k.
358- use new scm_ macros
359
360* Wed Oct 26 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> 1.0.2j-1
361- Update to version 1.0.2j.
362
363* Mon Jul 04 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> 1.0.2h-3
364- remove obsoletes tags from -libs
365- add a requires tag to -libs
366
367* Wed Jun 29 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> 1.0.2h-2
368- fix recursive symlink
369- added debug package
370
371* Wed Jun 29 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> 1.0.2h-1
372- Update to version 1.0.2h.
373
374* Fri Apr 3 2015 Dmitriy Kuminov <coding@dmik.org> 1.0.0r-1
375- Update to version 1.0.0r.
376- Enable new algorithms: idea, md2, mdc2, ec, jpake.
377- Rebuild with kLIBC 0.6.6 and GCC 4.9.2.
378
379* Tue Sep 2 2014 Dmitriy Kuminov <coding@dmik.org> 1.0.0n-1
380- Update to version 1.0.0n.
381- Move find.pl to SVN repository.
382- Remove DLLs from devel package.
383
384* Wed Dec 05 2012 yd
385- ca-certificates are required for proper ssl checks.
386- added File::Find wrapper for find.pl.
387
388* Mon Jan 16 2012 yd
389- rebuild with libc 0.6.4 runtime.
Note: See TracBrowser for help on using the repository browser.