#
# Conditional build:
-%bcond_without asm # disable x86 assembly code
%bcond_without tests # build without tests
-%define orig_ver 564
Summary: Cryptopp Library - a free C++ class library of cryptographic schemes
Summary(pl.UTF-8): Cryptopp - biblioteka klas C++ dostarczająca narzędzia do kryptografii
Name: cryptopp
-Version: 5.6.4
+Version: 5.6.5
+%define f_ver %(echo %{version} | tr -d .)
Release: 1
License: Boost v1.0 (BSD-like)
Group: Libraries
-Source0: http://downloads.sourceforge.net/cryptopp/%{name}%{orig_ver}.zip
-# Source0-md5: 4ee7e5cdd4a45a14756c169eaf2a77fc
+Source0: http://downloads.sourceforge.net/cryptopp/%{name}%{f_ver}.zip
+# Source0-md5: 839aa27c70fa70037185ae7be8d8d24d
Source1: %{name}.pc
-Patch0: %{name}-libdir.patch
+Patch0: %{name}-opt.patch
URL: http://www.cryptopp.com/
-BuildRequires: cmake >= 2.8.5
BuildRequires: libstdc++-devel
BuildRequires: unzip
Obsoletes: cryptopp-progs
%patch0 -p1
%build
-install -d build
-cd build
-%cmake .. \
- %{!?with_asm:-DDISABLE_ASM=ON}
-
-%{__make}
+CXXFLAGS="%{rpmcxxflags}" \
+%{__make} shared static %{?with_tests:cryptest.exe} \
+ CXX="%{__cxx}"
%if %{with tests}
-ctest -V
+%{__make} test
%endif
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} -C build install \
- DESTDIR=$RPM_BUILD_ROOT
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT \
+ PREFIX=%{_prefix} \
+ LIBDIR=%{_libdir}
install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
sed -e "
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
+%triggerpostun -- cryptopp < 5.6.5
+rm -f %{_libdir}/libcryptopp.so.5.6
+/sbin/ldconfig
+
%files
%defattr(644,root,root,755)
%doc License.txt Readme.txt
-%attr(755,root,root) %{_libdir}/libcryptopp.so.5.6
+%attr(755,root,root) %{_libdir}/libcryptopp.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libcryptopp.so.5.6
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libcryptopp.so
%{_includedir}/cryptopp
%{_pkgconfigdir}/cryptopp.pc
-%{_libdir}/cmake/cryptopp
%files static
%defattr(644,root,root,755)