diff --git a/cryptopp.pc b/cryptopp.pc new file mode 100644 index 0000000..1e6a73a --- /dev/null +++ b/cryptopp.pc @@ -0,0 +1,13 @@ +prefix=@PREFIX@ +exec_prefix=@PREFIX@ +libdir=@LIBDIR@ + +Name: Crypto++ +Description: A free C++ class library of cryptographic schemes +Version: @VERSION@ +URL: http://www.cryptopp.com +Requires: +Conflicts: +Libs: -lcryptopp +Libs.private: +Cflags: diff --git a/cryptopp.spec b/cryptopp.spec index 95c5243..c165575 100755 --- a/cryptopp.spec +++ b/cryptopp.spec @@ -1,87 +1,127 @@ -%global _version CRYPTOPP_8_2_0 -Name: cryptopp -Version: 8.2.0 -Release: 1 -Summary: Crypto++ Library is a free C++ class library of cryptographic schemes +%define _lto_cflags %{nil} -License: BSL-1.0 +Name: cryptopp +Version: 8.6.0 +Release: 1 +Summary: C++ class library of cryptographic schemes +License: Boost +URL: http://www.cryptopp.com/ +Source0: http://www.cryptopp.com/cryptopp860.zip +Source1: cryptopp.pc -URL: https://www.cryptopp.com/ -Source0: https://github.com/weidai11/cryptopp/archive/%{_version}.tar.gz +BuildRequires: doxygen +BuildRequires: gcc-c++ +# %ifarch i686 x86_64 +# BuildRequires: nasm +# %endif +BuildRequires: make + +# Obsoletes pycryptopp to avoid breaking upgrades +Obsoletes: pycryptopp < 0.7 +Provides: pycryptopp = 0.7 -BuildRequires: gcc make %description Crypto++ Library is a free C++ class library of cryptographic schemes. -The Crypto++ library was orginally written by Wei Dai. The library is now maintained by several team members and the community. -Currently the library contains algorithms like AES, RSA, MD5 etc.. +See http://www.cryptopp.com/ for a list of supported algorithms. + +One purpose of Crypto++ is to act as a repository of public domain +(not copyrighted) source code. Although the library is copyrighted as a +compilation, the individual files in it are in the public domain. %package devel -Summary: Development files for %{name} -Requires: %{name} = %{version}-%{release} +Summary: Header files and development documentation for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} %description devel -This package contains the header files and libraries for developing with %{name}. +Crypto++ Library is a free C++ class library of cryptographic schemes. + +This package contains the header files and development documentation +for %{name}. + +%package doc +Summary: Documentation for %{name} +BuildArch: noarch + +%description doc +Crypto++ Library is a free C++ class library of cryptographic schemes. + +This package contains documentation for %{name}. + +%package progs +Summary: Programs for manipulating %{name} routines +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description progs +Crypto++ Library is a free C++ class library of cryptographic schemes. + +This package contains programs for manipulating %{name} routines. %prep -%autosetup -n %{name}-%{_version} +%autosetup -c -p1 +perl -pi -e 's/\r$//g' License.txt Readme.txt + %build -%make_build +# %ifarch i686 x86_64 +# ./rdrand-nasm.sh +# %endif + +%{set_build_flags} +%make_build -f GNUmakefile \ + ZOPT='' \ + shared cryptest.exe + +doxygen %install -# doc -mkdir -p %{buildroot}%{_datadir}/%{name}-%{version}/TestData -mkdir -p %{buildroot}%{_datadir}/%{name}-%{version}/TestVectors -cp -a %{_builddir}/%{name}-%{_version}/TestData/*.dat %{buildroot}%{_datadir}/%{name}-%{version}/TestData -cp -a %{_builddir}/%{name}-%{_version}/TestVectors/*.txt %{buildroot}%{_datadir}/%{name}-%{version}/TestVectors +%make_install INSTALL="install -p -c " PREFIX="%{_prefix}" LIBDIR="%{_libdir}" -# lib file -mkdir -p %{buildroot}/%{_libdir} -cp -a %{_builddir}/%{name}-%{_version}/libcryptopp.a %{buildroot}%{_libdir}/libcryptopp-%{version}.a +# Install the pkg-config file +install -D -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_libdir}/pkgconfig/cryptopp.pc +# Fill in the variables +sed -i "s|@PREFIX@|%{_prefix}|g" $RPM_BUILD_ROOT%{_libdir}/pkgconfig/cryptopp.pc +sed -i "s|@LIBDIR@|%{_libdir}|g" $RPM_BUILD_ROOT%{_libdir}/pkgconfig/cryptopp.pc +sed -i "s|@VERSION@|%{version}}|g" $RPM_BUILD_ROOT%{_libdir}/pkgconfig/cryptopp.pc -# include file -mkdir -p %{buildroot}/%{_includedir}/%{name} -cp -a %{_builddir}/%{name}-%{_version}/*.h %{buildroot}/%{_includedir}/%{name} +mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/TestVectors +mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/TestData +install -m644 TestVectors/* $RPM_BUILD_ROOT%{_datadir}/%{name}/TestVectors +install -m644 TestData/* $RPM_BUILD_ROOT%{_datadir}/%{name}/TestData -# executable file -mkdir -p %{buildroot}/%{_bindir} -cp -a %{_builddir}/%{name}-%{_version}/cryptest.exe %{buildroot}%{_bindir} +# Rename cryptest +mv $RPM_BUILD_ROOT%{_bindir}/cryptest.exe \ + $RPM_BUILD_ROOT%{_bindir}/cryptest -%clean -rm -rf %{buildroot} +# Remove static lib +rm %{buildroot}%{_libdir}/libcryptopp.a + +%check +./cryptest.exe v + +%ldconfig_scriptlets %files -%defattr(0644,root,root,0644) -%doc History.txt Install.txt Readme.txt +%{_libdir}/libcryptopp.so.8* +%doc Readme.txt %license License.txt -%{_datadir}/%{name}-%{version}/TestData/*.dat -%{_datadir}/%{name}-%{version}/TestVectors/*.txt -%attr(0755,root,root) %{_bindir}/cryptest.exe %files devel -%defattr(0644,root,root,0644) -%{_libdir}/*.a -%{_includedir}/%{name}/*.h +%{_includedir}/cryptopp +%{_libdir}/libcryptopp.so +%{_libdir}/pkgconfig/cryptopp.pc -%post devel -ln -s %{_libdir}/libcryptopp-%{version}.a %{_libdir}/libcryptopp.a +%files doc +%license License.txt +%doc html-docs/* -%postun devel -if [ -h %{_libdir}/libcryptopp.a ]; then - rm -f %{_libdir}/libcryptopp.a -fi -if [ -d %{_includedir}/%{name} ]; then - rm -rf %{_includedir}/%{name} -fi - -%postun -if [ -d %{_datadir}/%{name}-%{version} ]; then - rm -rf %{_datadir}/%{name}-%{version} -fi +%files progs +%{_bindir}/cryptest +%{_datadir}/%{name} %changelog -* Thu Sep 10 2020 +* Fri Jul 29 2022 liweiganga - 8.6.0-1 +- update to 8.6.0 + +* Thu Sep 10 2020 liurenxu - 8.2.0-1 - Package init - - diff --git a/CRYPTOPP_8_2_0.tar.gz b/cryptopp860.zip similarity index 52% rename from CRYPTOPP_8_2_0.tar.gz rename to cryptopp860.zip index 7451ff3..f830d73 100644 Binary files a/CRYPTOPP_8_2_0.tar.gz and b/cryptopp860.zip differ