File compat-openssl097g.spec of Package compat-openssl097g
#
# spec file for package compat-openssl097g
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: compat-openssl097g
BuildRequires: bc ed
%define ssletcdir %{_sysconfdir}/ssl
%define num_version %(echo "%{version}" | sed -e "s+[a-zA-Z]++g; s+_.*++g")
License: BSD3c(or similar)
Group: Productivity/Networking/Security
Provides: openssl:/usr/lib/libssl.so.0.9.7 openssl:/usr/lib64/libssl.so.0.9.7
# bug437293
%ifarch ppc64
Obsoletes: compat-openssl097g-64bit
%endif
#
Version: 0.9.7g
Release: 149
Summary: Secure Sockets and Transport Layer Security
Url: http://www.openssl.org/
Source: http://www.openssl.org/source/openssl-%{version}.tar.bz2
Source2: baselibs.conf
Source10: README.SuSE
Source20: ICP-Brasil.pem
Source21: Equifax-root1.pem
Patch0: openssl-0.9.6d.dif
Patch1: openssl-0.9.6d-flags-priority.dif
Patch2: openssl-no-libc.diff
Patch7: openssl-0.9.7f-ppc64.diff
Patch8: openssl-hppa-config.diff
Patch9: openssl-0.9.6g-alpha.diff
# http://www-124.ibm.com/developerworks/projects/libica/
Patch10: openssl-0.9.7d-ICA_engine-jun142004.patch.bz2
Patch101: openssl-0.9.7d-padlock-engine.diff
Patch102: openssl-0.9.7d-padlock-glue.diff
Patch103: openssl-0.9.7-SSLv2-rollback-CAN-2005-2969.dif
Patch104: openssl-0.9.8a-CVE-2006-4339-bug203595.dif
Patch105: openssl-0.9.7-CVE-2006-2940.patch
Patch106: openssl-CVE-2006-2937.patch
Patch107: openssl-CVE-2006-3738.patch
Patch108: openssl-CVE-2006-4343.patch
Patch109: openssl-0.9.7-CVE-2006-2940-fixup.patch
Patch110: openssl-CVE-2007-5135.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
The OpenSSL Project is a collaborative effort to develop a robust,
commercial-grade, full-featured, and Open Source toolkit implementing
the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS
v1) protocols with full-strength cryptography world-wide. The project
is managed by a worldwide community of volunteers that use the Internet
to communicate, plan, and develop the OpenSSL toolkit and its related
documentation.
Derivation and License
OpenSSL is based on the excellent SSLeay library developed from Eric A.
Young and Tim J. Hudson. The OpenSSL toolkit is licensed under a
Apache-style licence which basically means that you are free to get and
use it for commercial and non-commercial purposes.
%prep
%setup -q -n openssl-%version
%patch0 -p1
%patch1 -p1
%patch2
%patch7 -p1
%patch8
%patch9 -p1
%patch10 -p1
%patch101
%patch102
%patch103 -p0
%patch104 -p0
%patch105 -p0
%patch106 -p0
%patch107 -p0
%patch108 -p0
%patch109 -p0
%patch110 -p1
cp -p %{S:10} .
cp -p %{S:20} certs/
cp -p %{S:21} certs/
echo "adding/overwriting some entries in the 'table' hash in Configure"
# $dso_scheme:$shared_target:$shared_cflag:$shared_ldflag:$shared_extension:$ranlib
export DSO_SCHEME='dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)'
cat <<EOF_ED | ed -s Configure
/^);
-
i
# local configuration added from specfile
#config-string, $cc:$cflags:$unistd:$thread_cflag:$sys_id:$lflags:$bn_ops:$bn_obj:$des_obj:$bf_obj:$md5_obj:$sha1_obj:$cast_obj:$rc4_obj:$rmd160_obj:$rc5_obj:$DSO_SCHEME
#"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-elf", "gcc:-DL_ENDIAN ::-D_REENTRANT::-ldl:BN_LLONG \${x86_gcc_des} \${x86_gcc_opts}:\${x86_elf_asm}: $DSO_SCHEME",
"linux-ia64", "gcc:-DL_ENDIAN ::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:asm/ia64.o::::::::: $DSO_SCHEME",
"linux-ppc", "gcc:-DB_ENDIAN ::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:::::::::: $DSO_SCHEME",
"linux-ppc64", "gcc:-DB_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-ldl:RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL SIXTY_FOUR_BIT_LONG:::::::::: $DSO_SCHEME",
"linux-elf-arm","gcc:-DL_ENDIAN ::-D_REENTRANT::-ldl:BN_LLONG:::::::::: $DSO_SCHEME",
"linux-mips", "gcc:-DB_ENDIAN ::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:::::::::: $DSO_SCHEME",
"linux-sparcv7","gcc:-DB_ENDIAN ::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::: $DSO_SCHEME",
"linux-sparcv8","gcc:-DB_ENDIAN -DBN_DIV2W -mv8 ::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/sparcv8.o::::::::: $DSO_SCHEME",
"linux-x86_64", "gcc:-DL_ENDIAN -DNO_ASM ::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG:::::::::: $DSO_SCHEME",
"linux-s390", "gcc:-DB_ENDIAN ::(unknown): :-ldl:BN_LLONG:::::::::: $DSO_SCHEME",
"linux-s390x", "gcc:-DB_ENDIAN -DNO_ASM -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG:::::::::: $DSO_SCHEME",
"linux-parisc", "gcc:-DB_ENDIAN ::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR DES_PTR DES_UNROLL DES_RISC1:::::::::: $DSO_SCHEME",
.
wq
EOF_ED
%build
# change /usr/lib to /usr/lib64 if necessary
sed -e "s+\(\$(INSTALL_PREFIX)\$(INSTALLTOP)\)/lib+\1/%_lib+g" \
-e "s+libdir=\$\${exec_prefix}/lib+libdir=\$\${exec_prefix}/%_lib+g" \
Makefile.org > Makefile.new \
&& diff -u Makefile.org Makefile.new \
|| mv Makefile.new Makefile.org
./config --test-sanity
#
config_flags="threads shared no-rc5 no-idea \
--prefix=%{_prefix} \
--openssldir=%{ssletcdir} \
$RPM_OPT_FLAGS \
-fomit-frame-pointer \
-fno-strict-aliasing \
-DTERMIO \
-Wall"
#
%{!?do_profiling:%define do_profiling 0}
%if %do_profiling
# generate feedback
./config $config_flags
make depend CC="gcc %cflags_profile_generate"
make CC="gcc %cflags_profile_generate"
LD_LIBRARY_PATH=`pwd` make rehash CC="gcc %cflags_profile_generate"
LD_LIBRARY_PATH=`pwd` make test CC="gcc %cflags_profile_generate"
LD_LIBRARY_PATH=`pwd` apps/openssl speed
make clean
# compile with feedback
# but not if it makes a cipher slower:
find crypto/aes -name '*.da' | xargs -r rm
./config $config_flags %cflags_profile_feedback
make depend
make
LD_LIBRARY_PATH=`pwd` make rehash
LD_LIBRARY_PATH=`pwd` make test
%else
./config $config_flags
make depend
make
LD_LIBRARY_PATH=`pwd` make rehash
%ifnarch armv4l
LD_LIBRARY_PATH=`pwd` make test
%endif
%endif
# show settings
make TABLE
echo $RPM_OPT_FLAGS
eval $(egrep PLATFORM='[[:alnum:]]' Makefile)
grep -B1 -A22 "^\*\*\* $PLATFORM$" TABLE
%install
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
install -m 755 libssl.so.%{num_version} ${RPM_BUILD_ROOT}%{_libdir}/
install -m 755 libcrypto.so.%{num_version} ${RPM_BUILD_ROOT}%{_libdir}/
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-, root, root)
%doc CHANGE* INSTAL*
%doc LICENSE NEWS README README.SuSE
%{_libdir}/libssl.so.%{num_version}
%{_libdir}/libcrypto.so.%{num_version}
%changelog