File libdaq.spec of Package libdaq

# norootforbuild

%define soname 1

Name:           libdaq
Version:        1.1.1
Release:        1.3
License:        GPL-2.0
Group:          Productivity/Networking/System
Url:            http://www.snort.org/snort-downloads
Source:         daq-%{version}.tar.bz2
Patch1:         libdaq-fix-fsf-address.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  libdnet-devel
BuildRequires:  libpcap-devel >= 1.0.0
BuildRequires:  pkg-config
%if 0%{?suse_version} > 1120
%if 0%{?suse_version} > 1210
BuildRequires:  libipq-devel
%else
BuildRequires:  iptables-devel
%endif
BuildRequires:  libnetfilter_queue-devel
%endif

Summary:        Data Acquisition library, for packet I/O

%description
Data Acquisition library, for packet I/O.  The
DAQ replaces direct calls to PCAP functions with an abstraction layer that
facilitates operation on a variety of hardware and software interfaces without
requiring changes to Snort.  It is possible to select the DAQ type and mode
when invoking Snort to perform PCAP readback or inline operation, etc.  The
DAQ library may be useful for other packet processing applications and the
modular nature allows you to build new modules for other platforms.

%package -n %{name}%{soname}
Group:          System/Libraries
Summary:        Data Acquisition library, for packet I/O

%description -n %{name}%{soname}
Data Acquisition library, for packet I/O.  The
DAQ replaces direct calls to PCAP functions with an abstraction layer that
facilitates operation on a variety of hardware and software interfaces without
requiring changes to Snort.  It is possible to select the DAQ type and mode
when invoking Snort to perform PCAP readback or inline operation, etc.  The
DAQ library may be useful for other packet processing applications and the
modular nature allows you to build new modules for other platforms.

%package devel
Group:          Development/Libraries/C and C++
Requires:       %{name}%{soname} = %{version}
Requires:       daq-modules = %{version}

%if 0%{?suse_version} > 1120
%if 0%{?suse_version} > 1210
Requires:       libipq-devel
%else
Requires:       iptables-devel
%endif
Requires:       libnetfilter_queue-devel
%endif

Summary:        Data Acquisition library, for packet I/O

%description devel
Data Acquisition library, for packet I/O.  The
DAQ replaces direct calls to PCAP functions with an abstraction layer that
facilitates operation on a variety of hardware and software interfaces without
requiring changes to Snort.  It is possible to select the DAQ type and mode
when invoking Snort to perform PCAP readback or inline operation, etc.  The
DAQ library may be useful for other packet processing applications and the
modular nature allows you to build new modules for other platforms.

%package -n daq-modules
Group:          System/Libraries
Summary:        Bundled DAQ modules

%description -n daq-modules
Contains the DAQ modules that come bundled with the base LibDAQ distribution.



%prep
%setup -qn daq-%{version}
%patch1 -p1

%build
export CPPFLAGS="$CPPFLAGS $(pkg-config --libs --cflags libipq) $(pkg-config --libs --cflags libnetfilter_queue)"
%configure --disable-static
%__make %{?_smp_mflags}

%install
%makeinstall
find %{buildroot} -name "*.la" -delete

%post -n %{name}%{soname} -p /sbin/ldconfig

%postun -n %{name}%{soname} -p /sbin/ldconfig

%clean
test "%{buildroot}" != "/" && %__rm -rf "%{buildroot}"

%files -n %{name}%{soname}
%defattr(-,root,root)
%{_libdir}/*.so.*
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root)
%{_bindir}/daq-modules-config
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/*.a

%files -n daq-modules
%defattr(-,root,root)
%{_libdir}/daq

%changelog
* Thu Aug  9 2012 luizluca@gmail.com 1.1.1-1.2
- Updated to 1.1.1
* Sun Nov  6 2011 bitshuffler@opensuse.org
- Updated to 0.6.2
* Tue Dec 21 2010 bitshuffler@opensuse.org
- Update to 0.5
* Thu Dec  2 2010 bitshuffler@opensuse.org
- Update to 0.4
* Sun Nov  7 2010 bitshuffler@opensuse.org
- Update to 0.3
* Thu Oct 21 2010 bitshuffler@opensuse.org
- Initial package