Import package vendor original spec for necessary manipulations.

Sun, 02 Sep 2012 18:16:04 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 02 Sep 2012 18:16:04 +0200
changeset 657
fdb90fe1cf21
parent 656
0f564e7490b9
child 658
d5bf6d998337

Import package vendor original spec for necessary manipulations.

tcpdump/tcpdump.patch file | annotate | diff | comparison | revisions
tcpdump/tcpdump.spec file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tcpdump/tcpdump.patch	Sun Sep 02 18:16:04 2012 +0200
     1.3 @@ -0,0 +1,162 @@
     1.4 +Index: configure.in
     1.5 +--- configure.in.orig	2010-03-12 02:56:44.000000000 +0100
     1.6 ++++ configure.in	2010-03-31 09:51:51.000000000 +0200
     1.7 +@@ -739,10 +739,10 @@
     1.8 + 
     1.9 + if test $ac_cv_func_pcap_lib_version = "no" ; then
    1.10 +     AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
    1.11 +-    AC_TRY_LINK([],
    1.12 ++    AC_TRY_LINK(
    1.13 +        [
    1.14 + 	extern char pcap_version[];
    1.15 +-
    1.16 ++       ],[
    1.17 + 	return (int)pcap_version;
    1.18 +        ],
    1.19 +        ac_lbl_cv_pcap_version_defined=yes,
    1.20 +@@ -755,10 +755,10 @@
    1.21 +     fi
    1.22 + fi
    1.23 + AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
    1.24 +-AC_TRY_LINK([],
    1.25 ++AC_TRY_LINK(
    1.26 +    [
    1.27 + 	extern int pcap_debug;
    1.28 +-
    1.29 ++   ],[
    1.30 + 	return pcap_debug;
    1.31 +    ],
    1.32 +    ac_lbl_cv_pcap_debug_defined=yes,
    1.33 +@@ -772,10 +772,10 @@
    1.34 + 	# OK, what about "yydebug"?
    1.35 + 	#
    1.36 + 	AC_MSG_CHECKING(whether yydebug is defined by libpcap)
    1.37 +-	AC_TRY_LINK([],
    1.38 ++	AC_TRY_LINK(
    1.39 + 	   [
    1.40 + 		extern int yydebug;
    1.41 +-
    1.42 ++	   ],[
    1.43 + 		return yydebug;
    1.44 + 	   ],
    1.45 + 	   ac_lbl_cv_yydebug_defined=yes,
    1.46 +Index: ether.h
    1.47 +--- ether.h.orig	2010-03-12 02:56:44.000000000 +0100
    1.48 ++++ ether.h	2010-03-31 09:51:51.000000000 +0200
    1.49 +@@ -34,7 +34,9 @@
    1.50 +  *	@(#)if_ether.h	8.3 (Berkeley) 5/2/95
    1.51 +  */
    1.52 + 
    1.53 ++#ifndef ETHERMTU
    1.54 + #define	ETHERMTU	1500
    1.55 ++#endif
    1.56 + 
    1.57 + /*
    1.58 +  * The number of bytes in an ethernet (MAC) address.
    1.59 +@@ -44,7 +46,7 @@
    1.60 + /*
    1.61 +  * Structure of a DEC/Intel/Xerox or 802.3 Ethernet header.
    1.62 +  */
    1.63 +-struct	ether_header {
    1.64 ++struct	tcpdump_ether_header {
    1.65 + 	u_int8_t	ether_dhost[ETHER_ADDR_LEN];
    1.66 + 	u_int8_t	ether_shost[ETHER_ADDR_LEN];
    1.67 + 	u_int16_t	ether_type;
    1.68 +Index: print-ether.c
    1.69 +--- print-ether.c.orig	2010-03-12 02:56:44.000000000 +0100
    1.70 ++++ print-ether.c	2010-03-31 09:55:05.000000000 +0200
    1.71 +@@ -86,10 +86,10 @@
    1.72 + static inline void
    1.73 + ether_hdr_print(register const u_char *bp, u_int length)
    1.74 + {
    1.75 +-	register const struct ether_header *ep;
    1.76 ++	register const struct tcpdump_ether_header *ep;
    1.77 + 	u_int16_t ether_type;
    1.78 + 
    1.79 +-	ep = (const struct ether_header *)bp;
    1.80 ++	ep = (const struct tcpdump_ether_header *)bp;
    1.81 + 
    1.82 + 	(void)printf("%s > %s",
    1.83 + 		     etheraddr_string(ESRC(ep)),
    1.84 +@@ -123,7 +123,7 @@
    1.85 + ether_print(const u_char *p, u_int length, u_int caplen,
    1.86 +     void (*print_encap_header)(const u_char *), const u_char *encap_header_arg)
    1.87 + {
    1.88 +-	struct ether_header *ep;
    1.89 ++	struct tcpdump_ether_header *ep;
    1.90 + 	u_int orig_length;
    1.91 + 	u_short ether_type;
    1.92 + 	u_short extracted_ether_type;
    1.93 +@@ -142,7 +142,7 @@
    1.94 + 
    1.95 + 	length -= ETHER_HDRLEN;
    1.96 + 	caplen -= ETHER_HDRLEN;
    1.97 +-	ep = (struct ether_header *)p;
    1.98 ++	ep = (struct tcpdump_ether_header *)p;
    1.99 + 	p += ETHER_HDRLEN;
   1.100 + 
   1.101 + 	ether_type = EXTRACT_16BITS(&ep->ether_type);
   1.102 +Index: print-fddi.c
   1.103 +--- print-fddi.c.orig	2010-03-12 02:56:44.000000000 +0100
   1.104 ++++ print-fddi.c	2010-03-31 09:51:51.000000000 +0200
   1.105 +@@ -242,7 +242,7 @@
   1.106 + fddi_print(const u_char *p, u_int length, u_int caplen)
   1.107 + {
   1.108 + 	const struct fddi_header *fddip = (const struct fddi_header *)p;
   1.109 +-	struct ether_header ehdr;
   1.110 ++	struct tcpdump_ether_header ehdr;
   1.111 + 	u_short extracted_ethertype;
   1.112 + 
   1.113 + 	if (caplen < FDDI_HDRLEN) {
   1.114 +Index: print-ipfc.c
   1.115 +--- print-ipfc.c.orig	2010-03-12 02:56:44.000000000 +0100
   1.116 ++++ print-ipfc.c	2010-03-31 09:51:51.000000000 +0200
   1.117 +@@ -81,7 +81,7 @@
   1.118 + ipfc_print(const u_char *p, u_int length, u_int caplen)
   1.119 + {
   1.120 + 	const struct ipfc_header *ipfcp = (const struct ipfc_header *)p;
   1.121 +-	struct ether_header ehdr;
   1.122 ++	struct tcpdump_ether_header ehdr;
   1.123 + 	u_short extracted_ethertype;
   1.124 + 
   1.125 + 	if (caplen < IPFC_HDRLEN) {
   1.126 +Index: print-rrcp.c
   1.127 +--- print-rrcp.c.orig	2010-03-12 02:56:44.000000000 +0100
   1.128 ++++ print-rrcp.c	2010-03-31 09:55:19.000000000 +0200
   1.129 +@@ -88,11 +88,11 @@
   1.130 + 	const u_char *rrcp;
   1.131 + 	u_int8_t rrcp_proto;
   1.132 + 	u_int8_t rrcp_opcode;
   1.133 +-	register const struct ether_header *ep;
   1.134 ++	register const struct tcpdump_ether_header *ep;
   1.135 + 	char proto_str[16];
   1.136 + 	char opcode_str[32];
   1.137 + 
   1.138 +-	ep = (const struct ether_header *)cp;
   1.139 ++	ep = (const struct tcpdump_ether_header *)cp;
   1.140 + 	rrcp = cp + ETHER_HDRLEN;
   1.141 + 
   1.142 + 	ND_TCHECK(*(rrcp + RRCP_PROTO_OFFSET));
   1.143 +Index: print-token.c
   1.144 +--- print-token.c.orig	2010-03-12 02:56:44.000000000 +0100
   1.145 ++++ print-token.c	2010-03-31 09:51:51.000000000 +0200
   1.146 +@@ -103,7 +103,7 @@
   1.147 + {
   1.148 + 	const struct token_header *trp;
   1.149 + 	u_short extracted_ethertype;
   1.150 +-	struct ether_header ehdr;
   1.151 ++	struct tcpdump_ether_header ehdr;
   1.152 + 	u_int route_len = 0, hdr_len = TOKEN_HDRLEN;
   1.153 + 	int seg;
   1.154 + 
   1.155 +Index: print-pflog.c
   1.156 +--- print-pflog.c.orig	2010-03-12 02:56:44.000000000 +0100
   1.157 ++++ print-pflog.c	2010-03-31 10:00:24.000000000 +0200
   1.158 +@@ -44,6 +44,7 @@
   1.159 + 
   1.160 + #include "interface.h"
   1.161 + #include "addrtoname.h"
   1.162 ++#include "extract.h"
   1.163 + 
   1.164 + static struct tok pf_reasons[] = {
   1.165 + 	{ 0,	"0(match)" },
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tcpdump/tcpdump.spec	Sun Sep 02 18:16:04 2012 +0200
     2.3 @@ -0,0 +1,95 @@
     2.4 +##
     2.5 +##  tcpdump.spec -- OpenPKG RPM Package Specification
     2.6 +##  Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
     2.7 +##
     2.8 +##  Permission to use, copy, modify, and distribute this software for
     2.9 +##  any purpose with or without fee is hereby granted, provided that
    2.10 +##  the above copyright notice and this permission notice appear in all
    2.11 +##  copies.
    2.12 +##
    2.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    2.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    2.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    2.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    2.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    2.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    2.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    2.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    2.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    2.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    2.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    2.24 +##  SUCH DAMAGE.
    2.25 +##
    2.26 +
    2.27 +#   package version
    2.28 +%define       V_tarball 4.3.0
    2.29 +%define       V_subdir  4.3.0
    2.30 +
    2.31 +#   package information
    2.32 +Name:         tcpdump
    2.33 +Summary:      Network Packet Dumping Tool
    2.34 +URL:          http://www.tcpdump.org/
    2.35 +Vendor:       The Tcpdump Group
    2.36 +Packager:     OpenPKG Foundation e.V.
    2.37 +Distribution: OpenPKG Community
    2.38 +Class:        BASE
    2.39 +Group:        Capturing
    2.40 +License:      GPL
    2.41 +Version:      %{V_tarball}
    2.42 +Release:      20120613
    2.43 +
    2.44 +#   list of sources
    2.45 +Source0:      http://www.tcpdump.org/release/tcpdump-%{V_tarball}.tar.gz
    2.46 +Patch0:       tcpdump.patch
    2.47 +
    2.48 +#   build information
    2.49 +BuildPreReq:  OpenPKG, openpkg >= 20100101, autoconf
    2.50 +PreReq:       OpenPKG, openpkg >= 20100101
    2.51 +BuildPreReq:  libpcap, openssl
    2.52 +PreReq:       libpcap, openssl
    2.53 +
    2.54 +%description
    2.55 +    Tcpdump is a real-time network packet capturing and dumping tool.
    2.56 +    Despite its historical name, it is a general purpose network tool,
    2.57 +    not just usable for TCP packets.
    2.58 +
    2.59 +%track
    2.60 +    prog tcpdump = {
    2.61 +        version   = %{V_tarball}
    2.62 +        url       = http://www.tcpdump.org/
    2.63 +        regex     = tcpdump-(__VER__)\.tar\.gz
    2.64 +    }
    2.65 +
    2.66 +%prep
    2.67 +    %setup -q -n tcpdump-%{V_subdir}
    2.68 +    %patch -p0
    2.69 +
    2.70 +%build
    2.71 +    options=""
    2.72 +    case "%{l_platform -t}" in
    2.73 +        *-freebsd[5-9].* | *-sunos5.1[01] | *-sunos5.9 | *-linux2.[46]* | *-linux3.* )
    2.74 +            options="--enable-ipv6"
    2.75 +            ;;
    2.76 +    esac
    2.77 +    CC="%{l_cc}" \
    2.78 +    CFLAGS="%{l_cflags -O} %{l_cppflags openssl}" \
    2.79 +    CPPFLAGS="%{l_cppflags openssl}" \
    2.80 +    LDFLAGS="%{l_ldflags}" \
    2.81 +    GREP="grep" \
    2.82 +    ./configure \
    2.83 +        --prefix=%{l_prefix} \
    2.84 +        --mandir=%{l_prefix}/man \
    2.85 +        --with-crypto \
    2.86 +        $options
    2.87 +    %{l_make} %{l_mflags -O}
    2.88 +
    2.89 +%install
    2.90 +    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
    2.91 +    strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
    2.92 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/tcpdump.* >/dev/null 2>&1 || true
    2.93 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
    2.94 +
    2.95 +%files -f files
    2.96 +
    2.97 +%clean
    2.98 +

mercurial