Change GPL-2.0+ to GPL-2.0-or-later
[platform/upstream/lzo.git] / packaging / lzo.spec
1
2 %if "%{run_tests}" == "1"
3     %define check %%check
4 %endif
5
6 Name:           lzo
7 Version:        2.10
8 Release:        0
9 License:        GPL-2.0-or-later
10 Summary:        Data compression library with very fast (de)compression
11 Url:            http://www.oberhumer.com/opensource/lzo/
12 Group:          System/Libraries
13 Source0:        http://www.oberhumer.com/opensource/lzo/download/%{name}-%{version}.tar.gz
14 Source1001:     lzo.manifest
15 BuildRequires:  zlib-devel
16 Requires(post): /sbin/ldconfig
17 Requires(postun): /sbin/ldconfig
18
19 %description
20 LZO is a portable lossless data compression library written in ANSI C.
21 It offers pretty fast compression and very fast decompression.
22 Decompression requires no memory. In addition there are slower
23 compression levels achieving a quite competitive compression ratio
24 while still decompressing at this very high speed.
25
26 %package minilzo
27 Summary:        Mini version of lzo for apps which don't need the full version
28 Group:          System/Libraries
29 Requires:       %{name} = %{version}
30 Requires(post): /sbin/ldconfig
31 Requires(postun): /sbin/ldconfig
32
33 %description minilzo
34 A small (mini) version of lzo for embedding into applications which don't need
35 full blown lzo compression support.
36
37 %package devel
38 Summary:        Development files for the lzo library
39 Group:          Development/Libraries
40 Requires:       %{name} = %{version}
41 Requires:       zlib-devel
42
43 %description devel
44 LZO is a portable lossless data compression library written in ANSI C.
45 It offers pretty fast compression and very fast decompression.
46 This package contains development files needed for lzo.
47
48 %prep
49 %setup -q
50 cp %{SOURCE1001} .
51
52
53 %build
54
55 %configure --disable-static \
56     --disable-dependency-tracking \
57     --enable-shared \
58     CFLAGS="`echo $CFLAGS | sed 's/-O2//g'`"
59
60 %__make %{?_smp_mflags}
61
62 # build minilzo too (bz 439979)
63 gcc %{optflags} -O2 -g -fpic -Iinclude/lzo -o minilzo/minilzo.o -c minilzo/minilzo.c
64 gcc -g -shared -o libminilzo.so.0 -Wl,-soname,libminilzo.so.0 minilzo/minilzo.o
65 %install
66 %make_install
67
68 install -m 755 libminilzo.so.0 %{buildroot}%{_libdir}
69 ln -sf libminilzo.so.0 %{buildroot}%{_libdir}/libminilzo.so
70 install -p -m 644 minilzo/minilzo.h %{buildroot}%{_includedir}/lzo
71 rm -f %{buildroot}%{_datadir}/doc/%{name}/COPYING
72
73
74 %post -p /sbin/ldconfig
75
76 %postun -p /sbin/ldconfig
77
78
79 %post minilzo -p /sbin/ldconfig
80
81 %postun minilzo -p /sbin/ldconfig
82
83 %check
84 rm -f /tmp/%{name}_test
85 %__make test | tee -i /tmp/%{name}_log
86 cat /tmp/%{name}_log | grep "^LZO1" | sed -e 's/^LZO1.*| /TEST: PASS: /g' > /tmp/%{name}_test
87 chmod +x ./run_test.sh
88 ./run_test.sh %{name} %{version}
89 rm -f /tmp/%{name}_log
90
91 %files
92 %manifest %{name}.manifest
93 %defattr(-,root,root,-)
94 %license COPYING
95 %{_libdir}/liblzo2.so.*
96
97 %files minilzo
98 %manifest %{name}.manifest
99 %defattr(-,root,root,-)
100 %doc minilzo/README.LZO
101 %{_libdir}/libminilzo.so.0
102
103 %files devel
104 %manifest %{name}.manifest
105 %defattr(-,root,root,-)
106 %doc %{_datadir}/doc/%{name}/AUTHORS
107 %doc %{_datadir}/doc/%{name}/LZO*
108 %doc %{_datadir}/doc/%{name}/NEWS
109 %doc %{_datadir}/doc/%{name}/THANKS
110 %{_includedir}/lzo
111 %{_libdir}/lib*lzo*.so
112 %{_libdir}/pkgconfig/lzo2.pc