File libcryptopp.spec of Package libcryptopp
#
# spec file for package libcryptopp
#
# Copyright (c) 2017 SUSE LINUX 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 major 5
%define minor 6
%define patch 5
%define pkg_version %{major}%{minor}%{patch}
Name: libcryptopp
# WARNING: Execute "sh precheckin_baselibs.sh" to update baselibs.conf
# WARNING: uses source zip file name to create lib name.
Version: %{major}.%{minor}.%{patch}
Release: lp150.1.10
# There is no upstream interface version information.
# Therefore we need unique basenames (see boo#1027192):
%define sover %{major}_%{minor}_%{patch}
Summary: Cryptographic library for C++
License: BSL-1.0
Group: Development/Libraries/C and C++
Url: http://www.cryptopp.com
Source: http://www.cryptopp.com/cryptopp%{major}%{minor}%{patch}.zip
Source1: precheckin_baselibs.sh
Source2: baselibs.conf
# PATCH-FEATURE-OPENSUSE libcryptopp-shared.patch -- improve shared library creation
Patch1: libcryptopp-shared.patch
# PATCH-BUILDFIX-OPENSUSE 0001-disable_os_rng_test.patch sfalken@opensuse.org -- disable OS Random Number Generator test
Patch4: 0001-disable_os_rng_test.patch
# PATCH-FIX-UPSTREAM reproducible.patch bmwiedemann https://github.com/weidai11/cryptopp
Patch5: reproducible.patch
BuildRequires: gcc-c++
BuildRequires: pkg-config
BuildRequires: unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
The Crypto++ library is a C++ class library of cryptographic schemes.
Also contains:
pseudo random number generators (PRNG): ANSI X9.17 appendix C,
RandomPool, RDRAND, RDSEED, NIST Hash DRBG.
%package -n %{name}%{sover}
Summary: Cryptographic Library for C++
Group: System/Libraries
Obsoletes: %{name}%{major}_%{minor} = %{version}
%description -n %{name}%{sover}
The Crypto++ library provides authenticated encryption, stream and
block ciphers, block cipher operation modes, message authentication
codes, hash functions, PKI crypto, key agreement schemes and elliptic
curve crypto.
%package -n %{name}-devel
Summary: Development files for libcryptopp, a cryptographic library for C++
Group: Development/Libraries/C and C++
Requires: %{name}%{sover} = %{version}
Obsoletes: %{name}-devel-static
%description -n %{name}-devel
The Crypto++ library provides authenticated encryption, stream and
block ciphers, block cipher operation modes, message authentication
codes, hash functions, PKI crypto, key agreement schemes and elliptic
curve crypto. This package is used for crypto++ development.
%prep
%setup -q -c "%{name}-%{version}"
%patch1 -p0
%patch4 -p1
%patch5 -p1
echo %{major}.%{minor}.%{patch}
echo %{pkg_version}
#mv config.recommend config.h
%build
make %{?_smp_mflags} \
CXXFLAGS="-DNDEBUG %{optflags} -fpic -fPIC -pthread -fopenmp" \
DESTDIR="" \
PREFIX="%{_prefix}" \
LIB="%{_lib}" \
CXX="g++" \
LIBSUFFIX="-%{version}" \
LDFLAGS="-pthread" \
all static
%install
make \
DESTDIR=%{buildroot} \
PREFIX="%{_prefix}" \
LIB="%{_lib}" \
LIBSUFFIX="-%{version}" \
install
rm -rf "%{buildroot}%{_bindir}" %{buildroot}%{_datadir}/cryptopp
rm -rf "%{buildroot}%{_bindir}"
rm %{buildroot}%{_libdir}/*.a
# Install .pc file with correct version field.
mkdir %{buildroot}%{_libdir}/pkgconfig/
echo "prefix=%{_prefix}" >%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
echo "exec_prefix=\${prefix}" >>%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
echo "lib=%{_lib}" >>%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
echo "libdir=\${exec_prefix}/\${lib}" >>%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
echo "includedir=\${prefix}/include" >>%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
echo "" >>%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
echo "Name: libcrypto++" >>%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
echo "Description: General purpose cryptographic shared library" >>%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
echo "URL: http://www.cryptopp.com" >>%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
echo "Version: %{version}" >>%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
echo "Requires:" >>%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
echo "Libs: -lcryptopp" >>%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
echo "Cflags:" >>%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
echo "" >>%{buildroot}%{_libdir}/pkgconfig/cryptopp.pc
%check
LD_LIBRARY_PATH=%{buildroot}%{_libdir} make test
%post -n %{name}%{sover} -p /sbin/ldconfig
%postun -n %{name}%{sover} -p /sbin/ldconfig
%files -n %{name}%{sover}
%defattr(-,root,root)
%{_libdir}/libcryptopp.so.%{major}.*
%files -n %{name}-devel
%defattr(-,root,root)
%doc License.txt Readme.txt
%{_includedir}/cryptopp
%{_libdir}/libcryptopp.so
%{_libdir}/pkgconfig/cryptopp.pc
%changelog
* Sat May 20 2017 bwiedemann@suse.com
- Add reproducible.patch to sort input files to make build fully reproducible
* Fri Mar 3 2017 davejplater@gmail.com
- Added patch field to soname due to library not following proper
API/ABI versioning to fix boo#1027192.
- Removed crypto.pc and generate it in the spec file to ensure
proper version and directories.
- Changed libcryptopp-shared.patch.
- Renamed library package and obsoleted old name.
- added precheckin_baselibs.sh and updated baselibs.conf
* Thu Feb 23 2017 adam@mizerski.pl
- update to 5.6.5
* Rebase libcryptopp-shared.patch
* Rebase 0001-disable_os_rng_test.patch
- enable openmp usage
* Thu Feb 2 2017 jengelh@inai.de
- Add obsoletes tag for dropped static lib
* Sat Jan 28 2017 jengelh@inai.de
- Remove libcryptoo-devel-static, this seems unused in Factory.
* Sat Jan 28 2017 jengelh@inai.de
- Update descriptions
* Mon Sep 12 2016 bwiedemann@suse.com
- Update to 5.6.4
* Use proper openSUSE-style library naming
* Drop upstream libcryptopp-s390.patch
* Drop upstream libcryptopp-m68k.patch
* Drop upstream libcryptopp-CVE-2015-2141.patch
* Drop upstream cryptopp-gcc6.patch
* Rebase libcryptopp-shared.patch
* Rebase 0001-disable_os_rng_test.patch
* Mon Jun 20 2016 i@marguerite.su
- add patch cryptopp-gcc6.patch
* fix boo#985143
* fix narrowing conversion from unsigned int to int inside {}
* Wed Jul 8 2015 bwiedemann@suse.com
- prevent timing attack to get secret key (bnc#936435, CVE-2015-2141)
add libcryptopp-CVE-2015-2141.patch
* Fri Aug 15 2014 sfalken@opensuse.org
- Added 0001-disable_os_rng_test.patch
Fixes buildfailure on openSUSE_Factory x86_64 within OBS environment,
due to OS supplied Random Number Generator taking too long to respond
* Thu Apr 3 2014 schwab@suse.de
- libcryptopp-m68k.patch: define IS_LITTLE_ENDIAN on m68k
* Wed Dec 18 2013 ro@suse.de
- define as big endian on s390/s390x (libcryptopp-s390.patch)
* Wed Aug 28 2013 dmueller@suse.com
- remove noninstallable 32bit -devel baselibs
* Fri Mar 1 2013 adam@mizerski.pl
- update to 5.6.2
- changed license to Boost Software License 1.0
- added SHA-3 (Keccak)
- updated DSA to FIPS 186-3 (see DSA2 class)
- fixed Blowfish minimum keylength to be 4 bytes (32 bits)
- fixed Salsa validation failure when compiling with GCC 4.6
- fixed infinite recursion when on x64, assembly disabled, and
no AESNI
- ported to MSVC 2012, GCC 4.7, Clang 3.2, Solaris Studio 12.3,
Intel C++ Compiler 13.0
- removed libcryptopp-gcc47.patch - fixed upstream
- rebased libcryptopp-shared.patch
- added devel-static subpackage
- updated license tag
* Sun Oct 14 2012 adam@mizerski.pl
- added baselibs.conf
- spec file improved
* Sat Mar 17 2012 dimstar@opensuse.org
- Add libcryptopp-gcc47.patch: Fix build with gcc 4.7.
* Sun Feb 5 2012 jengelh@medozas.de
- Proper shared library versioning
* Mon Oct 17 2011 jengelh@medozas.de
- Remove bogus Conflict against libcrypto++0 (cf. shlib guidelines)
* Fri Oct 14 2011 toddrme2178@gmail.com
- Added pkg-config file from fedora project
- Cleaned up spec file formatting
* Sun Jul 10 2011 meissner@suse.de
- add -lpthread for tests
* Thu Dec 16 2010 andreas.hanke@gmx-topmail.de
- Update to version 5.6.1:
- added support for AES-NI and CLMUL instruction sets in AES and
GMAC/GCM
- removed WAKE-CFB
- fixed several bugs in the SHA-256 x86/x64 assembly code:
* incorrect hash on non-SSE2 x86 machines on non-aligned input
* incorrect hash on x86 machines when input crosses 0x80000000
* incorrect hash on x64 when compiled with GCC with optimizations
enabled
- fixed bugs in AES x86 and x64 assembly causing crashes in some MSVC
build configurations
- switched to a public domain implementation of MARS
- ported to MSVC 2010, GCC 4.5.1, Sun Studio 12u1, C++Builder 2010,
Intel C++ Compiler 11.1
- renamed the MSVC DLL project to "cryptopp" for compatibility with
MSVC 2010
- Changes to library packaging:
- update the interface number because there were ABI changes, now
matching the Debian package
- introduce a conflict with the PackMan package
- ship License.txt and Readme.txt
- drop the static library
* Mon Aug 9 2010 pascal.bleser@opensuse.org
- initial package (5.6.0)