]>
Commit | Line | Data |
---|---|---|
72a0958d JR |
1 | # |
2 | # Conditional build: | |
638f962c JB |
3 | %bcond_without tests # testing |
4 | %bcond_with sse2 # SSE2 instructions | |
5 | ||
6 | %ifarch pentium4 %{x8664} x32 | |
7 | %define with_sse2 1 | |
8 | %endif | |
17888f8d | 9 | |
1e862315 | 10 | Summary: Cryptopp Library - a free C++ class library of cryptographic schemes |
6081e9d5 | 11 | Summary(pl.UTF-8): Cryptopp - biblioteka klas C++ dostarczająca narzędzia do kryptografii |
1e862315 | 12 | Name: cryptopp |
55a67086 | 13 | Version: 8.9.0 |
9c05bf68 | 14 | %define tag_ver %(echo %{version} | tr . _) |
e7868f1d JB |
15 | Release: 1 |
16 | License: Boost v1.0 (BSD-like) | |
1e862315 | 17 | Group: Libraries |
9c05bf68 JB |
18 | #Source0Download: https://github.com/weidai11/cryptopp/releases |
19 | Source0: https://github.com/weidai11/cryptopp/archive/CRYPTOPP_%{tag_ver}/%{name}-%{tag_ver}.tar.gz | |
55a67086 | 20 | # Source0-md5: 56f8ce6f2e052bd4b0129a04f38f2a0b |
dd9c76ee | 21 | Source1: %{name}.pc |
638f962c | 22 | URL: https://cryptopp.com/ |
1e862315 JB |
23 | BuildRequires: libstdc++-devel |
24 | BuildRequires: unzip | |
638f962c JB |
25 | %{?with_sse2:Requires: cpuinfo(sse2)} |
26 | Obsoletes: cryptopp-progs < 5.6 | |
ff61087a | 27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
28 | ||
29 | %description | |
30 | Cryptopp Library is a free C++ class library of cryptographic schemes. | |
31 | ||
92858504 | 32 | %description -l pl.UTF-8 |
4c7740b9 JB |
33 | Cryptopp jest biblioteką klas C++ dostarczającą narzędzia do |
34 | kryptografii. | |
ff61087a | 35 | |
36 | %package devel | |
1e862315 | 37 | Summary: Files for development of applications which will use Cryptopp |
e414df15 | 38 | Summary(pl.UTF-8): Pliki do tworzenia aplikacji używających Cryptopp |
1e862315 JB |
39 | Group: Development/Libraries |
40 | Requires: %{name} = %{version}-%{release} | |
ff61087a | 41 | |
42 | %description devel | |
1e862315 | 43 | Files for development of applications which will use Cryptopp. |
ff61087a | 44 | |
92858504 JR |
45 | %description devel -l pl.UTF-8 |
46 | Pliki do tworzenia aplikacji używających Cryptopp. | |
ff61087a | 47 | |
1e862315 JB |
48 | %package static |
49 | Summary: Static Cryptopp library | |
e414df15 | 50 | Summary(pl.UTF-8): Statyczna biblioteka Cryptopp |
1e862315 JB |
51 | Group: Development/Libraries |
52 | Requires: %{name}-devel = %{version}-%{release} | |
ff61087a | 53 | |
1e862315 JB |
54 | %description static |
55 | Static Cryptopp library. | |
ff61087a | 56 | |
92858504 | 57 | %description static -l pl.UTF-8 |
1e862315 | 58 | Statyczna biblioteka Cryptopp. |
ff61087a | 59 | |
ff61087a | 60 | %prep |
9c05bf68 | 61 | %setup -q -n %{name}-CRYPTOPP_%{tag_ver} |
ff61087a | 62 | |
63 | %build | |
638f962c | 64 | CXXFLAGS="%{rpmcxxflags} %{!?with_sse2:-DCRYPTOPP_DISABLE_SSE2} %{?with_sse2:-msse2}" \ |
4574ef33 JB |
65 | %{__make} shared static %{?with_tests:cryptest.exe} \ |
66 | CXX="%{__cxx}" | |
ff61087a | 67 | |
17888f8d | 68 | %if %{with tests} |
4574ef33 | 69 | %{__make} test |
17888f8d | 70 | %endif |
472a31a8 | 71 | |
ff61087a | 72 | %install |
1e862315 | 73 | rm -rf $RPM_BUILD_ROOT |
e7868f1d | 74 | |
4574ef33 JB |
75 | %{__make} install \ |
76 | DESTDIR=$RPM_BUILD_ROOT \ | |
77 | PREFIX=%{_prefix} \ | |
78 | LIBDIR=%{_libdir} | |
ff61087a | 79 | |
dd9c76ee ER |
80 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} |
81 | sed -e " | |
82 | s|@PREFIX@|%{_prefix}|g | |
83 | s|@LIBDIR@|%{_libdir}|g | |
84 | s|@VERSION@|%{version}|g | |
85 | " %{SOURCE1} > $RPM_BUILD_ROOT%{_pkgconfigdir}/cryptopp.pc | |
86 | ||
e7868f1d JB |
87 | # tests |
88 | %{__rm} $RPM_BUILD_ROOT%{_bindir}/cryptest.exe | |
89 | %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/cryptopp/Test{Data,Vectors} | |
d0c3dcd5 | 90 | |
ff61087a | 91 | %clean |
92 | rm -rf $RPM_BUILD_ROOT | |
93 | ||
1e862315 JB |
94 | %post -p /sbin/ldconfig |
95 | %postun -p /sbin/ldconfig | |
96 | ||
4574ef33 JB |
97 | %triggerpostun -- cryptopp < 5.6.5 |
98 | rm -f %{_libdir}/libcryptopp.so.5.6 | |
99 | /sbin/ldconfig | |
100 | ||
ff61087a | 101 | %files |
1e862315 | 102 | %defattr(644,root,root,755) |
ff61087a | 103 | %doc License.txt Readme.txt |
4574ef33 | 104 | %attr(755,root,root) %{_libdir}/libcryptopp.so.*.*.* |
9c05bf68 | 105 | %attr(755,root,root) %ghost %{_libdir}/libcryptopp.so.8 |
ff61087a | 106 | |
107 | %files devel | |
1e862315 | 108 | %defattr(644,root,root,755) |
6081e9d5 | 109 | %attr(755,root,root) %{_libdir}/libcryptopp.so |
4c7740b9 | 110 | %{_includedir}/cryptopp |
dd9c76ee | 111 | %{_pkgconfigdir}/cryptopp.pc |
1e862315 JB |
112 | |
113 | %files static | |
114 | %defattr(644,root,root,755) | |
115 | %{_libdir}/libcryptopp.a |