]> git.pld-linux.org Git - packages/crc32c.git/blob - crc32c.spec
- skip SSE4.2 test on not capable builders; release 2
[packages/crc32c.git] / crc32c.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit testing
4 #
5 Summary:        CRC32C library
6 Summary(pl.UTF-8):      Biblioteka cyklicznego kodu nadmiarowego CRC32C
7 Name:           crc32c
8 Version:        1.1.2
9 Release:        2
10 License:        BSD
11 Group:          Libraries
12 #Source0Download: https://github.com/google/crc32c/tags
13 Source0:        https://github.com/google/crc32c/archive/%{version}/%{name}-%{version}.tar.gz
14 # Source0-md5:  cc0338e6a60c38cab04a70a2c36cd9f2
15 Patch0:         %{name}-system-libs.patch
16 URL:            https://github.com/google/crc32c
17 BuildRequires:  cmake >= 3.1
18 BuildRequires:  libstdc++-devel >= 6:4.7
19 BuildRequires:  sed >= 4.0
20 %if %{with tests}
21 # with cmake support
22 BuildRequires:  glog-devel >= 0.6
23 BuildRequires:  google-benchmark-devel
24 BuildRequires:  gtest-devel
25 %endif
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %description
29 This project (originating in Google LevelDB key-value store) collects
30 a few CRC32C implementations under an umbrella that dispatches to a
31 suitable implementation based on the host computer's hardware
32 capabilities.
33
34 CRC32C is specified as the CRC that uses the iSCSI polynomial in RFC
35 3720. The polynomial was introduced by G. Castagnoli, S. Braeuer and
36 M. Herrmann. CRC32C is used in software such as Btrfs, ext4, Ceph and
37 leveldb.
38
39 %description -l pl.UTF-8
40 Ten projekt (wywodzący się z bazy klucz-wartość Google LevelDB) zbiera
41 kilka implementacji CRC32C w obudowaniu, które wybiera implementację
42 pasującą do możliwości sprzętowych komputera.
43
44 Algorytm CRC32C to cykliczny kod nadmiarowy, wykorzystujący wielomian
45 iSCSI określony w RFC 3720. Wielomian został wprowadzony przez G.
46 Castagnoliego, S. Braeuera i M. Herrmanna. Algorytm jest
47 wykorzystywany w takim oprogramowaniu, jak btrfs, ext4, ceph czy
48 leveldb.
49
50 %package devel
51 Summary:        Header files for crc32c library
52 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki crc32c
53 Group:          Development/Libraries
54 Requires:       %{name} = %{version}-%{release}
55
56 %description devel
57 Header files for crc32c library.
58
59 %description devel -l pl.UTF-8
60 Pliki nagłówkowe biblioteki crc32c.
61
62 %prep
63 %setup -q
64 %patch0 -p1
65
66 # crc32c_sse42_unittest is missing runtime detection of CPU capabilities
67 if ! grep -q '^flags .* sse4_2' /proc/cpuinfo ; then
68         %{__sed} -i -e 's/if HAVE_SSE42 /if 0 /' src/crc32c_sse42_unittest.cc
69 fi
70
71 %build
72 install -d build
73 cd build
74 %cmake .. \
75         %{!?with_tests:-DCRC32C_BUILD_BENCHMARKS=OFF -DCRC32C_BUILD_TESTS=OFF}
76
77 %{__make}
78
79 %if %{with tests}
80 %{__make} test
81 %endif
82
83 %install
84 rm -rf $RPM_BUILD_ROOT
85
86 %{__make} -C build install \
87         DESTDIR=$RPM_BUILD_ROOT
88
89 %clean
90 rm -rf $RPM_BUILD_ROOT
91
92 %post   -p /sbin/ldconfig
93 %postun -p /sbin/ldconfig
94
95 %files
96 %defattr(644,root,root,755)
97 %doc AUTHORS LICENSE README.md
98 %attr(755,root,root) %{_libdir}/libcrc32c.so.*.*.*
99 %attr(755,root,root) %ghost %{_libdir}/libcrc32c.so.1
100
101 %files devel
102 %defattr(644,root,root,755)
103 %attr(755,root,root) %{_libdir}/libcrc32c.so
104 %{_includedir}/crc32c
105 %{_libdir}/cmake/Crc32c
This page took 0.074748 seconds and 4 git commands to generate.