- Upgrade to 1.1.3
- Enabled a shared library and made lots of spec file cleanups
This commit is contained in:
parent
5695b4eab1
commit
3950dbb379
@ -1 +1 @@
|
||||
libnet-1.1.2.1.tar.gz
|
||||
libnet-1.1.3.tar.gz
|
||||
|
@ -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);
|
130
libnet.spec
130
libnet.spec
@ -1,92 +1,98 @@
|
||||
Summary: C library for portable packet creation and injection
|
||||
Name: libnet
|
||||
Version: 1.1.2.1
|
||||
Release: 13%{?dist}
|
||||
License: BSD
|
||||
Group: System Environment/Libraries
|
||||
URL: http://www.packetfactory.net/libnet/
|
||||
Source0: http://www.packetfactory.net/libnet/dist/libnet-%{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)
|
||||
Summary: C library for portable packet creation and injection
|
||||
Name: libnet
|
||||
Version: 1.1.3
|
||||
Release: 1%{?dist}
|
||||
License: BSD
|
||||
Group: System Environment/Libraries
|
||||
URL: http://www.sourceforge.net/projects/libnet-dev/
|
||||
Source: http://downloads.sourceforge.net/libnet-dev/%{name}-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
%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 (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 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.
|
||||
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 functionality.
|
||||
|
||||
%package devel
|
||||
Summary: Development files for libnet
|
||||
Group: Development/Libraries
|
||||
Provides: %{name} = %{version}-%{release}
|
||||
Provides: %{name}-static = %{version}-%{release}
|
||||
Summary: Development files for the libnet library
|
||||
Group: Development/Libraries
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description 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 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.
|
||||
|
||||
The libnet-devel package includes header files and libraries necessary
|
||||
for developing programs which use the libnet library. 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
|
||||
%setup -q -n libnet
|
||||
%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
|
||||
%setup -q
|
||||
|
||||
|
||||
%build
|
||||
# keep the sample directory untouched by make
|
||||
# Keep the sample directory untouched by make
|
||||
rm -rf __dist_sample
|
||||
mkdir __dist_sample
|
||||
mkdir __dist_sample
|
||||
cp -a sample __dist_sample
|
||||
|
||||
export CFLAGS="%{optflags} -fPIC"
|
||||
%configure --disable-dependency-tracking
|
||||
%build
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
make DESTDIR=%{buildroot} install INSTALL='install -c -p'
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p' install
|
||||
|
||||
mkdir -p %{buildroot}%{_bindir} %{buildroot}%{_mandir}/man3
|
||||
install -p -m0755 libnet-config %{buildroot}%{_bindir}/libnet-config
|
||||
install -p -m0644 doc/man/man3/libnet*.3 %{buildroot}%{_mandir}/man3/
|
||||
# Don't install any static .a and libtool .la files
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}.{a,la}
|
||||
|
||||
# prepare samples directory
|
||||
# Prepare samples directory and perform some fixes
|
||||
rm -rf __dist_sample/sample/win32
|
||||
rm __dist_sample/sample/Makefile.in
|
||||
sed -i -e 's:#include "../include/libnet.h":#include <libnet.h>:' __dist_sample/sample/libnet_test.h
|
||||
rm -f __dist_sample/sample/Makefile.{am,in}
|
||||
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
|
||||
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
|
||||
%defattr(-,root,root,-)
|
||||
%doc README VERSION
|
||||
%doc doc/BUGS doc/CHANGELOG doc/CONTRIB doc/COPYING doc/DESIGN_NOTES
|
||||
%doc doc/MIGRATION doc/PACKET_BUILDING doc/PORTED doc/RAWSOCKET_NON_SEQUITUR
|
||||
%doc doc/TODO doc/html/ __dist_sample/sample/
|
||||
|
||||
%{_bindir}/libnet-config
|
||||
%{_includedir}/libnet/
|
||||
%doc doc/BUGS doc/DESIGN_NOTES doc/MIGRATION doc/PACKET_BUILDING
|
||||
%doc doc/RAWSOCKET_NON_SEQUITUR doc/TODO doc/html/ __dist_sample/sample/
|
||||
%{_bindir}/%{name}-config
|
||||
%{_libdir}/%{name}.so
|
||||
%{_includedir}/libnet.h
|
||||
%{_libdir}/libnet.a
|
||||
%{_mandir}/man3/libnet*
|
||||
|
||||
%{_includedir}/%{name}/
|
||||
%{_mandir}/man3/%{name}*.3*
|
||||
|
||||
%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
|
||||
- Rebuild against gcc 4.4 and rpm 4.6
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user