]> git.pld-linux.org Git - packages/lz4.git/blame - lz4.spec
link with our CFLAGS
[packages/lz4.git] / lz4.spec
CommitLineData
e2b4d925 1%define rel 1
e898c13a
ER
2%define svnrev 106
3Summary: Hash-based Predictive Lempel-Ziv compressor
4Name: lz4
5Version: 0.0
6Release: 0.svn%{svnrev}.%{rel}
7License: GPL-2.0+ and BSD-2-Clause
8Group: Libraries
9Source0: https://dl.dropboxusercontent.com/u/59565338/LZ4/%{name}-r%{svnrev}.tar.gz
10# Source0-md5: 4d071aaecd42dd383dd58c5a7577663b
9f330847 11Patch0: cmake-langs.patch
e898c13a 12URL: http://fastcompression.blogspot.com/p/lz4.html
e2b4d925 13BuildRequires: cmake
61e29706 14BuildRequires: sed >= 4.0
e898c13a
ER
15BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
16
17%description
18LZ4 is a very fast compressor, based on well-known LZ77 (Lempel-Ziv)
19algorithm. It is a LZP2 fork and provides better compression ratio for
20text files.
21
22%package devel
23Summary: Development files for the LZ4 compressor
24Group: Development/Libraries
25Requires: %{name} = %{version}-%{release}
26
27%description devel
28LZ4 is a very fast compressor, based on well-known LZ77 (Lempel-Ziv)
29algorithm. It is a LZP2 fork and provides better compression ratio for
30text files.
31
32This subpackage contains libraries and header files for developing
33applications that want to make use of liblz4.
34
e2b4d925
ER
35%package static
36Summary: Static %{name} library
37Summary(pl.UTF-8): Statyczna biblioteka %{name}
38Group: Development/Libraries
39Requires: %{name}-devel = %{version}-%{release}
40
41%description static
42Static %{name} library.
43
44%description static -l pl.UTF-8
45Statyczna 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
54cd cmake
55%cmake \
56 -DBUILD_SHARED_LIBS=TRUE \
57 .
58
59%{__make}
e898c13a
ER
60
61%install
62rm -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
71install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_mandir}/man1,%{_includedir}}
72
73# shared lib
74install -p cmake/liblz4.so.0.* $RPM_BUILD_ROOT%{_libdir}/liblz4.so.0.0.%{svnrev}
75ln -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
79cp -p cmake/liblz4.a $RPM_BUILD_ROOT%{_libdir}
80
81# headers
82cp -a {lz4,lz4hc}.h $RPM_BUILD_ROOT%{_includedir}
83
84# binary
85install -p cmake/lz4c* $RPM_BUILD_ROOT%{_bindir}/lz4
86
87# man page
88cp -p lz4.1 $RPM_BUILD_ROOT%{_mandir}/man1
e898c13a
ER
89
90%clean
91rm -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
This page took 0.3459 seconds and 4 git commands to generate.