3 %bcond_without tests # unit tests
4 %bcond_without static_libs # static library
6 Summary: Snappy - fast compression/decompression library
7 Summary(pl.UTF-8): Snappy - biblioteka do szybkiej kompresji i dekompresji
13 #Source0Download: https://github.com/google/snappy/releases
14 Source0: https://github.com/google/snappy/archive/%{version}/%{name}-%{version}.tar.gz
15 # Source0-md5: 70153395ebe6d72febe2cf2e40026a44
16 Source1: %{name}.pc.in
17 Patch0: %{name}-gtest.patch
18 URL: http://google.github.io/snappy/
19 BuildRequires: cmake >= 3.1
20 BuildRequires: libstdc++-devel >= 6:5
21 BuildRequires: pkgconfig
23 BuildRequires: gtest-devel
24 BuildRequires: lzo-devel >= 2
25 BuildRequires: zlib-devel
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 Snappy is a compression/decompression library. It does not aim for
31 maximum compression, or compatibility with any other compression
32 library; instead, it aims for very high speeds and reasonable
33 compression. For instance, compared to the fastest mode of zlib,
34 Snappy is an order of magnitude faster for most inputs, but the
35 resulting compressed files are anywhere from 20% to 100% bigger.
37 Snappy has the following properties:
38 - Fast: Compression speeds at 250 MB/sec and beyond, with no
40 - Stable: Over the last few years, Snappy has compressed and
41 decompressed petabytes of data in Google's production environment.
42 The Snappy bitstream format is stable and will not change between
44 - Robust: The Snappy decompressor is designed not to crash in the face
45 of corrupted or malicious input.
46 - Free and open source software: Snappy is licensed under the Apache
49 Snappy has previously been called "Zippy" in some Google presentations
52 %description -l pl.UTF-8
53 Snappy to biblioteka kompresująca i dekompresująca. Jej celem nie jest
54 maksymalna kompresja ani kompatybilność z żadną istniejącą biblioteką;
55 celem natomiast jest bardzo duża szybkość przy rozsądnej kompresji. Na
56 przykład, w porównaniu do najszybszego trybu zliba, Snappy jest rząd
57 wielkości szybszy dla większości danych, ale pliki wynikowe są większe
60 Biblioteka Snappy ma następujące cechy:
61 - jest szybka: potrafi przetwarzać 250 MB/s bez kodu w asemblerze
62 - jest stabilna: przez ostatnie kilka lat była używana do kompresji i
63 dekompresji petabajtów danych w środowisku produkcyjnym Google'a;
64 format strumienia Snappy jest stabilny i nie zmieni się między
66 - jest trwała: dekompresor Snappy został tak zaprojektowany, aby nie
67 wykładać się na uszkodzonych lub błędnych danych wejściowych
68 - jest oprogramowaniem wolnodostępnym i z otwartymi źródłami, na
69 licencji Apache w wersji 2.0.
71 Snappy wcześniej (np. na różnych prezentacjach Google'a) był nazywany
75 Summary: Header files for Snappy library
76 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Snappy
77 Group: Development/Libraries
78 Requires: %{name} = %{version}-%{release}
79 Requires: libstdc++-devel
82 Header files for Snappy library.
84 %description devel -l pl.UTF-8
85 Pliki nagłówkowe biblioteki Snappy.
88 Summary: Static Snappy library
89 Summary(pl.UTF-8): Statyczna biblioteka Snappy
90 Group: Development/Libraries
91 Requires: %{name}-devel = %{version}-%{release}
94 Static Snappy library.
96 %description static -l pl.UTF-8
97 Statyczna biblioteka Snappy.
104 %if %{with static_libs}
105 install -d build-static
108 -DBUILD_SHARED_LIBS=OFF \
109 -DCMAKE_CXX_STANDARD=14 \
110 -DSNAPPY_BUILD_BENCHMARKS=OFF \
111 %{!?with_tests:-DSNAPPY_BUILD_TESTS=OFF}
120 -DCMAKE_CXX_STANDARD=14 \
121 -DSNAPPY_BUILD_BENCHMARKS=OFF \
122 %{!?with_tests:-DSNAPPY_BUILD_TESTS=OFF}
129 rm -rf $RPM_BUILD_ROOT
131 %if %{with static_libs}
132 # static first so that packaged cmake config files refer to shared library
133 %{__make} -C build-static install \
134 DESTDIR=$RPM_BUILD_ROOT
137 %{__make} -C build install \
138 DESTDIR=$RPM_BUILD_ROOT
140 # ugh, they removed autotools support together with .pc file :/
141 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
142 sed -e 's,@prefix@,%{_prefix},g;s,@libdir@,%{_libdir},g;s,@version@,%{version},g' \
143 %{SOURCE1} > $RPM_BUILD_ROOT%{_pkgconfigdir}/snappy.pc
146 rm -rf $RPM_BUILD_ROOT
148 %post -p /sbin/ldconfig
149 %postun -p /sbin/ldconfig
152 %defattr(644,root,root,755)
153 %doc AUTHORS COPYING NEWS README.md
154 %attr(755,root,root) %{_libdir}/libsnappy.so.*.*.*
155 %attr(755,root,root) %ghost %{_libdir}/libsnappy.so.1
158 %defattr(644,root,root,755)
159 %attr(755,root,root) %{_libdir}/libsnappy.so
160 %{_includedir}/snappy*.h
161 %{_pkgconfigdir}/snappy.pc
162 %{_libdir}/cmake/Snappy
164 %if %{with static_libs}
166 %defattr(644,root,root,755)
167 %{_libdir}/libsnappy.a