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

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

spec: openssl: Release version 1.0.2j-1.

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