rpms/libnet10/F-11 libnet10-1.0.2a-fedora.patch, NONE, 1.1 libnet10-1.0.2a-gcc33.patch, NONE, 1.1 libnet10-config.1, NONE, 1.1 libnet10.spec, 1.17, 1.18 libnet10-1.0.2a-apivers.patch, 1.1, NONE libnet10-gcc33.patch, 1.1, NONE

Robert Scheck robert at fedoraproject.org
Sat Apr 18 20:08:09 UTC 2009


Author: robert

Update of /cvs/pkgs/rpms/libnet10/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22028/F-11

Modified Files:
	libnet10.spec 
Added Files:
	libnet10-1.0.2a-fedora.patch libnet10-1.0.2a-gcc33.patch 
	libnet10-config.1 
Removed Files:
	libnet10-1.0.2a-apivers.patch libnet10-gcc33.patch 
Log Message:
Enabled a shared library and made lots of spec file cleanups


libnet10-1.0.2a-fedora.patch:

--- NEW FILE libnet10-1.0.2a-fedora.patch ---
Patch by Robert Scheck <robert at fedoraproject.org> for libnet >= 1.0.2a, which changes the
configure and Makefiles that way, that a shared library is available and the whole package
is called libnet10 rather libnet.

--- Libnet-1.0.2a/configure.in				2001-01-17 21:59:30.000000000 +0100
+++ Libnet-1.0.2a/configure.in.fedora			2009-04-18 19:05:06.000000000 +0200
@@ -8,6 +8,14 @@
 
 AC_INIT(src/libnet_build_ip.c)
 
+dnl
+dnl Determine hosttype and set the root install directory.
+dnl
+AC_CANONICAL_SYSTEM
+AC_PREFIX_DEFAULT(/usr)
+
+AM_INIT_AUTOMAKE(libnet, 1.0.2a)
+
 VER=`cat VERSION`
 AC_MSG_RESULT(Beginning autoconfiguration process for libnet-$VER...)
 
@@ -25,16 +33,14 @@
 AC_SUBST(LIBNET_CONFIG_LIBS)
 AC_SUBST(LIBNET_CONFIG_CFLAGS)
 
-dnl
-dnl Determine hosttype and set the root install directory.
-dnl
-AC_CANONICAL_SYSTEM
-AC_PREFIX_DEFAULT(/usr)
-
 if test "$prefix" = "NONE"; then
     prefix="/usr"
 fi
 
+if test "$mandir" = "NONE"; then
+    mandir="$prefix/man"
+fi
+
 dnl
 dnl Check compiler type.
 dnl
@@ -51,7 +57,7 @@
 dnl
 if test $ac_cv_prog_gcc = yes; then
 dnl if test -z $CFLAGS; then 
-    CCOPTS='-O2 -funroll-loops -fomit-frame-pointer -Wall'
+    CCOPTS="-O2 -funroll-loops -fomit-frame-pointer -Wall $CFLAGS"
     CFLAGS="$CCOPTS"
 dnl fi
 fi
@@ -74,6 +80,8 @@
 AC_CHECK_PROGS(AR, ar, @true)
 AC_CHECK_PROGS(LN, ln, @true)
 
+AC_PROG_LIBTOOL
+
 dnl
 dnl Check for library functions.
 dnl
@@ -110,7 +118,7 @@
     AC_DEFINE(HAVE_DLPI)
 elif test -r /usr/include/linux/socket.h ; then
     LL_INT_TYPE=sockpacket
-    AC_MSG_RESULT(found SOCK_PACKET)
+    AC_MSG_RESULT(found linux primitives)
     if test $with_pf_packet = yes; then
          AC_LIBNET_CHECK_PF_PACKET
     fi
@@ -147,7 +155,7 @@
     LIBNET_CONFIG_DEFINES="-D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD"
     AC_CHECK_HEADERS(net/ethernet.h, \
         LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_NET_ETHERNET_H")
-    MAN_PREFIX="$prefix/man/man3/"
+    MAN_PREFIX="$mandir/man3/"
     LIB_PREFIX="$prefix/lib/"
     INC_PREFIX="$prefix/include/"
     BIN_PREFIX="$prefix/bin/"
@@ -258,9 +266,6 @@
 
 AC_CHECK_HEADERS(sys/sockio.h)
 AC_CONFIG_HEADER(include/config.h)
-AC_OUTPUT(Makefile test/Makefile test/TCP/Makefile test/Ethernet/Makefile \
-    test/UDP/Makefile test/ICMP/Makefile test/Random/Makefile \
-    test/OSPF/Makefile util/Makefile util/Get-mac/Makefile example/Makefile \
-    libnet-config, chmod +x libnet-config)
+AC_OUTPUT(Makefile src/Makefile include/Makefile include/libnet/Makefile libnet-config)
 
 dnl EOF
--- Libnet-1.0.2a/acconfig.h				2000-12-12 19:31:39.000000000 +0100
+++ Libnet-1.0.2a/acconfig.h.fedora			2009-04-18 18:49:55.000000000 +0200
@@ -1,15 +1,17 @@
-dnl $Id: acconfig.h,v 1.1.1.1 2000/05/25 00:28:49 route Exp $
-dnl
-dnl Libnet autoconfiguration acconfig.h file
-dnl Copyright (c) 1998 - 2001 Mike D. Schiffman <mike at infonexus.com>
-dnl All rights reserved.
-dnl
-dnl Process this file with autoheader to produce a config.h file.
-dnl
+/* $Id: acconfig.h,v 1.1.1.1 2000/05/25 00:28:49 route Exp $
+ *
+ * Libnet autoconfiguration acconfig.h file
+ * Copyright (c) 1998 - 2001 Mike D. Schiffman <mike at infonexus.com>
+ * All rights reserved.
+ *
+ * Process this file with autoheader to produce a config.h file.
+ */
 
 #undef LIBNET_BSDISH_OS
 #undef LIBNET_BSD_BYTE_SWAP
 #undef DLPI_DEV_PREFIX
+#undef LIBNET_FAST_X86_CHECK
+#undef HAVE_SOLARIS
 #undef HAVE_DEV_DLPI
 #undef HAVE_SOCKADDR_SA_LEN
 #undef HAVE_DLPI
@@ -23,5 +25,3 @@
 #undef __FAVOR_BSD
 #undef LIBNET_BIG_ENDIAN
 #undef LIBNET_LIL_ENDIAN
-
-dnl EOF
--- Libnet-1.0.2a/Makefile.am				1970-01-01 01:00:00.000000000 +0100
+++ Libnet-1.0.2a/Makefile.am.fedora			2009-04-18 18:41:15.000000000 +0200
@@ -0,0 +1,7 @@
+AUTOMAKE_OPTIONS = foreign no-dependencies
+DISTCLEANFILES = *~
+SUBDIRS = src include
+EXTRA_DIST = Makefile.am.common
+bin_SCRIPTS = libnet-config
+version.h: VERSION
+	sed -e 's/.*/#define VERSION "&"/' < $< > $@
--- Libnet-1.0.2a/src/Makefile.am			1970-01-01 01:00:00.000000000 +0100
+++ Libnet-1.0.2a/src/Makefile.am.fedora		2009-04-18 18:43:52.000000000 +0200
@@ -0,0 +1,33 @@
+AUTOMAKE_OPTIONS = foreign no-dependencies
+DISTCLEANFILES = *~
+lib_LTLIBRARIES = libnet10.la
+libnet10_la_SOURCES = \
+	libnet_resolve.c \
+	libnet_socket.c \
+	libnet_checksum.c \
+	libnet_prand.c \
+	libnet_version.c \
+	libnet_write_ip.c \
+	libnet_insert_ipo.c \
+	libnet_insert_tcpo.c \
+	libnet_error.c \
+	libnet_link_ at LL_INT_TYPE@.c \
+	libnet_packet_mem.c \
+	libnet_build_ip.c \
+	libnet_build_tcp.c \
+	libnet_build_udp.c \
+	libnet_build_arp.c \
+	libnet_build_ethernet.c \
+	libnet_build_icmp.c \
+	libnet_build_igmp.c \
+	libnet_build_dns.c \
+	libnet_build_snmp.c \
+	libnet_build_rip.c \
+	libnet_build_ospf.c \
+	libnet_build_vrrp.c \
+	libnet_asn1.c \
+	libnet_hex_dump.c \
+	libnet_if_addr.c \
+	libnet_port_list.c
+libnet10_la_LIBADD = @LTLIBOBJS@
+libnet10_la_LDFLAGS = -version-info 0:0:0 # CURRENT[:REVISION[:AGE]]
--- Libnet-1.0.2a/include/Makefile.am			1970-01-01 01:00:00.000000000 +0100
+++ Libnet-1.0.2a/include/Makefile.am.fedora		2009-04-18 18:41:05.000000000 +0200
@@ -0,0 +1,4 @@
+AUTOMAKE_OPTIONS = foreign no-dependencies
+DISTCLEANFILES = *~
+SUBDIRS = libnet
+include_HEADERS = libnet.h
--- Libnet-1.0.2a/include/libnet/Makefile.am		1970-01-01 01:00:00.000000000 +0100
+++ Libnet-1.0.2a/include/libnet/Makefile.am.fedora	2009-04-18 18:42:02.000000000 +0200
@@ -0,0 +1,9 @@
+AUTOMAKE_OPTIONS = foreign no-dependencies
+DISTCLEANFILES = *~
+pkginclude_HEADERS = \
+	libnet-asn1.h \
+	libnet-functions.h \
+	libnet-headers.h \
+	libnet-macros.h \
+	libnet-ospf.h \
+	libnet-structures.h
--- Libnet-1.0.2a/version.h				1970-01-01 01:00:00.000000000 +0100
+++ Libnet-1.0.2a/version.h.fedora			2009-04-18 18:56:15.000000000 +0200
@@ -0,0 +1 @@
+#define VERSION "1.0.2a"
--- Libnet-1.0.2a/libnet-config.in			2000-12-12 19:33:42.000000000 +0100
+++ Libnet-1.0.2a/libnet-config.in.fedora		2009-04-18 21:30:00.000000000 +0200
@@ -8,13 +8,13 @@
 #   @configure_input@
 
 libnet_defines="@LIBNET_CONFIG_DEFINES@"
-libnet_cflags="@LIBNET_CONFIG_CFLAGS@"
-libnet_libs="@LIBNET_CONFIG_LIBS@ -lnet"
+libnet_cflags="@LIBNET_CONFIG_CFLAGS@ -I at includedir@/libnet10"
+libnet_libs="@LIBNET_CONFIG_LIBS@ -lnet10"
 
 usage()
 {
         cat <<EOF
-Usage: libnet-config [OPTIONS]
+Usage: libnet10-config [OPTIONS]
 Options:
         [--libs]
         [--cflags]

libnet10-1.0.2a-gcc33.patch:

--- NEW FILE libnet10-1.0.2a-gcc33.patch ---
Patch by Robert Scheck <robert at fedoraproject.org> for libnet >= 1.0.2a, which adds
the missing quotations needed by GCC 3.3 and newer.

--- Libnet-1.0.2a/include/libnet.h		2001-02-07 00:19:25.000000000 +0100
+++ Libnet-1.0.2a/include/libnet.h.gcc33	2009-04-18 19:37:20.000000000 +0200
@@ -84,9 +84,9 @@
 #define LIBNET_VERSION  "1.0.2a"
 
 #if (!LIBNET_LIL_ENDIAN && !LIBNET_BIG_ENDIAN)
-#error "byte order has not been specified, you'll
-need to #define either LIBNET_LIL_ENDIAN or LIBNET_BIG_ENDIAN.  See the
-documentation regarding the libnet-config script."
+#error "byte order has not been specified, you'll"
+"need to #define either LIBNET_LIL_ENDIAN or LIBNET_BIG_ENDIAN.  See the"
+"documentation regarding the libnet-config script."
 #endif
 
 #endif  /* __LIBNET_H */


--- NEW FILE libnet10-config.1 ---
.\" Written by Domenico Andreoli for Debian GNU/Linux.
.\" Do whatever you want with this file.
.\" NO warranty is provided.
.TH libnet10-config 1 "18 January 2002" "Libnet 1.0.2a" "libnet10-config manual"
.SH NAME
libnet10-config \- Get information about a libnet installation
.SH SYNOPSIS
.B libnet10-config [options]
.SH DESCRIPTION
.B libnet10-config
displays information about a previous libnet installation.
.SH OPTIONS
.IP "--cflags"
Set of compiler options (CFLAGS) to use when compiling files that use
libnet.
.IP "--libs"
Shows the complete set of libs and other linker options you will need in order
to link your application with libnet.
.IP "--defines"
Set of compiler defines used to compile libnet.
.SH "EXAMPLES"
What linker options do I need when I link with libnet?

  libnet10-config --libs

What compiler options do I need when I compile using libnet functions?

  libnet10-config --cflags
.SH SEE ALSO
.BR libnet10 (3)
.SH AUTHOR
This manual page was written by Domenico Andreoli <cavok at debian.org>
for the Debian GNU/Linux system (but may be used by others).


Index: libnet10.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libnet10/F-11/libnet10.spec,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- libnet10.spec	23 Feb 2009 21:20:16 -0000	1.17
+++ libnet10.spec	18 Apr 2009 20:07:38 -0000	1.18
@@ -1,21 +1,16 @@
-Summary:        High-level API (toolkit) to construct and inject network packets
-Name:           libnet10
-Version:        1.0.2a
-Release:        16%{?dist}
-URL:            http://www.packetfactory.net/libnet/
-License:        BSD
-Group:          System Environment/Libraries
-Source0:        http://www.packetfactory.net/libnet/dist/deprecated/libnet-1.0.2a.tar.gz
-Patch0:         libnet10-gcc33.patch
-# add an api version prefix, keep timestamps and correct permissions
-Patch1:         libnet10-1.0.2a-apivers.patch
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-#Obsoletes:      libnet < 1.1.0
-#Obsoletes:      libnet-devel < 1.1.0
-#Provides:       libnet = %{version}-%{release}
-#Provides:       libnet-devel = %{version}-%{release}
-Provides:       libnet10-devel = %{version}-%{release}
-Provides:       libnet10-static = %{version}-%{release}
+Summary:	High-level API (toolkit) to construct and inject network packets
+Name:		libnet10
+Version:	1.0.2a
+Release:	17%{?dist}
+License:	BSD
+Group:		System Environment/Libraries
+URL:		http://www.packetfactory.net/libnet/
+Source0:	http://www.packetfactory.net/libnet/dist/deprecated/libnet-%{version}.tar.gz
+Source1:	libnet10-config.1
+Patch0:		libnet10-1.0.2a-fedora.patch
+Patch1:		libnet10-1.0.2a-gcc33.patch
+BuildRequires:	%{_includedir}/pcap.h, libtool, autoconf, automake
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 %description
 Libnet is a high-level API (toolkit) allowing the application programmer to
@@ -23,58 +18,83 @@
 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 an old and deprecated version of libnet. You need
-it only if the software you are using hasn't been updated to work with
-the newer version and the newer API.
+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.
+
+This package contains an old and deprecated version of libnet. You need it
+only if the software you are using hasn't been updated to work with the newer
+version and the newer API.
+
+%package devel
+Summary:	Development files for the libnet library
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description devel
+The libnet10-devel package includes header files and libraries necessary for
+developing programs which use the libnet library. 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 an old and deprecated version of libnet. You need it
+only if the software you are using hasn't been updated to work with the newer
+version and the newer API.
 
 %prep
 %setup -q -n Libnet-%{version}
-%patch0 -p1 -b .gcc33
-%patch1 -p1 -b .apivers
-# The original config.{guess,sub} do not work on ppc64
-#
-# The following /usr/lib cannot be %%_libdir !!
-cp -p /usr/lib/rpm/config.{guess,sub} .
+%patch0 -p1 -b .fedora
+%patch1 -p1 -b .gcc33
 
+# Required to apply changes from Patch0
+autoreconf -i -f
 
 %build
-%configure
-make %{?_smp_mflags} CFLAGS="${RPM_OPT_FLAGS}"
-
+%configure --with-pf_packet=yes
+make %{?_smp_mflags}
 
 %install
-rm -rf ${RPM_BUILD_ROOT}
-make install DESTDIR=${RPM_BUILD_ROOT}
-mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/libnet-1.0
-ln -s ../libnet-1.0.a ${RPM_BUILD_ROOT}%{_libdir}/libnet-1.0/libnet.a
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p' install
 
-mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man3/
-mv ${RPM_BUILD_ROOT}/usr/man/man3/* ${RPM_BUILD_ROOT}%{_mandir}/man3/
+# Complete the package renaming at missing places
+mkdir -p $RPM_BUILD_ROOT%{_includedir}/%{name}/
+mv -f $RPM_BUILD_ROOT%{_includedir}/{libnet{,.h},%{name}}
+mv -f $RPM_BUILD_ROOT%{_bindir}/libnet{,10}-config
+
+# Install all man pages to their appropriate place
+mkdir -p $RPM_BUILD_ROOT%{_mandir}/man{1,3}/
+install -p -m 644 doc/libnet.3 $RPM_BUILD_ROOT%{_mandir}/man3/%{name}.3
+install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_mandir}/man1/%{name}-config.1
 
+# Don't install any static .a and libtool .la files
+rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}.{a,la}
 
 %clean
-rm -rf ${RPM_BUILD_ROOT}
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
 
+%postun -p /sbin/ldconfig
 
 %files
 %defattr(-,root,root,-)
 %doc README doc/COPYING doc/CHANGELOG
-%{_bindir}/libnet-config-1.0
-%{_includedir}/libnet-1.0/
-%{_libdir}/libnet-1.0.a
-%{_libdir}/libnet-1.0/
-%{_libdir}/libpwrite.a
-%{_mandir}/man3/libnet-1.0.3*
+%{_libdir}/%{name}.so.*
+%{_mandir}/man3/%{name}.3*
 
+%files devel
+%defattr(-,root,root,-)
+%{_bindir}/%{name}-config
+%{_libdir}/%{name}.so
+%{_mandir}/man1/%{name}-config.1*
+%{_includedir}/%{name}/
 
 %changelog
+* Sat Apr 18 2009 Robert Scheck <robert at fedoraproject.org> 1.0.2a-17
+- Enabled a shared library and made lots of spec file cleanups
+
 * Mon Feb 23 2009 Robert Scheck <robert at fedoraproject.org> 1.0.2a-16
 - Rebuild against gcc 4.4 and rpm 4.6
 


--- libnet10-1.0.2a-apivers.patch DELETED ---


--- libnet10-gcc33.patch DELETED ---




More information about the scm-commits mailing list