]>
Commit | Line | Data |
---|---|---|
e2b4d925 | 1 | %define rel 1 |
e898c13a ER |
2 | %define svnrev 106 |
3 | Summary: Hash-based Predictive Lempel-Ziv compressor | |
4 | Name: lz4 | |
5 | Version: 0.0 | |
6 | Release: 0.svn%{svnrev}.%{rel} | |
7 | License: GPL-2.0+ and BSD-2-Clause | |
8 | Group: Libraries | |
9 | Source0: https://dl.dropboxusercontent.com/u/59565338/LZ4/%{name}-r%{svnrev}.tar.gz | |
10 | # Source0-md5: 4d071aaecd42dd383dd58c5a7577663b | |
9f330847 | 11 | Patch0: cmake-langs.patch |
e898c13a | 12 | URL: http://fastcompression.blogspot.com/p/lz4.html |
e2b4d925 | 13 | BuildRequires: cmake |
61e29706 | 14 | BuildRequires: sed >= 4.0 |
e898c13a ER |
15 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
16 | ||
17 | %description | |
18 | LZ4 is a very fast compressor, based on well-known LZ77 (Lempel-Ziv) | |
19 | algorithm. It is a LZP2 fork and provides better compression ratio for | |
20 | text files. | |
21 | ||
22 | %package devel | |
23 | Summary: Development files for the LZ4 compressor | |
24 | Group: Development/Libraries | |
25 | Requires: %{name} = %{version}-%{release} | |
26 | ||
27 | %description devel | |
28 | LZ4 is a very fast compressor, based on well-known LZ77 (Lempel-Ziv) | |
29 | algorithm. It is a LZP2 fork and provides better compression ratio for | |
30 | text files. | |
31 | ||
32 | This subpackage contains libraries and header files for developing | |
33 | applications that want to make use of liblz4. | |
34 | ||
e2b4d925 ER |
35 | %package static |
36 | Summary: Static %{name} library | |
37 | Summary(pl.UTF-8): Statyczna biblioteka %{name} | |
38 | Group: Development/Libraries | |
39 | Requires: %{name}-devel = %{version}-%{release} | |
40 | ||
41 | %description static | |
42 | Static %{name} library. | |
43 | ||
44 | %description static -l pl.UTF-8 | |
45 | Statyczna biblioteka %{name}. | |
46 | ||
e898c13a ER |
47 | %prep |
48 | %setup -qn %{name}-r%{svnrev} | |
9f330847 | 49 | %patch0 -p1 |
e898c13a | 50 | |
61e29706 ER |
51 | %{__sed} -i -e 's/-Os -march=native/%{rpmcflags}/' cmake/CMakeLists.txt |
52 | ||
e898c13a | 53 | %build |
e2b4d925 ER |
54 | cd cmake |
55 | %cmake \ | |
56 | -DBUILD_SHARED_LIBS=TRUE \ | |
57 | . | |
58 | ||
59 | %{__make} | |
e898c13a ER |
60 | |
61 | %install | |
62 | rm -rf $RPM_BUILD_ROOT | |
e2b4d925 ER |
63 | # all available build systems suck in some way: |
64 | # 1) make-based installed creates only man and exe (no library, no headers) | |
65 | # | |
66 | # 2) cmake based build system creates lib and exe (no man pages), and names | |
67 | # executable based on arch (!), installs headers, but the SONAME is filled | |
68 | # incorrectly: liblz4.so.0.0 | |
69 | ||
70 | # so forget all that and just install from spec | |
71 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_mandir}/man1,%{_includedir}} | |
72 | ||
73 | # shared lib | |
74 | install -p cmake/liblz4.so.0.* $RPM_BUILD_ROOT%{_libdir}/liblz4.so.0.0.%{svnrev} | |
75 | ln -s $(basename $RPM_BUILD_ROOT%{_libdir}/liblz4.so.0.*) $RPM_BUILD_ROOT%{_libdir}/liblz4.so | |
76 | /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir} | |
77 | ||
78 | # static lib | |
79 | cp -p cmake/liblz4.a $RPM_BUILD_ROOT%{_libdir} | |
80 | ||
81 | # headers | |
82 | cp -a {lz4,lz4hc}.h $RPM_BUILD_ROOT%{_includedir} | |
83 | ||
84 | # binary | |
85 | install -p cmake/lz4c* $RPM_BUILD_ROOT%{_bindir}/lz4 | |
86 | ||
87 | # man page | |
88 | cp -p lz4.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
e898c13a ER |
89 | |
90 | %clean | |
91 | rm -rf $RPM_BUILD_ROOT | |
92 | ||
e2b4d925 ER |
93 | %post -p /sbin/ldconfig |
94 | %postun -p /sbin/ldconfig | |
95 | ||
e898c13a ER |
96 | %files |
97 | %defattr(644,root,root,755) | |
98 | %attr(755,root,root) %{_bindir}/lz4 | |
99 | %{_mandir}/man1/lz4.1* | |
e2b4d925 ER |
100 | %attr(755,root,root) %{_libdir}/liblz4.so.*.*.* |
101 | %ghost %{_libdir}/liblz4.so.0.0 | |
e898c13a ER |
102 | |
103 | %files devel | |
104 | %defattr(644,root,root,755) | |
e2b4d925 ER |
105 | %{_includedir}/lz4.h |
106 | %{_includedir}/lz4hc.h | |
e898c13a | 107 | %{_libdir}/liblz4.so |
e2b4d925 ER |
108 | |
109 | %files static | |
110 | %defattr(644,root,root,755) | |
111 | %{_libdir}/liblz4.a |