lzo/lzo.spec
2024-02-28 21:14:03 +08:00

129 lines
3.6 KiB
RPMSpec

#
# spec file for package lzo
#
# Copyright (c) 2022-2023 ZhuningOS
#
Name: lzo
Version: 2.10
Release: 2.22
Summary: A Real-Time Data Compression Library
License: GPL-2.0+
Group: Development/Libraries/C and C++
Url: http://www.oberhumer.com/opensource/lzo/
Source: http://www.oberhumer.com/opensource/%{name}/download/%{name}-%{version}.tar.gz
Source2: baselibs.conf
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# bug437293
%ifarch ppc64
Obsoletes: lzo-64bit
%endif
%description
LZO is a portable lossless data compression library written in ANSI C.
It offers pretty fast compression and very fast decompression.
Decompression requires no memory. LZO is suitable for data compression
and decompression in real-time. This means it favors speed over
compression ratio.
%define library_package liblzo2-2
%package -n liblzo2-2
Summary: A Real-Time Data Compression Library
Group: Development/Libraries/C and C++
Provides: lzo = %{version}-%{release}
Obsoletes: lzo < %{version}
# bug437293
%ifarch ppc64
Obsoletes: lzo-64bit
%endif
#
%description -n liblzo2-2
LZO is a portable lossless data compression library written in ANSI C.
It offers pretty fast compression and very fast decompression.
Decompression requires no memory. LZO is suitable for data compression
and decompression in real-time. This means it favors speed over
compression ratio.
%package devel
Summary: Development files for lzo
Group: Development/Languages/C and C++
Requires: %{library_package} = %{version}
# bug437293
%ifarch ppc64
Obsoletes: lzo-devel-64bit
%endif
#
%description devel
LZO is a portable lossless data compression library written in ANSI C.
It offers pretty fast compression and very fast decompression.
Decompression requires no memory. LZO is suitable for data
de-/compression in real-time. This means it favours speed over
compression ratio.
%package devel-static
Summary: Development files for lzo
Group: Development/Languages/C and C++
Requires: lzo-devel = %{version}
Provides: lzo-devel:%{_libdir}/liblzo.a
%description devel-static
LZO is a portable lossless data compression library written in ANSI C.
It offers pretty fast compression and very fast decompression.
Decompression requires no memory. LZO is suitable for data
de-/compression in real-time. This means it favours speed over
compression ratio.
%prep
%setup -q
%build
export CFLAGS="%{optflags} -fvisibility=hidden"
%configure --enable-shared \
--enable-static \
--disable-silent-rules \
--docdir=%{_docdir}/%{name}-devel
#On windows, the build system defines __LZO_EXPORT1 to
# __attribute__((dllexport))) which we can abuse to make
#use of GCC visibility. ;-)
#see http://gcc.gnu.org/wiki/Visibility
#If you remove this, you must disable -fvisibility=hidden in CFLAGS!
echo '#define __LZO_EXPORT1 __attribute__ ((visibility ("default")))' >> config.h
make %{?_smp_mflags}
%check
make %{?_smp_mflags} check test
%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
rm -v %{buildroot}%{_libdir}/liblzo2.la
%post -n %{library_package} -p /sbin/ldconfig
%postun -n %{library_package} -p /sbin/ldconfig
%files -n %{library_package}
%defattr(-,root,root)
%{_libdir}/liblzo2.so.*
%files devel
%defattr (-,root,root)
%doc AUTHORS BUGS COPYING NEWS README THANKS
%doc doc/* util/*
%{_libdir}/liblzo2.so
%{_includedir}/lzo
%{_libdir}/pkgconfig/lzo2.pc
%files devel-static
%defattr (-,root,root)
%{_libdir}/liblzo2.a
%changelog