]>
Commit | Line | Data |
---|---|---|
b46fcfe9 JP |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without asm # disable assembler | |
4 | ||
5 | # workaround executable stack on non-x86_64 | |
6 | # https://github.com/facebook/zstd/issues/2963 | |
7 | %ifnarch %{x8664} | |
8 | %undefine with_asm | |
9 | %endif | |
10 | ||
8edbfa0e JB |
11 | Summary: Zstandard - fast lossless compression algorithm |
12 | Summary(pl.UTF-8): Zstandard - szybki, bezstratny algorytm kompresji | |
13 | Name: zstd | |
62ae61c3 | 14 | Version: 1.5.1 |
b46fcfe9 | 15 | Release: 2 |
8edbfa0e JB |
16 | License: BSD |
17 | Group: Libraries | |
a3eb5c88 JB |
18 | #Source0Download: https://github.com/facebook/zstd/releases |
19 | Source0: https://github.com/facebook/zstd/archive/v%{version}/%{name}-%{version}.tar.gz | |
62ae61c3 | 20 | # Source0-md5: 120d77140ad538e8bd3a7dae6a38c4c9 |
a3eb5c88 | 21 | URL: https://github.com/facebook/zstd |
8edbfa0e | 22 | BuildRequires: gcc >= 5:3.2 |
8df4284d JP |
23 | BuildRequires: lz4-devel |
24 | BuildRequires: xz-devel | |
25 | BuildRequires: zlib-devel | |
8edbfa0e JB |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
27 | ||
f3c32c66 JP |
28 | %ifarch %{arm} |
29 | %define archcflags -DMEM_FORCE_MEMORY_ACCESS=1 | |
30 | %endif | |
31 | ||
8edbfa0e JB |
32 | %description |
33 | Zstd, short for Zstandard, is a fast lossless compression algorithm, | |
34 | targeting real-time compression scenarios at zlib-level compression | |
35 | ratio. | |
36 | ||
37 | %description -l pl.UTF-8 | |
38 | Zstd (skrót od Zstandard) to szybki, bezstratny algorytm kompresji, do | |
39 | zastosowwań przy kompresji w czasie rzeczywistym ze współczynnikiem | |
40 | kompresji zbliżonym do biblioteki zlib. | |
41 | ||
42 | %package devel | |
43 | Summary: Header files for Zstd library | |
44 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Zstd | |
45 | Group: Development/Libraries | |
46 | Requires: %{name} = %{version}-%{release} | |
47 | ||
48 | %description devel | |
49 | Header files for Zstd library. | |
50 | ||
51 | %description devel -l pl.UTF-8 | |
52 | Pliki nagłówkowe biblioteki Zstd. | |
53 | ||
54 | %package static | |
55 | Summary: Static Zstd library | |
56 | Summary(pl.UTF-8): Statyczna biblioteka Zstd | |
57 | Group: Development/Libraries | |
58 | Requires: %{name}-devel = %{version}-%{release} | |
59 | ||
60 | %description static | |
61 | Static Zstd library. | |
62 | ||
63 | %description static -l pl.UTF-8 | |
64 | Statyczna biblioteka Zstd. | |
65 | ||
66 | %prep | |
67 | %setup -q | |
8edbfa0e JB |
68 | |
69 | %build | |
70 | CC="%{__cc}" \ | |
cfde35c2 | 71 | CXX="%{__cxx}" \ |
f3c32c66 | 72 | CFLAGS="%{rpmcflags} %{rpmcppflags} %{?archcflags}" \ |
cfde35c2 | 73 | CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \ |
8edbfa0e | 74 | LDFLAGS="%{rpmldflags}" \ |
c45ba9ec | 75 | %{__make} allmost manual \ |
b46fcfe9 JP |
76 | V=1 \ |
77 | %{!?with_asm:ZSTD_NO_ASM=1} | |
8edbfa0e JB |
78 | |
79 | %install | |
80 | rm -rf $RPM_BUILD_ROOT | |
2a73dcc2 | 81 | install -d $RPM_BUILD_ROOT/%{_lib} |
8edbfa0e JB |
82 | |
83 | %{__make} install \ | |
2219447b | 84 | V=1 \ |
8edbfa0e JB |
85 | DESTDIR=$RPM_BUILD_ROOT \ |
86 | PREFIX=%{_prefix} \ | |
87 | LIBDIR=%{_libdir} | |
88 | ||
2a73dcc2 JR |
89 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/libzstd.so.* $RPM_BUILD_ROOT/%{_lib} |
90 | ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libzstd.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libzstd.so | |
91 | ||
8edbfa0e JB |
92 | %clean |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %post -p /sbin/ldconfig | |
96 | %postun -p /sbin/ldconfig | |
97 | ||
98 | %files | |
99 | %defattr(644,root,root,755) | |
ce3b3dc6 | 100 | %doc LICENSE CHANGELOG README.md |
8edbfa0e JB |
101 | %attr(755,root,root) %{_bindir}/unzstd |
102 | %attr(755,root,root) %{_bindir}/zstd | |
103 | %attr(755,root,root) %{_bindir}/zstdcat | |
a3eb5c88 JB |
104 | %attr(755,root,root) %{_bindir}/zstdgrep |
105 | %attr(755,root,root) %{_bindir}/zstdless | |
46edb54d | 106 | %attr(755,root,root) %{_bindir}/zstdmt |
2a73dcc2 JR |
107 | %attr(755,root,root) /%{_lib}/libzstd.so.*.*.* |
108 | %attr(755,root,root) %ghost /%{_lib}/libzstd.so.1 | |
8edbfa0e JB |
109 | %{_mandir}/man1/unzstd.1* |
110 | %{_mandir}/man1/zstd.1* | |
111 | %{_mandir}/man1/zstdcat.1* | |
73730962 JB |
112 | %{_mandir}/man1/zstdgrep.1* |
113 | %{_mandir}/man1/zstdless.1* | |
8edbfa0e JB |
114 | |
115 | %files devel | |
116 | %defattr(644,root,root,755) | |
a3eb5c88 | 117 | %doc doc/{zstd_compression_format.md,zstd_manual.html,images} |
8edbfa0e | 118 | %attr(755,root,root) %{_libdir}/libzstd.so |
8edbfa0e JB |
119 | %{_includedir}/zdict.h |
120 | %{_includedir}/zstd.h | |
a3eb5c88 | 121 | %{_includedir}/zstd_errors.h |
8edbfa0e JB |
122 | %{_pkgconfigdir}/libzstd.pc |
123 | ||
124 | %files static | |
125 | %defattr(644,root,root,755) | |
126 | %{_libdir}/libzstd.a |