2011-01-25 09:06:12 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package libcryptopp
|
|
|
|
|
#
|
2019-07-20 10:15:29 +00:00
|
|
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
2011-01-25 09:06:12 +00: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.
|
|
|
|
|
|
2018-11-24 06:19:05 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-01-25 09:06:12 +00:00
|
|
|
#
|
|
|
|
|
|
2012-03-18 18:07:05 +00:00
|
|
|
|
2019-07-20 10:15:29 +00:00
|
|
|
%define major 8
|
|
|
|
|
%define minor 2
|
2018-11-24 06:19:05 +00:00
|
|
|
%define patch 0
|
2017-03-06 06:12:40 +00:00
|
|
|
%define pkg_version %{major}%{minor}%{patch}
|
|
|
|
|
|
2011-01-25 09:06:12 +00:00
|
|
|
Name: libcryptopp
|
2017-03-05 15:27:36 +00:00
|
|
|
# WARNING: Execute "sh precheckin_baselibs.sh" to update baselibs.conf
|
|
|
|
|
# WARNING: uses source zip file name to create lib name.
|
2017-03-06 06:12:40 +00:00
|
|
|
Version: %{major}.%{minor}.%{patch}
|
2012-02-06 00:02:57 +00:00
|
|
|
Release: 0
|
|
|
|
|
# There is no upstream interface version information.
|
2017-03-05 15:27:36 +00:00
|
|
|
# Therefore we need unique basenames (see boo#1027192):
|
|
|
|
|
%define sover %{major}_%{minor}_%{patch}
|
2017-01-28 16:37:57 +00:00
|
|
|
Summary: Cryptographic library for C++
|
2013-03-01 18:39:52 +00:00
|
|
|
License: BSL-1.0
|
2011-01-25 09:06:12 +00:00
|
|
|
Group: Development/Libraries/C and C++
|
2012-02-06 00:02:57 +00:00
|
|
|
Url: http://www.cryptopp.com
|
2019-07-20 10:15:29 +00:00
|
|
|
Source: https://github.com/weidai11/cryptopp/archive/CRYPTOPP_%{major}_%{minor}_%{patch}.tar.gz
|
|
|
|
|
#http://www.cryptopp.com/cryptopp%%{major}%%{minor}%%{patch}.zip
|
2017-03-05 15:27:36 +00:00
|
|
|
Source1: precheckin_baselibs.sh
|
|
|
|
|
Source2: baselibs.conf
|
2012-10-16 07:24:00 +00:00
|
|
|
# PATCH-FEATURE-OPENSUSE libcryptopp-shared.patch -- improve shared library creation
|
2011-10-14 15:26:48 +00:00
|
|
|
Patch1: libcryptopp-shared.patch
|
2019-07-22 09:25:39 +00:00
|
|
|
# PATCH-UPSTREAM from git see https://github.com/weidai11/cryptopp/issues/865
|
2019-07-20 10:15:29 +00:00
|
|
|
Patch4: 0001-Fix-TCXXFLAGS-using-openSUSE-standard-flags-GH-865.patch
|
2019-07-20 10:25:45 +00:00
|
|
|
Patch5: 0001-Fix-missing-if-statement.patch
|
2011-10-14 15:26:48 +00:00
|
|
|
BuildRequires: gcc-c++
|
|
|
|
|
BuildRequires: pkg-config
|
2013-03-01 18:39:52 +00:00
|
|
|
BuildRequires: unzip
|
2011-01-25 09:06:12 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2010-08-09 22:30:27 +00:00
|
|
|
|
|
|
|
|
%description
|
2017-01-28 16:37:57 +00:00
|
|
|
The Crypto++ library is a C++ class library of cryptographic schemes.
|
2017-03-05 15:27:36 +00:00
|
|
|
Also contains:
|
|
|
|
|
pseudo random number generators (PRNG): ANSI X9.17 appendix C,
|
|
|
|
|
RandomPool, RDRAND, RDSEED, NIST Hash DRBG.
|
2010-08-09 22:30:27 +00:00
|
|
|
|
2017-03-05 15:27:36 +00:00
|
|
|
%package -n %{name}%{sover}
|
2011-01-25 09:06:12 +00:00
|
|
|
Summary: Cryptographic Library for C++
|
|
|
|
|
Group: System/Libraries
|
2017-03-05 15:27:36 +00:00
|
|
|
Obsoletes: %{name}%{major}_%{minor} = %{version}
|
2010-08-09 22:30:27 +00:00
|
|
|
|
2017-03-05 15:27:36 +00:00
|
|
|
%description -n %{name}%{sover}
|
2017-01-28 16:37:57 +00:00
|
|
|
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.
|
2010-08-09 22:30:27 +00:00
|
|
|
|
|
|
|
|
%package -n %{name}-devel
|
2017-01-28 16:37:57 +00:00
|
|
|
Summary: Development files for libcryptopp, a cryptographic library for C++
|
2011-01-25 09:06:12 +00:00
|
|
|
Group: Development/Libraries/C and C++
|
2017-03-05 15:27:36 +00:00
|
|
|
Requires: %{name}%{sover} = %{version}
|
2017-02-02 15:29:09 +00:00
|
|
|
Obsoletes: %{name}-devel-static
|
2010-08-09 22:30:27 +00:00
|
|
|
|
|
|
|
|
%description -n %{name}-devel
|
2017-03-05 15:27:36 +00:00
|
|
|
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.
|
|
|
|
|
|
2010-08-09 22:30:27 +00:00
|
|
|
|
|
|
|
|
%prep
|
2019-07-20 10:15:29 +00:00
|
|
|
%setup -q -n "cryptopp-CRYPTOPP_%{major}_%{minor}_%{patch}"
|
2019-07-20 11:16:42 +00:00
|
|
|
%patch1 -p1
|
|
|
|
|
%patch4 -p1
|
|
|
|
|
%patch5 -p1
|
2017-03-05 15:27:36 +00:00
|
|
|
echo %{major}.%{minor}.%{patch}
|
2017-03-06 06:12:40 +00:00
|
|
|
echo %{pkg_version}
|
2016-09-14 16:45:39 +00:00
|
|
|
#mv config.recommend config.h
|
2010-08-09 22:30:27 +00:00
|
|
|
|
|
|
|
|
%build
|
2018-11-24 06:19:05 +00:00
|
|
|
CXXFLAGS="-DNDEBUG %{optflags} -fpic -fPIC -pthread -fopenmp"
|
2019-07-23 12:52:28 +00:00
|
|
|
# aarch64 arm -march=armv7-a -mfpu=neon
|
|
|
|
|
#Isolate number of threads
|
|
|
|
|
%define tds %(rpm --eval %_smp_mflags|cut -b3)
|
|
|
|
|
echo %tds
|
2019-07-20 10:15:29 +00:00
|
|
|
%ifarch %{arm}
|
2019-07-23 12:52:28 +00:00
|
|
|
#optflags filter out -flt= flag
|
|
|
|
|
CXXFLAGS="`echo $CXXFLAGS|sed -- 's/-flto=%{tds}//'`"
|
2018-11-24 06:19:05 +00:00
|
|
|
%endif
|
|
|
|
|
%ifarch ppc64
|
|
|
|
|
CXXFLAGS="$CXXFLAGS -DCRYPTOPP_DISABLE_ALTIVEC"
|
|
|
|
|
%endif
|
2011-10-14 15:26:48 +00:00
|
|
|
make %{?_smp_mflags} \
|
2018-11-24 06:19:05 +00:00
|
|
|
CXXFLAGS="$CXXFLAGS" \
|
2017-03-05 15:27:36 +00:00
|
|
|
DESTDIR="" \
|
|
|
|
|
PREFIX="%{_prefix}" \
|
|
|
|
|
LIB="%{_lib}" \
|
2011-10-14 15:26:48 +00:00
|
|
|
CXX="g++" \
|
2017-03-05 15:27:36 +00:00
|
|
|
LIBSUFFIX="-%{version}" \
|
|
|
|
|
LDFLAGS="-pthread" \
|
|
|
|
|
all static
|
2010-08-09 22:30:27 +00:00
|
|
|
|
|
|
|
|
%install
|
2011-10-14 15:26:48 +00:00
|
|
|
make \
|
2012-10-16 07:24:00 +00:00
|
|
|
DESTDIR=%{buildroot} \
|
2010-08-09 22:30:27 +00:00
|
|
|
PREFIX="%{_prefix}" \
|
2017-03-05 15:27:36 +00:00
|
|
|
LIB="%{_lib}" \
|
2012-10-16 07:24:00 +00:00
|
|
|
LIBSUFFIX="-%{version}" \
|
2010-08-09 22:30:27 +00:00
|
|
|
install
|
2019-07-20 10:15:29 +00:00
|
|
|
|
2016-09-14 16:45:39 +00:00
|
|
|
rm -rf "%{buildroot}%{_bindir}" %{buildroot}%{_datadir}/cryptopp
|
2017-03-05 15:27:36 +00:00
|
|
|
rm -rf "%{buildroot}%{_bindir}"
|
2019-07-20 10:15:29 +00:00
|
|
|
rm -rf %{buildroot}%{_libdir}/*.a
|
2017-03-05 15:27:36 +00:00
|
|
|
# Install .pc file with correct version field.
|
2011-10-14 15:26:48 +00:00
|
|
|
mkdir %{buildroot}%{_libdir}/pkgconfig/
|
2017-03-05 15:27:36 +00:00
|
|
|
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
|
2010-08-09 22:30:27 +00:00
|
|
|
|
|
|
|
|
%check
|
2016-09-14 16:45:39 +00:00
|
|
|
LD_LIBRARY_PATH=%{buildroot}%{_libdir} make test
|
2010-08-09 22:30:27 +00:00
|
|
|
|
2017-03-05 15:27:36 +00:00
|
|
|
%post -n %{name}%{sover} -p /sbin/ldconfig
|
|
|
|
|
%postun -n %{name}%{sover} -p /sbin/ldconfig
|
2010-08-09 22:30:27 +00:00
|
|
|
|
2017-03-05 15:27:36 +00:00
|
|
|
%files -n %{name}%{sover}
|
2010-08-09 22:30:27 +00:00
|
|
|
%defattr(-,root,root)
|
2016-09-14 16:45:39 +00:00
|
|
|
%{_libdir}/libcryptopp.so.%{major}.*
|
2019-07-20 10:15:29 +00:00
|
|
|
%license License.txt
|
2010-08-09 22:30:27 +00:00
|
|
|
|
|
|
|
|
%files -n %{name}-devel
|
|
|
|
|
%defattr(-,root,root)
|
2019-07-20 10:15:29 +00:00
|
|
|
%doc Readme.txt
|
|
|
|
|
%license License.txt
|
2010-08-09 22:30:27 +00:00
|
|
|
%{_includedir}/cryptopp
|
|
|
|
|
%{_libdir}/libcryptopp.so
|
2011-10-14 15:26:48 +00:00
|
|
|
%{_libdir}/pkgconfig/cryptopp.pc
|
2011-07-11 08:35:56 +00:00
|
|
|
|
2011-01-25 09:06:12 +00:00
|
|
|
%changelog
|