File libpcapnav.spec of Package libpcapnav

#
# spec file for package libpcapnav
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define soname 0

Name:           libpcapnav
Version:        0.8
Release:        0
Summary:        Tcpdump Tracefile Navigation Library
Source:         libpcapnav-%{version}.tar.bz2
Url:            http://netdude.sourceforge.net/
Group:          System/Libraries
# sf homepage claims BSD, but COPYING is MIT
License:        MIT
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  libpcap-devel
BuildRequires:  gcc glibc-devel make
Patch1:         fix-includes.patch
Patch2:         fix-noreturn-in-nonvoid.patch

%description
The purpose of this library is to read tcpdump trace files with the ability to
navigate around in the file between reads.
The API is intentionally much like that of the pcap library.

You can navigate in trace files both in time and space: you can jump to a
packet which is at appr. 2/3 of the trace, or you can jump as closely as
possible to a packet with a given timestamp, and then read packets from
there. In addition, the API provides convenience functions for manipulating
timeval structures.

%package -n %{name}%{soname}
Summary:        Tcpdump Tracefile Navigation Library
Group:          System/Libraries
Provides:       %{name} = %{version}

%description -n libpcapnav0
The purpose of this library is to read tcpdump trace files with the ability to
navigate around in the file between reads.
The API is intentionally much like that of the pcap library.

You can navigate in trace files both in time and space: you can jump to a
packet which is at appr. 2/3 of the trace, or you can jump as closely as
possible to a packet with a given timestamp, and then read packets from
there. In addition, the API provides convenience functions for manipulating
timeval structures.

%package devel
Summary:        Tcpdump Tracefile Navigation Library
Group:          Development/Libraries/C and C++
Requires:       %{name}%{soname} = %{version}
Requires:       libpcap-devel

%description devel
The purpose of this library is to read tcpdump trace files with the ability to
navigate around in the file between reads.
The API is intentionally much like that of the pcap library.

You can navigate in trace files both in time and space: you can jump to a
packet which is at appr. 2/3 of the trace, or you can jump as closely as
possible to a packet with a given timestamp, and then read packets from
there. In addition, the API provides convenience functions for manipulating
timeval structures.

%prep
%setup -q
%patch1 -p1
%patch2 -p1

%build
%configure --disable-gtk-doc
%__make %{?jobs:-j%{jobs}}

%install
%makeinstall
%__rm -rf "%{buildroot}%{_datadir}/gtk-doc"

%__install -d "%{buildroot}%{_docdir}/%{name}%{soname}"
echo -n > RPMDOCS
for f in AUTHORS ChangeLog COPYING README; do
	echo "%doc %{_docdir}/%{name}%{soname}/$f" >> RPMDOCS
	%__install -m0644 "$f" "%{buildroot}%{_docdir}/%{name}%{soname}/$f"
done
%__cp -r docs/html "%{buildroot}%{_docdir}/%{name}%{soname}/"
%__cp -r docs/images "%{buildroot}%{_docdir}/%{name}%{soname}/html/"

%clean
%__rm -rf "%{buildroot}"

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

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

%files -n %{name}%{soname} -f RPMDOCS
%defattr(-,root,root)
%dir %doc %{_docdir}/%{name}%{soname}
%{_libdir}/%{name}.so.%{soname}
%{_libdir}/%{name}.so.%{soname}.*

%files devel
%defattr(-,root,root)
%doc %{_docdir}/%{name}%{soname}/html
%{_bindir}/pcapnav-config
%{_includedir}/pcapnav.h
%{_libdir}/%{name}.so
%{_libdir}/%{name}.la
%{_libdir}/%{name}.a

%changelog
openSUSE Build Service is sponsored by