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

Last change on this file since 1567 was 1525, checked in by Silvan Scherrer, 7 years ago

spec: openssl: Release version 1.0.2q-1.

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