SHA256
1
0
forked from pool/libgcrypt
libgcrypt/libgcrypt.spec

165 lines
5.0 KiB
RPMSpec
Raw Normal View History

#
# spec file for package libgcrypt
#
# Copyright (c) 2013 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: libgcrypt
%define libsoname %{name}11
Url: http://directory.fsf.org/wiki/Libgcrypt
Version: 1.5.1
Release: 0
Summary: The GNU Crypto Library
License: GPL-2.0+ and LGPL-2.1+
Group: Development/Libraries/C and C++
Source: ftp://ftp.gnupg.org/gcrypt/libgcrypt/%{name}-%{version}.tar.bz2
Source1: ftp://ftp.gnupg.org/gcrypt/libgcrypt/%{name}-%{version}.tar.bz2.sig
Source2: baselibs.conf
Source3: idea.c.gz
# http://www.gnupg.org/signature_key.en.html
Source4: %{name}.keyring
Patch0: %{name}-ppc64.patch
Patch1: %{name}-strict-aliasing.patch
Patch3: %{name}-1.4.1-rijndael_no_strict_aliasing.patch
Patch4: %{name}-sparcv9.diff
Patch5: %{name}-1.5.0-idea.patch
Patch6: %{name}-1.5.0-idea_codecleanup.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: automake >= 1.11
BuildRequires: libgpg-error-devel >= 1.8
BuildRequires: libtool
%if 0%{?suse_version} >= 1230
BuildRequires: gpg-offline
%endif
%description
Libgcrypt is a general purpose library of cryptographic building
blocks. It is originally based on code used by GnuPG. It does not
provide any implementation of OpenPGP or other protocols. Thorough
understanding of applied cryptography is required to use Libgcrypt.
%package -n %{libsoname}
Summary: The GNU Crypto Library
License: GPL-2.0+ and LGPL-2.1+
Group: Development/Libraries/C and C++
# bug437293
%ifarch ppc64
Obsoletes: %{name}-64bit
%endif
#
# libgcrypt last used in 10.3
Obsoletes: %{name} < %{version}
Provides: %{name} = %{version}
%description -n %{libsoname}
Libgcrypt is a general purpose crypto library based on the code used in
GnuPG (alpha version).
%package devel
Summary: The GNU Crypto Library
License: GFDL-1.1 and GPL-2.0+ and LGPL-2.1+ and MIT
Group: Development/Libraries/C and C++
Requires: %{libsoname} = %{version}
Requires: glibc-devel
Requires: libgpg-error-devel >= 1.8
# bug437293
%ifarch ppc64
Obsoletes: %{name}-devel-64bit
%endif
#
PreReq: %install_info_prereq
%description devel
Libgcrypt is a general purpose library of cryptographic building
blocks. It is originally based on code used by GnuPG. It does not
provide any implementation of OpenPGP or other protocols. Thorough
understanding of applied cryptography is required to use Libgcrypt.
This package contains needed files to compile and link against the
library.
%prep
%{?gpg_verify: %gpg_verify %{S:1}}
%setup -q -n %{name}-%{version}
gzip -dc < %{S:3} > cipher/idea.c
%patch0 -p1
%patch1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -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}
%check
# Nice idea. however this uses /dev/random, which hangs
# on hardware without random feeds.
#make check
%install
make DESTDIR=$RPM_BUILD_ROOT install
#
rm %{buildroot}%{_libdir}/%{name}.la
%post -n %{libsoname} -p /sbin/ldconfig
%postun -n %{libsoname} -p /sbin/ldconfig
%post devel
%install_info --info-dir=%{_infodir} %{_infodir}/gcrypt.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/gcrypt-1.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/gcrypt-2.info.gz
%postun devel
%install_info_delete --info-dir=%{_infodir} %{_infodir}/gcrypt.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/gcrypt-1.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/gcrypt-2.info.gz
%files -n %{libsoname}
%defattr(-,root,root)
%doc AUTHORS COPYING COPYING.LIB ChangeLog NEWS README THANKS TODO
%{_libdir}/%{name}.so.11*
%files devel
%defattr(-,root,root)
%_infodir/gcrypt.info.gz
%_infodir/gcrypt.info-1.gz
%_infodir/gcrypt.info-2.gz
%_bindir/dumpsexp
%_bindir/hmac256
%_bindir/%{name}-config
%_libdir/%{name}.so
%_includedir/gcrypt*.h
%_datadir/aclocal/%{name}.m4
%changelog