File libnet.spec of Package libnet

# spec file for package libnet (Version
# 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

# norootforbuild

Name:           libnet
Summary:        A C Library for Portable Packet Creation
Release:        140
License:        BSD 3-Clause
Group:          System/Libraries
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

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.

    Mike D. Schiffman <>

%setup -q -n libnet

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

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}/ %{buildroot}%{_libdir}/
%{__rm} -v %{buildroot}/%{_lib}/

rm -rf  %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%doc doc/* sample 
%doc  %{_mandir}/man3/*

* Tue Sep 09 2008
- 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
- 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
- fixed permissions of man pages [#254335]
* Fri Feb 17 2006
- fixed subscription beyond array and uninitialized variable [#151312]
* Wed Jan 25 2006
- converted neededforbuild to BuildRequires
* Mon Sep 19 2005
- fixed some gcc warnings
* Thu Nov 18 2004
- fixed file list
* Wed Aug 04 2004
- updated to version
* Wed Feb 11 2004
- removed compiled files from /usr/share/doc/packages/libnet/sample
* Tue Feb 10 2004
- updated to version 1.1.1
- removed obsoleted patches: autoconf-fix.diff, samples.diff
- fixed code that broke strict aliasing
* Sun Jan 11 2004
- add %%run_ldconfig
* Wed Aug 13 2003
- build also shared library
* Thu Jul 24 2003
- honor detected endianess.
* Thu Jul 24 2003
- update to version 1.1.0
* Mon Nov 11 2002
- fixed deprecated multiline string literals
* Wed Jan 09 2002
- use %%{_libdir}
* Wed Feb 14 2001
- update to version 1.0.2a
- clean up spec file
* Fri Nov 17 2000
- initial package (version 1.0.1b)