File compat-libgcrypt.spec of Package compat-libgcrypt

#
# spec file for package compat-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 http://bugs.opensuse.org/
#


%define libname libgcrypt
%define libsoname %{libname}11
Name:           compat-%{libname}
Version:        1.5.4
Release:        0
Summary:        The GNU Crypto Library
License:        GPL-2.0+ ; LGPL-2.1+
Group:          Development/Libraries/C and C++
Url:            http://directory.fsf.org/wiki/Libgcrypt
Source:         %{libname}-%{version}.tar.bz2
Patch0:         %{libname}-ppc64.patch
Patch1:         %{libname}-strict-aliasing.patch
Patch3:         %{libname}-1.4.1-rijndael_no_strict_aliasing.patch
Patch4:         %{libname}-sparcv9.diff
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libgpg-error-devel >= 1.8
BuildRequires:  libtool
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

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

%package -n %{libsoname}
Summary:        The GNU Crypto Library
License:        GPL-2.0+ ; LGPL-2.1+
Group:          Development/Libraries/C and C++

%description -n %{libsoname}
Libgcrypt is a general purpose crypto library based on the code used in
GnuPG (alpha version).

%prep
%setup -q -n %{libname}-%{version}
%patch0 -p1
%patch1
%patch3 -p1
%patch4 -p1

%build
# define ciphers to build
ENABLE_CIPHER="arcfour blowfish cast5 des aes twofish serpent rfc2268 seed camellia idea"
ENABLE_PUBKEY="dsa elgamal rsa ecc"
ENABLE_DIGEST="crc md4 md5 rmd160 sha1 sha256 sha512 tiger whirlpool"
#
%{?suse_update_config}
autoreconf -fi
%configure --with-pic \
		--enable-noexecstack \
		--disable-static \
%ifarch %{sparc}
		--disable-asm \
%endif
		--enable-ciphers="$ENABLE_CIPHER" \
		--enable-pubkey-ciphers="$ENABLE_PUBKEY" \
		--enable-digests="$ENABLE_DIGEST"
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
#
rm -rf %{buildroot}%{_infodir}
rm -rf %{buildroot}%{_bindir}
rm -f %{buildroot}%{_libdir}/%{libname}.la
rm -f %{buildroot}%{_libdir}/%{libname}.so
rm -rf %{buildroot}%{_includedir}
rm -rf %{buildroot}%{_datadir}/aclocal

%post -n %{libsoname} -p /sbin/ldconfig

%postun -n %{libsoname} -p /sbin/ldconfig

%files -n %{libsoname}
%defattr(-,root,root)
%doc AUTHORS COPYING COPYING.LIB ChangeLog NEWS README THANKS TODO
%{_libdir}/%{libname}.so.11*

%changelog
openSUSE Build Service is sponsored by