]>
Commit | Line | Data |
---|---|---|
d955ef1b ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | ||
a5cdb54e | 5 | %define rel 2 |
ce394644 JB |
6 | %define rdate 20070619 |
7 | %define svnrev 12 | |
d955ef1b | 8 | Summary: Portable real-time compression library |
ce394644 | 9 | Summary(pl.UTF-8): Przenośna biblioteka kompresji w czasie rzeczywistej |
d955ef1b ER |
10 | Name: fastlz |
11 | Version: 0.1.0 | |
12 | Release: 0.r%{svnrev}.%{rdate}.%{rel} | |
13 | License: MIT | |
14 | Group: Libraries | |
15 | # svn export -r 12 http://fastlz.googlecode.com/svn/trunk/ fastlz-12 | |
16 | # tar cjf fastlz-12.tar.bz2 fastlz-12 | |
17 | Source0: http://pkgs.fedoraproject.org/repo/pkgs/fastlz/%{name}-%{svnrev}.tar.bz2/592bdf20af83c0124f19b55d0346f266/%{name}-%{svnrev}.tar.bz2 | |
18 | # Source0-md5: 592bdf20af83c0124f19b55d0346f266 | |
19 | URL: http://fastlz.org/ | |
20 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
21 | ||
22 | %define abi 0 | |
23 | ||
24 | %description | |
25 | FastLZ is a lossless data compression library designed for real-time | |
26 | compression and decompression. It favors speed over compression ratio. | |
27 | Decompression requires no memory. Decompression algorithm is very | |
28 | simple, and thus extremely fast. | |
29 | ||
ce394644 JB |
30 | %description -l pl.UTF-8 |
31 | FastLZ to biblioteka do bezstratnej kompresji danych zaprojektowana do | |
32 | kompresji i dekompresji w czasie rzeczywistym. Preferuje szybkość niż | |
33 | współczynnik kompresji. Dekompresja nie wymaga pamięci. Algorytm | |
34 | dekompresji jest bardzo prosty, dzięki czemu jest bardzo szybki. | |
35 | ||
d955ef1b | 36 | %package devel |
ce394644 JB |
37 | Summary: Header file for FastLZ library |
38 | Summary(pl.UTF-8): Plik nagłówkowy biblioteki FastLZ | |
d955ef1b ER |
39 | Group: Development/Libraries |
40 | Requires: %{name} = %{version}-%{release} | |
41 | ||
42 | %description devel | |
ce394644 JB |
43 | This package contains the header file for FastLZ library. |
44 | ||
45 | %description devel -l pl.UTF-8 | |
46 | Ten pakiet zawiera plik nagłówkowy biblioteki FastLZ. | |
d955ef1b ER |
47 | |
48 | %prep | |
49 | %setup -q -n %{name}-%{svnrev} | |
50 | ||
51 | %build | |
52 | # Build the shared library | |
53 | %{__cc} %{rpmcflags} -fPIC -c fastlz.c -o fastlz.o | |
54 | %{__cc} %{rpmcflags} -fPIC -shared -Wl,-soname -Wl,lib%{name}.so.%{abi} -o lib%{name}.so.%{abi} fastlz.o | |
55 | ln -s lib%{name}.so.%{abi} lib%{name}.so | |
56 | ||
57 | # Build the commands for test | |
58 | %{__cc} %{rpmcflags} -fPIC 6pack.c -L. -l%{name} -o 6pack | |
59 | %{__cc} %{rpmcflags} -fPIC 6unpack.c -L. -l%{name} -o 6unpack | |
60 | ||
61 | %if %{with tests} | |
62 | export LD_LIBRARY_PATH=$PWD | |
63 | cp %{name}.c tmpin | |
64 | ./6pack -v | |
65 | ./6unpack -v | |
66 | ||
67 | : Compress | |
68 | ./6pack -1 tmpin tmpout1 | |
69 | ./6pack -2 tmpin tmpout2 | |
70 | ||
71 | : Uncompress 1 | |
72 | rm tmpin | |
73 | ./6unpack tmpout1 | |
74 | diff %{name}.c tmpin | |
75 | ||
76 | : Uncompress 2 | |
77 | rm tmpin | |
78 | ./6unpack tmpout2 | |
79 | diff %{name}.c tmpin | |
80 | %endif | |
81 | ||
82 | %install | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}} | |
85 | ||
86 | install -p lib%{name}.so.%{abi} $RPM_BUILD_ROOT%{_libdir} | |
87 | ln -s lib%{name}.so.%{abi} $RPM_BUILD_ROOT%{_libdir}/lib%{name}.so | |
88 | cp -p %{name}.h $RPM_BUILD_ROOT%{_includedir} | |
89 | ||
90 | # Don't install the commands, as we obviously don't need more compression tools | |
91 | ||
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) | |
ce394644 | 100 | %doc LICENSE README.TXT |
d955ef1b ER |
101 | %attr(755,root,root) %{_libdir}/libfastlz.so.0 |
102 | ||
103 | %files devel | |
104 | %defattr(644,root,root,755) | |
ce394644 | 105 | %attr(755,root,root) %{_libdir}/libfastlz.so |
d955ef1b | 106 | %{_includedir}/fastlz.h |