File libnetfilter_queue.spec of Package libnetfilter_queue

%define realname libnetfilter_queue
%define realver  1.0.3
%define srcext   tar.bz2

%define so_ver   1

# Common info
Name:          %{realname}%{?so_ver}
Version:       %{realver}
Release:       wiz%{?extraver:0.}1%{?dist}
License:       GPL-2.0
Group:         System/Libraries
Summary:       Netfilter userspace packet queueing library

# Install-time parameters
Provides:      %{realname}

# Build-time parameters
BuildRequires: pkgconfig
BuildRequires: libnfnetlink-devel >= 0.0.41
BuildRequires: libmnl-devel >= 1.0.3
BuildRoot:     %{_tmppath}/%{name}-root

libnetfilter_queue is a userspace library providing an API to packets that have
been queued by the kernel packet filter. It is is part of a system that
deprecates the old ip_queue / libipq mechanism.

%package -n %{realname}-devel
Group:         Development/Languages/C and C++
Summary:       Development files for %{name}
Requires:      %{name} = %{version}

%description -n %{realname}-devel
Development files for %{name}

# Preparation step (unpackung and patching if necessary)
%setup -q -n %{realname}-%{realver}%{?extraver}

%configure \
 --disable-static \
 CFLAGS="%{optflags} %{?gcc_lto}" \
 CXXFLAGS="%{optflags} %{?gcc_lto}" \
 LDFLAGS="-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}"
%__make %{?_smp_mflags}

%__make install DESTDIR=%{buildroot}

[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}


# Development stuff
%files -n %{realname}-devel
%exclude %{_libdir}/*.la

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


%changelog -n %{realname}-devel