File libnet.spec of Package libnet

#
# spec file for package libnet (Version 1.1.2.1)
#
# Copyright (c) 2008 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


Name:           libnet
Summary:        A C Library for Portable Packet Creation
Version:        1.1.2.1
Release:        140
License:        BSD 3-Clause
Group:          System/Libraries
Url:            http://www.packetfactory.net/libnet/
Source:         %{name}.tar.bz2
Patch1:         %{name}-endianess-fix.diff
Patch2:         %{name}-shared.diff
Patch4:         %{name}-%{version}-makefile.diff
Patch5:         %{name}-%{version}-strict-aliasing-fix.diff
Patch6:         %{name}-%{version}-uninitialized-fix.diff
Patch7:         %{name}-%{version}-arrray-fix.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Libnet is an API to help with the construction and handling of network
packets. It provides a portable framework for low-level network packet
writing and handling. Libnet includes packet creation at the IP layer
and at the link layer as well as a host of supplementary and
complementary functionality. Libnet is very useful for writing network
tools and network test code. See the man page and sample test code for
more detailed information.



Authors:
--------
    Mike D. Schiffman <mike@infonexus.com>

%prep
%setup -q -n libnet
%patch1
%patch2
%patch4
%patch5
%patch6
%patch7

%build
autoreconf -fiv
CFLAGS="$RPM_OPT_FLAGS -Wall -Wno-unused" \
%configure --libdir=/%{_lib} --disable-static --with-pic
%{__make} %{?jobs:-j%jobs}

%install
make install DESTDIR=$RPM_BUILD_ROOT 
install -d -m 755 $RPM_BUILD_ROOT/{usr/bin/,%{_mandir}/man3}
install -m 755 libnet-config $RPM_BUILD_ROOT/usr/bin/
install -m 644 doc/man/man3/*.3 $RPM_BUILD_ROOT/%{_mandir}/man3
rm -rf `find -name "CVS" -type d` doc/man
rm -rf sample/{.libs,Makefile*} 
find sample -name "*.o" -o -type f -perm +111 |xargs rm -rf
%{__rm} -v %{buildroot}/%{_lib}/*.la
%{__install} -d -m 0755 %{buildroot}%{_libdir}
%{__ln_s} -v /%{_lib}/$(readlink %{buildroot}/%{_lib}/libnet.so) %{buildroot}%{_libdir}/libnet.so
%{__rm} -v %{buildroot}/%{_lib}/libnet.so

%clean
rm -rf  %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc doc/* sample 
%doc  %{_mandir}/man3/*
%{_bindir}/*
%{_includedir}/*
/%{_lib}/libnet.so.0*
%{_libdir}/libnet.so

%changelog
* Tue Sep 09 2008 crrodriguez@suse.de
- after removing static libraries, syslog-ng complains that are
  needed, so we move the shared library to /%%{_lib} to really fix
  the problem
* Thu Sep 04 2008 crrodriguez@suse.de
- remove "la" file with empty dependency_libs
- disable static libraries
- libpcap is no longer needed for this package
- configure option --with-pf_packet does not exists anymore
* Wed Mar 14 2007 anosek@suse.cz
- fixed permissions of man pages [#254335]
* Fri Feb 17 2006 lmichnovic@suse.cz
- fixed subscription beyond array and uninitialized variable [#151312]
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Sep 19 2005 mmarek@suse.cz
- fixed some gcc warnings
* Thu Nov 18 2004 ro@suse.de
- fixed file list
* Wed Aug 04 2004 postadal@suse.cz
- updated to version 1.1.2.1
* Wed Feb 11 2004 postadal@suse.cz
- removed compiled files from /usr/share/doc/packages/libnet/sample
* Tue Feb 10 2004 postadal@suse.cz
- updated to version 1.1.1
- removed obsoleted patches: autoconf-fix.diff, samples.diff
- fixed code that broke strict aliasing
* Sun Jan 11 2004 adrian@suse.de
- add %%run_ldconfig
* Wed Aug 13 2003 mjancar@suse.cz
- build also shared library
* Thu Jul 24 2003 meissner@suse.de
- honor detected endianess.
* Thu Jul 24 2003 postadal@suse.cz
- update to version 1.1.0
* Mon Nov 11 2002 postadal@suse.cz
- fixed deprecated multiline string literals
* Wed Jan 09 2002 cihlar@suse.cz
- use %%{_libdir}
* Wed Feb 14 2001 cihlar@suse.cz
- update to version 1.0.2a
- clean up spec file
* Fri Nov 17 2000 grimmer@suse.de
- initial package (version 1.0.1b)