# HG changeset patch # User Michael Schloh von Bennewitz # Date 1346602564 -7200 # Node ID fdb90fe1cf210ae5bc1f315156efb8ea425395ed # Parent 0f564e7490b9d82151e351855708edfe5f5f0c4c Import package vendor original spec for necessary manipulations. diff -r 0f564e7490b9 -r fdb90fe1cf21 tcpdump/tcpdump.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tcpdump/tcpdump.patch Sun Sep 02 18:16:04 2012 +0200 @@ -0,0 +1,162 @@ +Index: configure.in +--- configure.in.orig 2010-03-12 02:56:44.000000000 +0100 ++++ configure.in 2010-03-31 09:51:51.000000000 +0200 +@@ -739,10 +739,10 @@ + + if test $ac_cv_func_pcap_lib_version = "no" ; then + AC_MSG_CHECKING(whether pcap_version is defined by libpcap) +- AC_TRY_LINK([], ++ AC_TRY_LINK( + [ + extern char pcap_version[]; +- ++ ],[ + return (int)pcap_version; + ], + ac_lbl_cv_pcap_version_defined=yes, +@@ -755,10 +755,10 @@ + fi + fi + AC_MSG_CHECKING(whether pcap_debug is defined by libpcap) +-AC_TRY_LINK([], ++AC_TRY_LINK( + [ + extern int pcap_debug; +- ++ ],[ + return pcap_debug; + ], + ac_lbl_cv_pcap_debug_defined=yes, +@@ -772,10 +772,10 @@ + # OK, what about "yydebug"? + # + AC_MSG_CHECKING(whether yydebug is defined by libpcap) +- AC_TRY_LINK([], ++ AC_TRY_LINK( + [ + extern int yydebug; +- ++ ],[ + return yydebug; + ], + ac_lbl_cv_yydebug_defined=yes, +Index: ether.h +--- ether.h.orig 2010-03-12 02:56:44.000000000 +0100 ++++ ether.h 2010-03-31 09:51:51.000000000 +0200 +@@ -34,7 +34,9 @@ + * @(#)if_ether.h 8.3 (Berkeley) 5/2/95 + */ + ++#ifndef ETHERMTU + #define ETHERMTU 1500 ++#endif + + /* + * The number of bytes in an ethernet (MAC) address. +@@ -44,7 +46,7 @@ + /* + * Structure of a DEC/Intel/Xerox or 802.3 Ethernet header. + */ +-struct ether_header { ++struct tcpdump_ether_header { + u_int8_t ether_dhost[ETHER_ADDR_LEN]; + u_int8_t ether_shost[ETHER_ADDR_LEN]; + u_int16_t ether_type; +Index: print-ether.c +--- print-ether.c.orig 2010-03-12 02:56:44.000000000 +0100 ++++ print-ether.c 2010-03-31 09:55:05.000000000 +0200 +@@ -86,10 +86,10 @@ + static inline void + ether_hdr_print(register const u_char *bp, u_int length) + { +- register const struct ether_header *ep; ++ register const struct tcpdump_ether_header *ep; + u_int16_t ether_type; + +- ep = (const struct ether_header *)bp; ++ ep = (const struct tcpdump_ether_header *)bp; + + (void)printf("%s > %s", + etheraddr_string(ESRC(ep)), +@@ -123,7 +123,7 @@ + ether_print(const u_char *p, u_int length, u_int caplen, + void (*print_encap_header)(const u_char *), const u_char *encap_header_arg) + { +- struct ether_header *ep; ++ struct tcpdump_ether_header *ep; + u_int orig_length; + u_short ether_type; + u_short extracted_ether_type; +@@ -142,7 +142,7 @@ + + length -= ETHER_HDRLEN; + caplen -= ETHER_HDRLEN; +- ep = (struct ether_header *)p; ++ ep = (struct tcpdump_ether_header *)p; + p += ETHER_HDRLEN; + + ether_type = EXTRACT_16BITS(&ep->ether_type); +Index: print-fddi.c +--- print-fddi.c.orig 2010-03-12 02:56:44.000000000 +0100 ++++ print-fddi.c 2010-03-31 09:51:51.000000000 +0200 +@@ -242,7 +242,7 @@ + fddi_print(const u_char *p, u_int length, u_int caplen) + { + const struct fddi_header *fddip = (const struct fddi_header *)p; +- struct ether_header ehdr; ++ struct tcpdump_ether_header ehdr; + u_short extracted_ethertype; + + if (caplen < FDDI_HDRLEN) { +Index: print-ipfc.c +--- print-ipfc.c.orig 2010-03-12 02:56:44.000000000 +0100 ++++ print-ipfc.c 2010-03-31 09:51:51.000000000 +0200 +@@ -81,7 +81,7 @@ + ipfc_print(const u_char *p, u_int length, u_int caplen) + { + const struct ipfc_header *ipfcp = (const struct ipfc_header *)p; +- struct ether_header ehdr; ++ struct tcpdump_ether_header ehdr; + u_short extracted_ethertype; + + if (caplen < IPFC_HDRLEN) { +Index: print-rrcp.c +--- print-rrcp.c.orig 2010-03-12 02:56:44.000000000 +0100 ++++ print-rrcp.c 2010-03-31 09:55:19.000000000 +0200 +@@ -88,11 +88,11 @@ + const u_char *rrcp; + u_int8_t rrcp_proto; + u_int8_t rrcp_opcode; +- register const struct ether_header *ep; ++ register const struct tcpdump_ether_header *ep; + char proto_str[16]; + char opcode_str[32]; + +- ep = (const struct ether_header *)cp; ++ ep = (const struct tcpdump_ether_header *)cp; + rrcp = cp + ETHER_HDRLEN; + + ND_TCHECK(*(rrcp + RRCP_PROTO_OFFSET)); +Index: print-token.c +--- print-token.c.orig 2010-03-12 02:56:44.000000000 +0100 ++++ print-token.c 2010-03-31 09:51:51.000000000 +0200 +@@ -103,7 +103,7 @@ + { + const struct token_header *trp; + u_short extracted_ethertype; +- struct ether_header ehdr; ++ struct tcpdump_ether_header ehdr; + u_int route_len = 0, hdr_len = TOKEN_HDRLEN; + int seg; + +Index: print-pflog.c +--- print-pflog.c.orig 2010-03-12 02:56:44.000000000 +0100 ++++ print-pflog.c 2010-03-31 10:00:24.000000000 +0200 +@@ -44,6 +44,7 @@ + + #include "interface.h" + #include "addrtoname.h" ++#include "extract.h" + + static struct tok pf_reasons[] = { + { 0, "0(match)" }, diff -r 0f564e7490b9 -r fdb90fe1cf21 tcpdump/tcpdump.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tcpdump/tcpdump.spec Sun Sep 02 18:16:04 2012 +0200 @@ -0,0 +1,95 @@ +## +## tcpdump.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2012 OpenPKG Foundation e.V. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package version +%define V_tarball 4.3.0 +%define V_subdir 4.3.0 + +# package information +Name: tcpdump +Summary: Network Packet Dumping Tool +URL: http://www.tcpdump.org/ +Vendor: The Tcpdump Group +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: BASE +Group: Capturing +License: GPL +Version: %{V_tarball} +Release: 20120613 + +# list of sources +Source0: http://www.tcpdump.org/release/tcpdump-%{V_tarball}.tar.gz +Patch0: tcpdump.patch + +# build information +BuildPreReq: OpenPKG, openpkg >= 20100101, autoconf +PreReq: OpenPKG, openpkg >= 20100101 +BuildPreReq: libpcap, openssl +PreReq: libpcap, openssl + +%description + Tcpdump is a real-time network packet capturing and dumping tool. + Despite its historical name, it is a general purpose network tool, + not just usable for TCP packets. + +%track + prog tcpdump = { + version = %{V_tarball} + url = http://www.tcpdump.org/ + regex = tcpdump-(__VER__)\.tar\.gz + } + +%prep + %setup -q -n tcpdump-%{V_subdir} + %patch -p0 + +%build + options="" + case "%{l_platform -t}" in + *-freebsd[5-9].* | *-sunos5.1[01] | *-sunos5.9 | *-linux2.[46]* | *-linux3.* ) + options="--enable-ipv6" + ;; + esac + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O} %{l_cppflags openssl}" \ + CPPFLAGS="%{l_cppflags openssl}" \ + LDFLAGS="%{l_ldflags}" \ + GREP="grep" \ + ./configure \ + --prefix=%{l_prefix} \ + --mandir=%{l_prefix}/man \ + --with-crypto \ + $options + %{l_make} %{l_mflags -O} + +%install + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT + strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true + rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/tcpdump.* >/dev/null 2>&1 || true + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} + +%files -f files + +%clean +