File liblzf.spec of Package liblzf

%def_enable static
%def_enable shared

%define bname lzf
Name: lib%bname
Version: 3.6
Release: 3
Summary: Extremely fast data compression library
Group: System/Libraries
License: GPL-2.0+
URL: http://oldhome.schmorp.de/marc/%name.html
Source: http://dist.schmorp.de/%name/%name-%version.tar.gz
Source9: %name-rpmlintrc
# Adds autoconf and in particular support for building shared libraries.
# 7th Feb 2011 - Mail sent upstream to author. Awaiting conclusion.
Patch: %name-%version-autoconf.patch
BuildRequires: autoconf automake libtool pkg-config

%description
LibLZF is a very small data compression library. The compression algorithm is
very, very fast, yet still written in portable C.


%package devel
Summary: Development files for %name
Group: Development/Languages/C and C++
Requires: %name%{?_disable_shared:-devel-static} = %version-%release

%description devel
LibLZF is a very small data compression library. The compression algorithm is
very, very fast, yet still written in portable C.
This package contains libraries and header files for developing applications
that use %name.


%if_enabled static
%package devel-static
Summary: Development files for %name
Group: Development/Languages/C and C++
Provides: %{name}1 = %version-%release
Requires: %name-devel = %version-%release

%description devel-static
LibLZF is a very small data compression library. The compression algorithm is
very, very fast, yet still written in portable C.
This package contains libraries and header files for developing applications
that use %name.
%endif


%package -n %bname
Summary: Development files for %name
Group: Productivity/Archiving/Compression
Requires: %name = %version-%release

%description -n %bname
LibLZF is a very small data compression library. The compression algorithm is
very, very fast, yet still written in portable C.
This package contains utilities that use %name.


%prep
%setup -q
%patch -p1


%build
%global optflags %optflags -fPIC -DPIC -flto
mkdir -p config
aclocal -I config
autoheader
libtoolize --automake
automake -a --foreign
autoconf
%configure \
	%{subst_enable shared} \
	%{subst_enable static} \
	--enable-largefile
make %{?_smp_mflags} AM_LDFLAGS="-fwhole-program"


%install
%make_install
for i in un%bname %{bname}cat; do
	ln -s %bname %buildroot%_bindir/$i
done
rm -f %buildroot%_libdir/*.la


%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig


%if_enabled shared
%files
%defattr(-,root,root)
%_libdir/*.so.*
%endif


%files devel
%defattr(-,root,root)
%_includedir/*
%_libdir/*.so
%_libdir/pkgconfig/*


%if_enabled static
%files devel-static
%defattr(-,root,root)
%_libdir/*.a
%endif


%files -n %bname
%defattr(-,root,root)
%doc README Changes LICENSE
%_bindir/*


%changelog
openSUSE Build Service is sponsored by