File libmnl.spec of Package libmnl
%define realname libmnl
%define realver 1.0.4
%define srcext tar.bz2
%define so_ver 0
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
# Common info
Name: %{realname}%{?so_ver}
Version: %{realver}
Release: %{?extraver:0.}1%{?dist}
License: LGPL-2.1+
Group: System/Libraries
URL: http://www.netfilter.org/projects/libmnl/
Summary: Netlink user-space library
# Install-time parameters
Provides: %{realname}
# Build-time parameters
BuildRequires: pkg-config
BuildRoot: %{_tmppath}/%{name}-root
Source: http://www.netfilter.org/projects/libmnl/files/%{realname}-%{realver}%{?extraver}.%{srcext}
%description
libmnl is a minimalistic user-space library oriented to Netlink developers.
There are a lot of common tasks in parsing, validating, constructing of both
the Netlink header and TLVs that are repetitive and easy to get wrong.
This library aims to provide simple helpers that allows you to re-use code
and to avoid re-inventing the wheel.
%package -n %{realname}-devel
Group: Development/Languages/C and C++
Summary: Development files for %{name}
Requires: %{name} = %{version}
Provides: %{name}-devel
%description -n %{realname}-devel
Development files for %{name}
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}%{?extraver}
%build
%configure \
--disable-static \
CFLAGS="%{optflags} %{gcc_lto}" \
CXXFLAGS="%{optflags} %{gcc_lto}" \
LDFLAGS="-Wl,--as-needed -Wl,--strip-all %{gcc_lto}"
%{__make} %{?_smp_mflags}
%install
%{__make} install DESTDIR=%{buildroot}
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files
%defattr(-,root,root)
%doc COPYING README
%{_libdir}/libmnl.so.%{?so_ver}*
# Development stuff
%files -n %{realname}-devel
%defattr(-,root,root)
%{_libdir}/pkgconfig/libmnl.pc
%dir %{_includedir}/libmnl/
%{_includedir}/libmnl/libmnl.h
%{_libdir}/libmnl.so
%exclude %{_libdir}/libmnl.la
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%changelog
%changelog -n %{realname}-devel