8
0
forked from pool/libcryptopp
Files
libcryptopp/libcryptopp.spec

109 lines
3.4 KiB
RPMSpec
Raw Normal View History

#
# 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 4
Name: libcryptopp
# When updating, remember to update cryptopp.pc and baselibs.conf as well.
Version: %{major}.%{minor}.%{patch}
Release: 0
%define pkg_version %{major}%{minor}%{patch}
# There is no upstream interface version information.
# Therefore we need unique basenames:
%define soname %{major}_%{minor}
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%{pkg_version}.zip
Source1: baselibs.conf
Source2: cryptopp.pc
# 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
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.
%package -n %{name}%{soname}
Summary: Cryptographic Library for C++
Group: System/Libraries
%description -n %{name}%{soname}
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}%{soname} = %{version}
%description -n %{name}-devel
The Crypto++ library is a C++ class library of cryptographic schemes.
%prep
%setup -q -c "%{name}-%{version}"
%patch1 -p1
%patch4 -p1
#mv config.recommend config.h
%build
make %{?_smp_mflags} \
CXXFLAGS="-DNDEBUG %{optflags} -fPIC" \
CXX="g++" \
all
%install
make \
DESTDIR=%{buildroot} \
PREFIX="%{_prefix}" \
LIBDIR="%{_libdir}" \
LIBSUFFIX="-%{version}" \
install
rm -rf "%{buildroot}%{_bindir}" %{buildroot}%{_datadir}/cryptopp
mkdir %{buildroot}%{_libdir}/pkgconfig/
cp %{SOURCE2} %{buildroot}%{_libdir}/pkgconfig/
%check
LD_LIBRARY_PATH=%{buildroot}%{_libdir} make test
%post -n %{name}%{soname} -p /sbin/ldconfig
%postun -n %{name}%{soname} -p /sbin/ldconfig
%files -n %{name}%{soname}
%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