2007-01-16 00:21:52 +01:00
|
|
|
#
|
2011-10-02 20:44:43 +02:00
|
|
|
# spec file for package libgcrypt
|
2007-01-16 00:21:52 +01:00
|
|
|
#
|
2016-02-09 22:32:46 +01:00
|
|
|
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
2007-01-16 00:21:52 +01:00
|
|
|
#
|
2008-11-02 15:42:29 +01:00
|
|
|
# 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.
|
|
|
|
|
2007-01-16 00:21:52 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2013-07-25 11:26:56 +02:00
|
|
|
%define build_hmac256 1
|
|
|
|
%define separate_hmac256_binary 0
|
2014-01-03 20:05:34 +01:00
|
|
|
%define libsoname %{name}20
|
2016-08-18 09:41:25 +02:00
|
|
|
%define sosuffix 20.0.6
|
2014-09-22 22:11:21 +02:00
|
|
|
%define cavs_dir %{_libexecdir}/%{name}/cavs
|
2013-07-25 11:26:56 +02:00
|
|
|
Name: libgcrypt
|
2016-08-18 09:41:25 +02:00
|
|
|
Version: 1.6.6
|
2012-02-12 17:27:21 +01:00
|
|
|
Release: 0
|
2007-01-16 00:21:52 +01:00
|
|
|
Summary: The GNU Crypto Library
|
2013-03-22 10:31:45 +01:00
|
|
|
License: GPL-2.0+ and LGPL-2.1+ and GPL-3.0+
|
2007-01-16 00:21:52 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2014-04-03 14:08:53 +02:00
|
|
|
Url: http://directory.fsf.org/wiki/Libgcrypt
|
2013-03-19 10:04:38 +01:00
|
|
|
Source: ftp://ftp.gnupg.org/gcrypt/libgcrypt/%{name}-%{version}.tar.bz2
|
|
|
|
Source1: ftp://ftp.gnupg.org/gcrypt/libgcrypt/%{name}-%{version}.tar.bz2.sig
|
2010-01-14 15:27:35 +01:00
|
|
|
Source2: baselibs.conf
|
2013-03-19 10:04:38 +01:00
|
|
|
Source4: %{name}.keyring
|
2015-03-01 08:57:34 +01:00
|
|
|
# https://www.gnupg.org/signature_key.en.html
|
2014-09-02 19:36:56 +02:00
|
|
|
# cavs test framework
|
|
|
|
Source5: cavs-test.sh
|
|
|
|
Source6: cavs_driver.pl
|
2015-02-06 19:56:02 +01:00
|
|
|
Source99: %{name}.changes
|
2012-06-13 09:19:23 +02:00
|
|
|
Patch0: %{name}-ppc64.patch
|
|
|
|
Patch1: %{name}-strict-aliasing.patch
|
|
|
|
Patch3: %{name}-1.4.1-rijndael_no_strict_aliasing.patch
|
|
|
|
Patch4: %{name}-sparcv9.diff
|
2013-07-25 11:26:56 +02:00
|
|
|
#PATCH-FIX-UPSTREAM: bnc#701267, explicitly link with $(DL_LIBS)
|
|
|
|
#was: libgcrypt-1.5.0-as-needed.patch
|
|
|
|
Patch5: libgcrypt-unresolved-dladdr.patch
|
|
|
|
#PATCH-FIX-SUSE: N/A
|
|
|
|
Patch7: libgcrypt-1.5.0-LIBGCRYPT_FORCE_FIPS_MODE-env.diff
|
2014-03-31 09:35:35 +02:00
|
|
|
Patch12: libgcrypt-1.6.1-use-fipscheck.patch
|
|
|
|
Patch13: libgcrypt-1.6.1-fips-cavs.patch
|
|
|
|
#PATCH-FIX-SUSE: bnc#724841, fix a random device opening routine
|
|
|
|
Patch14: libgcrypt-1.6.1-fips-cfgrandom.patch
|
2014-05-07 17:00:08 +02:00
|
|
|
# add support for SP800-90A DRBG (fate#316929, bnc#856312)
|
2014-09-02 19:36:56 +02:00
|
|
|
Patch21: v9-0001-SP800-90A-Deterministic-Random-Bit-Generator.patch
|
2014-05-07 17:00:08 +02:00
|
|
|
Patch22: 0002-Compile-DRBG.patch
|
|
|
|
Patch23: 0003-Function-definitions-of-interfaces-for-random.c.patch
|
|
|
|
Patch24: 0004-Invoke-DRBG-from-common-libgcrypt-RNG-code.patch
|
|
|
|
Patch25: 0005-Function-definitions-for-gcry_control-callbacks.patch
|
|
|
|
Patch26: 0006-DRBG-specific-gcry_control-requests.patch
|
2014-09-02 19:36:56 +02:00
|
|
|
Patch27: v9-0007-User-interface-to-DRBG.patch
|
2014-05-27 20:06:59 +02:00
|
|
|
Patch28: libgcrypt-fix-rng.patch
|
|
|
|
Patch29: libgcrypt-init-at-elf-load-fips.patch
|
2014-09-22 22:11:21 +02:00
|
|
|
#PATCH-FIX-SUSE add FIPS CAVS test app for DRBG
|
2014-09-02 19:36:56 +02:00
|
|
|
Patch30: drbg_test.patch
|
2014-09-22 22:11:21 +02:00
|
|
|
#PATCH-FIX-SUSE bnc#894216 make DSA compliant with FIPS 186-4
|
|
|
|
Patch31: libgcrypt-fips-dsa.patch
|
|
|
|
#PATCH-FIX-SUSE run FIPS self-test from constructor
|
|
|
|
Patch32: libgcrypt-fips_run_selftest_at_constructor.patch
|
|
|
|
#PATCH-FIX-SUSE bnc#896202 make ECDSA compliant with FIPS 186-4
|
|
|
|
Patch33: libgcrypt-fips_ecdsa.patch
|
2015-06-24 09:39:00 +02:00
|
|
|
Patch34: libgcrypt-1.6.3-aliasing.patch
|
2015-03-01 08:57:34 +01:00
|
|
|
BuildRequires: automake >= 1.14
|
2016-05-16 16:41:28 +02:00
|
|
|
BuildRequires: fipscheck
|
2014-04-03 14:08:53 +02:00
|
|
|
BuildRequires: libgpg-error-devel >= 1.11
|
|
|
|
BuildRequires: libtool
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
%description
|
2013-03-19 10:04:38 +01:00
|
|
|
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.
|
2007-01-16 00:21:52 +01:00
|
|
|
|
2012-06-13 09:19:23 +02:00
|
|
|
%package -n %{libsoname}
|
2008-01-18 02:02:35 +01:00
|
|
|
Summary: The GNU Crypto Library
|
2013-02-03 08:04:40 +01:00
|
|
|
License: GPL-2.0+ and LGPL-2.1+
|
2008-01-18 02:02:35 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
|
2012-06-13 09:19:23 +02:00
|
|
|
%description -n %{libsoname}
|
2008-01-18 02:02:35 +01:00
|
|
|
Libgcrypt is a general purpose crypto library based on the code used in
|
|
|
|
GnuPG (alpha version).
|
|
|
|
|
2014-08-13 15:20:08 +02:00
|
|
|
%package -n %{libsoname}-hmac
|
|
|
|
Summary: HMAC checksums for the GNU Crypto Library
|
|
|
|
License: GPL-2.0+ and LGPL-2.1+
|
|
|
|
Group: Development/Libraries/C and C++
|
2016-05-16 18:03:22 +02:00
|
|
|
Requires: %{libsoname} = %{version}-%{release}
|
2014-08-13 15:20:08 +02:00
|
|
|
|
|
|
|
%description -n %{libsoname}-hmac
|
|
|
|
Libgcrypt is a general purpose crypto library based on the code used in
|
|
|
|
GnuPG (alpha version). This package contains the HMAC checksum files
|
|
|
|
for integrity checking the library, as required by FIPS 140-2.
|
|
|
|
|
2007-01-16 00:21:52 +01:00
|
|
|
%package devel
|
|
|
|
Summary: The GNU Crypto Library
|
2013-02-03 08:04:40 +01:00
|
|
|
License: GFDL-1.1 and GPL-2.0+ and LGPL-2.1+ and MIT
|
2007-01-16 00:21:52 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2012-06-13 09:19:23 +02:00
|
|
|
Requires: %{libsoname} = %{version}
|
2012-03-23 12:47:53 +01:00
|
|
|
Requires: glibc-devel
|
2012-06-13 09:19:23 +02:00
|
|
|
Requires: libgpg-error-devel >= 1.8
|
2014-04-03 14:08:53 +02:00
|
|
|
Requires(post): %{install_info_prereq}
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
%description devel
|
2013-03-19 10:04:38 +01:00
|
|
|
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.
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
This package contains needed files to compile and link against the
|
|
|
|
library.
|
|
|
|
|
2014-09-02 19:36:56 +02:00
|
|
|
%package cavs
|
|
|
|
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: %{libsoname}-hmac
|
|
|
|
|
|
|
|
%description cavs
|
|
|
|
CAVS testing framework for libgcrypt
|
|
|
|
|
2013-07-25 11:26:56 +02:00
|
|
|
%if 0%{?separate_hmac256_binary}
|
|
|
|
%package hmac256
|
|
|
|
Summary: The GNU Crypto Library
|
|
|
|
License: GPL-2.0+ and LGPL-2.1+
|
|
|
|
Group: Development/Libraries/C and C++
|
2014-04-03 14:08:53 +02:00
|
|
|
Requires: %{libsoname} = %{version}
|
2013-07-25 11:26:56 +02:00
|
|
|
Requires: libgpg-error-devel
|
2014-04-03 14:08:53 +02:00
|
|
|
Requires(post): %{install_info_prereq}
|
2013-07-25 11:26:56 +02:00
|
|
|
|
|
|
|
%description hmac256
|
|
|
|
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.
|
|
|
|
|
|
|
|
%endif # #if separate_hmac256_binary
|
|
|
|
|
2007-01-16 00:21:52 +01:00
|
|
|
%prep
|
2014-04-03 14:08:53 +02:00
|
|
|
%setup -q
|
|
|
|
%patch0 -p1
|
2007-01-16 00:21:52 +01:00
|
|
|
%patch1
|
2008-11-17 17:16:05 +01:00
|
|
|
%patch3 -p1
|
2010-07-20 20:17:16 +02:00
|
|
|
%patch4 -p1
|
2013-07-25 11:26:56 +02:00
|
|
|
%patch5 -p1
|
|
|
|
%patch7 -p1
|
2014-03-31 09:35:35 +02:00
|
|
|
%patch12 -p1
|
2014-05-07 17:00:08 +02:00
|
|
|
%patch21 -p1
|
|
|
|
%patch22 -p1
|
|
|
|
%patch23 -p1
|
|
|
|
%patch24 -p1
|
|
|
|
%patch25 -p1
|
|
|
|
%patch26 -p1
|
|
|
|
%patch27 -p1
|
2014-05-27 20:06:59 +02:00
|
|
|
%patch28 -p1
|
|
|
|
%patch29 -p1
|
2014-09-02 19:36:56 +02:00
|
|
|
%patch30 -p1
|
2014-09-22 22:11:21 +02:00
|
|
|
%patch31 -p1
|
|
|
|
%patch32 -p1
|
|
|
|
%patch33 -p1
|
2015-06-24 09:39:00 +02:00
|
|
|
%patch34 -p1
|
2014-03-31 09:35:35 +02:00
|
|
|
%patch13 -p1
|
|
|
|
%patch14 -p1
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
%build
|
2013-07-25 11:26:56 +02:00
|
|
|
echo building with build_hmac256 set to %{build_hmac256}
|
2007-01-16 00:21:52 +01:00
|
|
|
%{?suse_update_config}
|
|
|
|
autoreconf -fi
|
2016-05-16 16:30:25 +02:00
|
|
|
date=$(date -u +%Y-%m-%dT%H:%M+0000 -r %{SOURCE99})
|
2015-02-06 19:56:02 +01:00
|
|
|
sed -e "s,BUILD_TIMESTAMP=.*,BUILD_TIMESTAMP=$date," -i configure
|
2014-04-03 14:08:53 +02:00
|
|
|
export CFLAGS="%{optflags} $(getconf LFS_CFLAGS)"
|
2012-02-12 17:27:21 +01:00
|
|
|
%configure --with-pic \
|
2014-04-03 14:08:53 +02:00
|
|
|
--enable-noexecstack \
|
|
|
|
--disable-static \
|
2014-01-30 14:30:05 +01:00
|
|
|
--enable-m-guard \
|
2014-04-03 14:08:53 +02:00
|
|
|
%ifarch %{sparc}
|
|
|
|
--disable-asm \
|
2010-01-14 15:27:35 +01:00
|
|
|
%endif
|
2014-01-30 14:30:05 +01:00
|
|
|
--enable-hmac-binary-check \
|
|
|
|
--enable-random=linux
|
2014-01-03 20:05:34 +01:00
|
|
|
make %{?_smp_mflags}
|
2008-01-18 02:02:35 +01:00
|
|
|
|
2013-07-25 11:26:56 +02:00
|
|
|
%if 0%{?build_hmac256}
|
|
|
|
# this is a hack that re-defines the __os_install_post macro
|
|
|
|
# for a simple reason: the macro strips the binaries and thereby
|
|
|
|
# invalidates a HMAC that may have been created earlier.
|
|
|
|
# solution: create the hashes _after_ the macro runs.
|
|
|
|
#
|
|
|
|
# this shows up earlier because otherwise the %expand of
|
|
|
|
# the macro is too late.
|
|
|
|
%{expand:%%global __os_install_post {%__os_install_post
|
2014-03-31 09:35:35 +02:00
|
|
|
fipshmac %{buildroot}/%{_bindir}/hmac256
|
|
|
|
fipshmac %{buildroot}/%{_libdir}/*.so.??
|
2013-07-25 11:26:56 +02:00
|
|
|
}}
|
|
|
|
%endif
|
|
|
|
|
2008-01-18 02:02:35 +01:00
|
|
|
%check
|
2014-03-31 09:35:35 +02:00
|
|
|
fipshmac src/.libs/libgcrypt.so.??
|
2007-01-16 00:21:52 +01:00
|
|
|
# Nice idea. however this uses /dev/random, which hangs
|
|
|
|
# on hardware without random feeds.
|
2013-07-25 11:26:56 +02:00
|
|
|
# so lets not run it inside OBS
|
|
|
|
# make check
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
%install
|
2014-04-03 14:08:53 +02:00
|
|
|
make DESTDIR=%{buildroot} install %{?_smp_mflags}
|
2012-06-13 09:19:23 +02:00
|
|
|
rm %{buildroot}%{_libdir}/%{name}.la
|
2014-09-22 22:11:21 +02:00
|
|
|
|
2014-09-02 19:36:56 +02:00
|
|
|
# cavs
|
2014-09-22 22:11:21 +02:00
|
|
|
install -m 0755 -d %{buildroot}%{cavs_dir}
|
|
|
|
install -m 0755 %{SOURCE5} %{buildroot}%{cavs_dir}
|
|
|
|
install -m 0755 %{SOURCE6} %{buildroot}%{cavs_dir}
|
|
|
|
|
|
|
|
mv %{buildroot}%{_bindir}/fips186_dsa %{buildroot}%{cavs_dir}
|
|
|
|
mv %{buildroot}%{_bindir}/fipsdrv %{buildroot}%{cavs_dir}
|
|
|
|
mv %{buildroot}%{_bindir}/drbg_test %{buildroot}%{cavs_dir}
|
2007-01-16 00:21:52 +01:00
|
|
|
|
2012-06-13 09:19:23 +02:00
|
|
|
%post -n %{libsoname} -p /sbin/ldconfig
|
2008-01-18 02:02:35 +01:00
|
|
|
|
2012-06-13 09:19:23 +02:00
|
|
|
%postun -n %{libsoname} -p /sbin/ldconfig
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
%post devel
|
|
|
|
%install_info --info-dir=%{_infodir} %{_infodir}/gcrypt.info.gz
|
|
|
|
|
2015-02-06 19:56:29 +01:00
|
|
|
%preun devel
|
2007-01-16 00:21:52 +01:00
|
|
|
%install_info_delete --info-dir=%{_infodir} %{_infodir}/gcrypt.info.gz
|
|
|
|
|
2012-06-13 09:19:23 +02:00
|
|
|
%files -n %{libsoname}
|
2007-01-16 00:21:52 +01:00
|
|
|
%defattr(-,root,root)
|
2014-04-03 14:08:53 +02:00
|
|
|
%doc COPYING.LIB
|
2014-01-03 20:05:34 +01:00
|
|
|
%{_libdir}/%{name}.so.*
|
2014-08-13 15:20:08 +02:00
|
|
|
|
|
|
|
%files -n %{libsoname}-hmac
|
|
|
|
%defattr(-,root,root)
|
2013-07-25 11:26:56 +02:00
|
|
|
%if 0%{?build_hmac256}
|
2014-01-03 20:05:34 +01:00
|
|
|
%{_libdir}/.libgcrypt.so.*.hmac
|
2014-04-03 14:08:53 +02:00
|
|
|
%endif # %if 0%{?build_hmac256}
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
2014-04-03 14:08:53 +02:00
|
|
|
%doc AUTHORS COPYING COPYING.LIB ChangeLog NEWS README THANKS TODO
|
2014-01-03 20:05:34 +01:00
|
|
|
%{_infodir}/gcrypt.info.gz
|
|
|
|
%{_bindir}/dumpsexp
|
|
|
|
%{_bindir}/mpicalc
|
|
|
|
%{_bindir}/%{name}-config
|
|
|
|
%{_libdir}/%{name}.so
|
|
|
|
%{_includedir}/gcrypt*.h
|
|
|
|
%{_datadir}/aclocal/%{name}.m4
|
2014-01-03 20:05:08 +01:00
|
|
|
|
2014-01-03 20:05:34 +01:00
|
|
|
%if 0%{?separate_hmac256_binary}
|
2013-07-25 11:26:56 +02:00
|
|
|
%files hmac256
|
|
|
|
%defattr(-,root,root)
|
2014-04-03 14:08:53 +02:00
|
|
|
%endif # %if 0%{?separate_hmac256_binary}
|
2013-07-25 11:26:56 +02:00
|
|
|
%{_bindir}/hmac256
|
|
|
|
%{_bindir}/.hmac256.hmac
|
2014-01-03 20:05:34 +01:00
|
|
|
%doc %{_mandir}/man1/hmac256.1*
|
2007-01-16 00:21:52 +01:00
|
|
|
|
2014-09-02 19:36:56 +02:00
|
|
|
%files cavs
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libexecdir}/%{name}
|
|
|
|
|
2007-09-13 18:48:03 +02:00
|
|
|
%changelog
|