Sophie

Sophie

distrib > Mandriva > mes5 > i586 > by-pkgid > 1f1b1fda284339fa510ab23710c8ae6d > files > 4

libnet1.1.2-1.1.2.1-7mdv2009.0.src.rpm

%define	major 1.1.2
%define libname	%mklibname net %{major}

Summary:	A C library for portable packet creation
Name:		libnet%{major}
Version:	1.1.2.1
Release:	%mkrel 7
License:	BSD
Group:		System/Libraries
URL:		http://www.packetfactory.net/libnet
Source0:	http://www.packetfactory.net/libnet/dist/libnet-%{version}.tar.bz2
Patch0:		libnet-1.1.2.1-shared.diff
Patch1:		libnet-1.1.2.1-dhcp_probe.diff
BuildRequires:	libpcap-devel
BuildRequires:	autoconf2.5
BuildRequires:	automake1.7
BuildRequires:	libtool
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description
Libnet is a high-level API (toolkit) allowing the application
programmer to construct and inject network packets. It provides a
portable and simplified interface for low-level network packet
shaping, handling and injection. Libnet hides much of the tedium
of packet creation from the application programmer such as
multiplexing, buffer management, arcane packet header information,
byte-ordering, OS-dependent issues, and much more. Libnet features
portable packet creation interfaces at the IP layer and link
layer, as well as a host of supplementary and complementary
functionality. Using libnet, quick and simple packet assembly
applications can be whipped up with little effort. With a bit more
time, more complex programs can be written (Traceroute and ping
were easily rewritten using libnet and libpcap). 

%if "%{_lib}" != "lib"
%package -n	%{libname}
Summary:	A C library for portable packet creation
Group: 		System/Libraries

%description -n	%{libname}
Libnet is a high-level API (toolkit) allowing the application
programmer to construct and inject network packets. It provides a
portable and simplified interface for low-level network packet
shaping, handling and injection. Libnet hides much of the tedium
of packet creation from the application programmer such as
multiplexing, buffer management, arcane packet header information,
byte-ordering, OS-dependent issues, and much more. Libnet features
portable packet creation interfaces at the IP layer and link
layer, as well as a host of supplementary and complementary
functionality. Using libnet, quick and simple packet assembly
applications can be whipped up with little effort. With a bit more
time, more complex programs can be written (Traceroute and ping
were easily rewritten using libnet and libpcap). 
%endif

%package -n	%{libname}-devel
Summary:	Development library and header files for the libnet library
Group:		Development/C
Requires:	%{libname} = %{version}-%{release}
Provides:	libnet%{major}-devel = %{version}-%{release}
Provides:	net-devel = %{version}-%{release}
Provides:	net2-devel = %{version}-%{release}
Provides:	%{mklibname net 2}-devel = %{version}-%{release}
Obsoletes:	%{mklibname net 2}-devel
Conflicts:	%{mklibname net 1.0.2}-devel
Conflicts:	%{mklibname net 1.1.0}-devel

%description -n	%{libname}-devel
Libnet is a high-level API (toolkit) allowing the application
programmer to construct and inject network packets. It provides a
portable and simplified interface for low-level network packet
shaping, handling and injection. Libnet hides much of the tedium
of packet creation from the application programmer such as
multiplexing, buffer management, arcane packet header information,
byte-ordering, OS-dependent issues, and much more. Libnet features
portable packet creation interfaces at the IP layer and link
layer, as well as a host of supplementary and complementary
functionality. Using libnet, quick and simple packet assembly
applications can be whipped up with little effort. With a bit more
time, more complex programs can be written (Traceroute and ping
were easily rewritten using libnet and libpcap). 

This package contains the development library and its header files
for the libnet library.

%package -n	%{libname}-static-devel
Summary:	Static development library for the libnet library
Group:		Development/C
Requires:	%{libname}-devel = %{version}-%{release}
Provides:	libnet%{major}-static-devel = %{version}-%{release}
Provides:	%{mklibname net 2}-devel = %{version}-%{release}
Obsoletes:	%{mklibname net 2}-devel
Conflicts:	%{mklibname net 1.0.2}-static-devel
Conflicts:	%{mklibname net 1.1.0}-static-devel

%description	-n %{libname}-static-devel
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 (use libnet in conjunction with libpcap and
you can write some really cool stuff).  Libnet includes packet creation
at the IP layer and at the link layer as well as a host of supplementary
and complementary functionalty. Libnet is avery handy with which to
write network tools and network test code.  See the manpage and sample
test code for more detailed information

This package contains the static libnet library.

%prep

%setup -q -n libnet
%patch0 -p1
%patch1 -p1

# cvs cleanup
for i in `find . -type d -name CVS` `find . -type f -name .cvs\*` `find . -type f -name .#\*`; do
    if [ -e "$i" ]; then rm -rf $i; fi >&/dev/null
done
	
%build
rm -rf autom4te.cache
export WANT_AUTOCONF_2_5=1
rm -f configure
libtoolize --copy --force; aclocal-1.7; autoconf; automake-1.7 --add-missing

export LIBNET_CONFIG_CFLAGS="-I%{_includedir}/libnet"
export CFLAGS="%{optflags} -fPIC"

%configure2_5x \
    --with-pf_packet=yes 

%make CFLAGS="%{optflags} -fPIC"

# still we need to make sure the soname is 1.1.2, so..., make the shared lib the hard way
gcc -Wl,-soname,libnet.so.%{major} -shared %{optflags} -fPIC -o libnet.so.%{major} src/*.o

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

install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_mandir}/man3

%makeinstall_std

install -m755 libnet-config %{buildroot}%{_bindir}/

# install man pages
install -m0644 doc/man/man3/* %{buildroot}%{_mandir}/man3/

# fix the lib
rm -f %{buildroot}%{_libdir}/lib*.so*
install -m0755 libnet.so.%{major} %{buildroot}%{_libdir}/
ln -snf libnet.so.%{major} %{buildroot}%{_libdir}/libnet.so

# cleanup
rm -f %{buildroot}%{_libdir}/lib*.la

%if %mdkversion < 200900
%post -n %{libname} -p /sbin/ldconfig
%endif

%if %mdkversion < 200900
%postun -n %{libname} -p /sbin/ldconfig
%endif

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

%files -n %{libname}
%defattr(-,root,root)
%doc README doc/CHANGELOG
%attr(0755,root,root) %{_libdir}/*.so.*

%files -n %{libname}-devel
%defattr(-,root,root)
%doc doc/BUGS doc/CHANGELOG doc/CONTRIB doc/DESIGN_NOTES
%doc doc/MIGRATION doc/PACKET_BUILDING doc/PORTED
%doc doc/RAWSOCKET_NON_SEQUITUR doc/TODO doc/html
%attr(0755,root,root) %{_bindir}/libnet-config
%attr(0644,root,root) %{_includedir}/libnet.h
%dir %{_includedir}/libnet
%attr(0644,root,root) %{_includedir}/libnet/*.h
%attr(0755,root,root) %{_libdir}/*.so
%attr(0644,root,root) %{_mandir}/man3/*

%files -n %{libname}-static-devel
%defattr(-,root,root)
%attr(0644,root,root) %{_libdir}/lib*.a


%changelog
* Wed Aug 06 2008 Thierry Vignaud <tvignaud@mandriva.com> 1.1.2.1-7mdv2009.0
+ Revision: 264848
- rebuild early 2009.0 package (before pixel changes)

  + Pixel <pixel@mandriva.com>
    - do not call ldconfig in %%post/%%postun, it is now handled by filetriggers

* Thu May 29 2008 Oden Eriksson <oeriksson@mandriva.com> 1.1.2.1-6mdv2009.0
+ Revision: 213001
- rebuild

* Sun Jan 13 2008 Thierry Vignaud <tvignaud@mandriva.com> 1.1.2.1-5mdv2008.1
+ Revision: 150716
- rebuild
- kill re-definition of %%buildroot on Pixel's request

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

* Sun Aug 19 2007 Oden Eriksson <oeriksson@mandriva.com> 1.1.2.1-4mdv2008.0
+ Revision: 66940
- fix buildprereq rpmlint upload blocker


* Wed Nov 01 2006 Oden Eriksson <oeriksson@mandriva.com> 1.1.2.1-3mdv2007.0
+ Revision: 74837
- Import libnet1.1.2

* Wed Jul 26 2006 Oden Eriksson <oeriksson@mandriva.com> 1.1.2.1-3mdk
- rebuild

* Fri Mar 17 2006 Oden Eriksson <oeriksson@mandriva.com> 1.1.2.1-2mdk
- fix deps

* Fri Mar 17 2006 Oden Eriksson <oeriksson@mandriva.com> 1.1.2.1-1mdk
- the libnet cleanup campaign

* Thu Oct 06 2005 Oden Eriksson <oeriksson@mandriva.com> 1.1.2.1-4mdk
- added P1 to make dhcp_probe compile
- fix naming

* Wed Jan 19 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 1.1.2.1-3mdk
- add a virtual provides to make it easier to distinguise this 
  package from other libnet packages
- update descriptions

* Tue Jan 11 2005 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.2.1-2mdk
- fix typo in description (kelk1)

* Sat Jun 26 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 1.1.2.1-1mdk
- 1.1.2.1
- added P0 (PLD)
- use the %%configure2_5x macro
- true libifiction