%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 3 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.bz2 Patch1: libnet-1.1.2.1-dhcp_probe.diff BuildPreReq: libpcap-devel BuildRequires: autoconf2.5 BuildRequires: automake1.7 BuildRequires: libtool BuildRoot: %{_tmppath}/%{name}-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 %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig %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 Nov 01 2006 Oden Eriksson <oeriksson@mandriva.com> 1.1.2.1-3mdv2007.0 + Revision: 74837 - Import libnet1.1.2 * Tue Jul 25 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 * Wed Oct 05 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) * Fri Jun 25 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 * Wed Aug 20 2003 Frederic Lepied <flepied@mandrakesoft.com> 1.1.0-3mdk - libified * Fri Jul 18 2003 Per Øyvind Karlsen <peroyvind@sintrax.net> 1.1.0-2mdk - corrected license - don't rm -rf $RPM_BUILD_ROOT in %%pre - cosmetics * Thu Feb 06 2003 Lenny Cartier <lenny@mandrakesoft.com> 1.1.0-1mdk - 1.1.0 * Thu Jan 16 2003 Lenny Cartier <lenny@mandrakesoft.com> 1.0.2a-2mdk - rebuild - remove unwanted files * Tue Nov 13 2001 Florin <florin@mandrakesoft.com> 1.0.2a-1mdk - 1.0.2a * Mon Sep 24 2001 Lenny Cartier <lenny@mandrakesoft.com> 1.0.2-7mdk - fix permissions * Sun Jul 29 2001 Lenny Cartier <lenny@mandrakesoft.com> 1.0.2-6mdk - rebuild * Wed May 23 2001 Jeff Garzik <jgarzik@mandrakesoft.com> 1.0.2-5mdk - BuildRequires: libtool * Sun Apr 08 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 1.0.2-4mdk - Rebuild and up to 4mdk to get back the libnet main binary package. * Tue Feb 06 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 1.0.2-2mdk - fix the broken makefile which generated a broken rpm. - no need to manually install libnet-config. * Tue Feb 06 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 1.0.2-1mdk - new and shiny source. - put a versioning on the source tarball. - put a url in the source tag. - quiet setup so we don't get a load of crap. - removed libpwrite.a -> libnet.a symbolic linking. - removed buildroot before doing an %%install. - use the install command, not mv, when installing the manual page. - manually install libnet-config into /usr/bin. * Fri Nov 10 2000 Lenny Cartier <lenny@mandrakesoft.com> 1.0.1b-4mdk - more macros - rebuild for gcc-2.96 - delete CVS files * Thu Aug 24 2000 Lenny Cartier <lenny@mandrakesoft.com> 1.0.1b-3mdk - add macros - BM * Tue Apr 18 2000 Lenny Cartier <lenny@mandrakesoft.com> 1.0.1b-2mdk - v1.0.1b * Tue Mar 23 2000 Lenny Cartier <lenny@mandrakesoft.com> 1.0.1-1mdk - v1.0.1 * Sat Nov 13 1999 Giuseppe Ghibò <ghibo@linux-mandrake.com> - first SPEC file for Mandrake.