File compat-libgcrypt11.spec of Package compat-libgcrypt11.3673

# spec file for package libgcrypt
# Copyright (c) 2014 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

# norootforbuild

Name:           compat-libgcrypt11
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  libgpg-error-devel >= 1.10
Version:        1.5.0
Release:        0.<RELEASE17>
Summary:        The GNU Crypto Library
License:        GPL-2.0+ and LGPL-2.1+
Group:          Development/Libraries/C and C++
AutoReqProv:    on
Source0:        libgcrypt-%version.tar.bz2
Source1:        libgcrypt-%version.tar.bz2.sig
Source2:        baselibs.conf
Source3:        compat-libgcrypt11-rpmlintrc
Patch0:         libgcrypt-ppc64.patch
Patch1:         libgcrypt-strict-aliasing.patch
#Patch2:        libgcrypt-1.4.4-mpicheck.patch
Patch3:         libgcrypt-1.4.1-rijndael_no_strict_aliasing.patch
Patch4:         libgcrypt-sparcv9.diff
Patch5:         libgcrypt-1.5.0-as-needed.patch
# PATCH-FIX-SUSE: bnc#712416 see comment#10 for details
Patch6:         libgcrypt-revert-caf44808.patch
Patch7:         libgcrypt-1.5.0-LIBGCRYPT_FORCE_FIPS_MODE-env.diff
Patch8:         libgcrypt-1.5.0-etc_gcrypt_rngseed-symlink.diff
# PATCH-FIX-UPSTREAM: bnc#831359
Patch9:         libgcrypt-CVE-2013-4242.patch
Patch10:        libgcrypt-CVE-2014-5270.patch
Patch11:        libgcrypt-CVE-2014-3591.patch
Patch12:        libgcrypt-CVE-2015-0837-1.patch
Patch13:        libgcrypt-CVE-2015-0837-2.patch
Patch14:        libgcrypt-CVE-2015-0837-3.patch
Patch15:        libgcrypt-CVE-2016-6313-1.patch
Patch16:        libgcrypt-CVE-2016-6313-2.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%ifnarch ia64 ppc64 s390 s390x
Requires:       haveged
%endif # ifnarch ... only x86_64 and i586 so far...
# bug437293
%ifarch ppc64
Obsoletes:      libgcrypt-64bit
# libgcrypt last used in 10.3
Obsoletes:      libgcrypt < %{version}
Provides:       libgcrypt = %{version}

Libgcrypt is a general purpose crypto library based on the code used in
GnuPG (alpha version).

%setup -q -n libgcrypt-%version
%patch0 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p0
%patch8 -p0
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1

# define ciphers to build
ENABLE_CIPHER="arcfour blowfish cast5 des aes twofish serpent rfc2268 seed camellia"
ENABLE_PUBKEY="dsa elgamal rsa ecc"
ENABLE_DIGEST="crc md4 md5 rmd160 sha1 sha256 sha512 tiger whirlpool"
autoreconf -fi
%configure --with-pic --libdir=/%{_lib} 		\
		--enable-noexecstack 			\
		--disable-static 			\
		--enable-m-guard			\
%ifarch %sparc
		--disable-asm 				\
		--enable-ciphers="$ENABLE_CIPHER" 	\
		--enable-digests="$ENABLE_DIGEST"	\
		--enable-random=linux			\
		--without-capabilities			\
%{__make} %{?_smp_mflags}

# Nice idea. however this uses /dev/random, which hangs
# on hardware without random feeds.
# make check

rm $RPM_BUILD_ROOT/%{_lib}/
mkdir -p $RPM_BUILD_ROOT%_libdir
%{__ln_s} -v /%{_lib}/$(readlink %{buildroot}/%{_lib}/ %{buildroot}%{_libdir}/
%{__rm} -v %{buildroot}/%{_lib}/

rm -rf $RPM_BUILD_ROOT/etc $RPM_BUILD_ROOT/usr/bin/* $RPM_BUILD_ROOT/usr/include $RPM_BUILD_ROOT/usr/share
rm -f ${RPM_BUILD_ROOT}/%{_libdir}/