- Upgrade to 1.1.3

- Enabled a shared library and made lots of spec file cleanups
This commit is contained in:
Robert Scheck 2009-05-16 17:04:16 +00:00
parent 5695b4eab1
commit 3950dbb379
4 changed files with 70 additions and 87 deletions

View File

@ -1 +1 @@
libnet-1.1.2.1.tar.gz libnet-1.1.3.tar.gz

View File

@ -1,23 +0,0 @@
--- libnet-1.1.2.1.orig/src/libnet_checksum.c
+++ libnet-1.1.2.1/src/libnet_checksum.c
@@ -42,8 +42,10 @@
libnet_in_cksum(u_int16_t *addr, int len)
{
int sum;
+ u_int16_t last_byte;
sum = 0;
+ last_byte = 0;
while (len > 1)
{
@@ -52,7 +54,8 @@
}
if (len == 1)
{
- sum += *(u_int16_t *)addr;
+ *(u_int8_t*)&last_byte = *(u_int8_t*)addr;
+ sum += last_byte;
}
return (sum);

View File

@ -1,92 +1,98 @@
Summary: C library for portable packet creation and injection Summary: C library for portable packet creation and injection
Name: libnet Name: libnet
Version: 1.1.2.1 Version: 1.1.3
Release: 13%{?dist} Release: 1%{?dist}
License: BSD License: BSD
Group: System Environment/Libraries Group: System Environment/Libraries
URL: http://www.packetfactory.net/libnet/ URL: http://www.sourceforge.net/projects/libnet-dev/
Source0: http://www.packetfactory.net/libnet/dist/libnet-%{version}.tar.gz Source: http://downloads.sourceforge.net/libnet-dev/%{name}-%{version}.tar.gz
# excerpted from debian patcheset
Patch0: libnet-1.1.2.1-odd_chksum.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description %description
Libnet is an API to help with the construction and handling of network packets. Libnet is an API to help with the construction and handling of network
It provides a portable framework for low-level network packet writing and packets. It provides a portable framework for low-level network packet
handling (use libnet in conjunction with libpcap and you can write some really writing and handling (use libnet in conjunction with libpcap and you can
cool stuff). Libnet includes packet creation at the IP layer and at the link write some really cool stuff). Libnet includes packet creation at the IP
layer as well as a host of supplementary and complementary functionality. layer and at the link layer as well as a host of supplementary and
Libnet is very handy with which to write network tools and network test code. complementary functionality.
See the manpage and sample test code for more detailed information.
%package devel %package devel
Summary: Development files for libnet Summary: Development files for the libnet library
Group: Development/Libraries Group: Development/Libraries
Provides: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
Provides: %{name}-static = %{version}-%{release}
%description devel %description devel
Libnet is an API to help with the construction and handling of network packets. The libnet-devel package includes header files and libraries necessary
It provides a portable framework for low-level network packet writing and for developing programs which use the libnet library. Libnet is very handy
handling (use libnet in conjunction with libpcap and you can write some really with which to write network tools and network test code. See the manpage
cool stuff). Libnet includes packet creation at the IP layer and at the link and sample test code for more detailed information.
layer as well as a host of supplementary and complementary functionality.
Libnet is very handy with which to write network tools and network test code.
See the manpage and sample test code for more detailed information.
%prep %prep
%setup -q -n libnet %setup -q
%patch0 -p1 -b odd_chksum
sed -i -e 's/\r$//' doc/CHANGELOG doc/CONTRIB
find . -depth -type d -name CVS -exec rm -rf {} ';'
rm -f sample/.\#* sample/.*.swp
# Keep the sample directory untouched by make
%build
# keep the sample directory untouched by make
rm -rf __dist_sample rm -rf __dist_sample
mkdir __dist_sample mkdir __dist_sample
cp -a sample __dist_sample cp -a sample __dist_sample
export CFLAGS="%{optflags} -fPIC" %build
%configure --disable-dependency-tracking %configure
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
rm -rf %{buildroot} rm -rf $RPM_BUILD_ROOT
make DESTDIR=%{buildroot} install INSTALL='install -c -p' make DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p' install
mkdir -p %{buildroot}%{_bindir} %{buildroot}%{_mandir}/man3 # Don't install any static .a and libtool .la files
install -p -m0755 libnet-config %{buildroot}%{_bindir}/libnet-config rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}.{a,la}
install -p -m0644 doc/man/man3/libnet*.3 %{buildroot}%{_mandir}/man3/
# prepare samples directory # Prepare samples directory and perform some fixes
rm -rf __dist_sample/sample/win32 rm -rf __dist_sample/sample/win32
rm __dist_sample/sample/Makefile.in rm -f __dist_sample/sample/Makefile.{am,in}
sed -i -e 's:#include "../include/libnet.h":#include <libnet.h>:' __dist_sample/sample/libnet_test.h sed -e 's@#include "../include/libnet.h"@#include <libnet.h>@' \
__dist_sample/sample/libnet_test.h > __dist_sample/sample/libnet_test.h.new
touch -c -r __dist_sample/sample/libnet_test.h{,.new}
mv -f __dist_sample/sample/libnet_test.h{.new,}
# Remove makefile relics from documentation
rm -f doc/html/Makefile*
# Correct wrong line endings at CHANGELOG and CONTRIB
for file in CHANGELOG CONTRIB; do
sed -e 's/\r$//' doc/$file > doc/$file.new
touch -c -r doc/$file doc/$file.new
mv -f doc/$file.new doc/$file
done
%clean %clean
rm -rf %{buildroot} rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc README doc/CHANGELOG doc/CONTRIB doc/COPYING
%{_libdir}/%{name}.so.*
%files devel %files devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc README VERSION %doc doc/BUGS doc/DESIGN_NOTES doc/MIGRATION doc/PACKET_BUILDING
%doc doc/BUGS doc/CHANGELOG doc/CONTRIB doc/COPYING doc/DESIGN_NOTES %doc doc/RAWSOCKET_NON_SEQUITUR doc/TODO doc/html/ __dist_sample/sample/
%doc doc/MIGRATION doc/PACKET_BUILDING doc/PORTED doc/RAWSOCKET_NON_SEQUITUR %{_bindir}/%{name}-config
%doc doc/TODO doc/html/ __dist_sample/sample/ %{_libdir}/%{name}.so
%{_bindir}/libnet-config
%{_includedir}/libnet/
%{_includedir}/libnet.h %{_includedir}/libnet.h
%{_libdir}/libnet.a %{_includedir}/%{name}/
%{_mandir}/man3/libnet* %{_mandir}/man3/%{name}*.3*
%changelog %changelog
* Sat May 16 2009 Robert Scheck <robert@fedoraproject.org> 1.1.3-1
- Upgrade to 1.1.3
* Sun Apr 19 2009 Robert Scheck <robert@fedoraproject.org> 1.1.2.1-14
- Enabled a shared library and made lots of spec file cleanups
* Mon Feb 23 2009 Robert Scheck <robert@fedoraproject.org> 1.1.2.1-13 * Mon Feb 23 2009 Robert Scheck <robert@fedoraproject.org> 1.1.2.1-13
- Rebuild against gcc 4.4 and rpm 4.6 - Rebuild against gcc 4.4 and rpm 4.6

View File

@ -1 +1 @@
be845c41170d72c7db524f3411b50256 libnet-1.1.2.1.tar.gz 314e1b15286200d8601ad98333be14f4 libnet-1.1.3.tar.gz