Check-in [def5a6d71c]
Overview
SHA1:def5a6d71c6dd46648010ef4155d228cd241e2a4
Date: 2014-02-20 19:11:31
User: rkeene
Comment:Updated to compile successfully
Timelines: family | ancestors | using-redhat-srpm
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2014-02-20
19:11
[def5a6d71c] Leaf: Updated to compile successfully (user: rkeene, tags: using-redhat-srpm)
18:26
[3d9cb49971] Started work on building from SRPM source (user: rkeene, tags: using-redhat-srpm)
Changes

Modified .fossil-settings/ignore-glob from [f8536bbcc3] to [069bcbad19].

     1      1   archive/kitcreator-*.tar.gz.new
     2      2   archive/tcpdump-*.tar.gz.new
            3  +archive/tcpdump-*.tar.bz2.new
     3      4   archive/twapi-*.zip.new
     4      5   archive/winpcap-dev-*.zip.new
     5      6   archive/winpcap-inst-*.exe.new
     6      7   archive/kitcreator-*.tar.gz
     7      8   archive/tcpdump-*.tar.gz
            9  +archive/tcpdump-*.tar.bz2
           10  +archive/tcpdump-*.patches
     8     11   archive/twapi-*.zip
     9     12   archive/winpcap-dev-*.zip
    10     13   archive/winpcap-inst-*.exe
    11     14   files/npf32.sys
    12     15   files/npf64.sys
    13     16   files/packet.dll
    14     17   files/pthreadvc.dll

Modified Makefile from [af35554c1f] to [c3a16cae07].

     2      2   TOOLCHAIN_CMD = $(TOOLCHAIN)-
     3      3   
     4      4   TWAPI_VERSION = 3.1.17
     5      5   TWAPI_URL = http://sourceforge.net/projects/twapi/files/Current%20Releases/Tcl%20Windows%20API/twapi-$(TWAPI_VERSION)/twapi-$(TWAPI_VERSION).zip
     6      6   TWAPI_ZIP = archive/twapi-$(TWAPI_VERSION).zip
     7      7   TWAPI_SHA256 = 8803e90fdc60c8d6a1ca3d559b145e8d09ae2e1259df603ca27c89ff7b0416f4
     8      8   
     9         -TCPDUMP_VERSION = 4.5.1
    10         -TCPDUMP_URL = http://www.tcpdump.org/release/tcpdump-$(TCPDUMP_VERSION).tar.gz
    11         -TCPDUMP_TARBALL = archive/tcpdump-$(TCPDUMP_VERSION).tar.gz
    12         -TCPDUMP_SHA256 = 14ab39657128f3a650aed4cf455f76c7590601087b6101c253d698f6e73f0b96
            9  +TCPDUMP_VERSION = 4.0.0-3.20090921gitdf3cb4.2.el6
           10  +TCPDUMP_SRPM    = archive/tcpdump-$(TCPDUMP_VERSION).src.rpm
           11  +TCPDUMP_TARBALL = archive/tcpdump-$(TCPDUMP_VERSION).tar.bz2
           12  +TCPDUMP_LOCAL_PATCHES = archive/tcpdump-$(TCPDUMP_VERSION)-local.patches
           13  +TCPDUMP_PATCHES = archive/tcpdump-$(TCPDUMP_VERSION).patches
           14  +TCPDUMP_SHA256  = 0e654b3df95d338efc1ed9f97984878c2203ae8527f3f589b6acce66d88d357d
    13     15   
    14     16   WINPCAP_DEV_VERSION = 4.1.2
    15     17   WINPCAP_DEV_URL = http://www.winpcap.org/install/bin/WpdPack_4_1_2.zip
    16     18   WINPCAP_DEV_ZIP = archive/winpcap-dev-$(WINPCAP_DEV_VERSION).zip
    17     19   WINPCAP_DEV_SHA256 = ea799cf2f26e4afb1892938070fd2b1ca37ce5cf75fec4349247df12b784edbd
    18     20   
    19     21   WINPCAP_INST_VERSION = 4.1.3
................................................................................
    47     49   	cp '__TMP_WPCAP__/$$SYSDIR/pthreadVC.dll' files/pthreadvc.dll
    48     50   	cp '__TMP_WPCAP__/$$SYSDIR/wpcap.dll' files/wpcap.dll
    49     51   	cp '__TMP_WPCAP__/$$SYSDIR/drivers/npf_1.sys' files/npf64.sys
    50     52   	cp '__TMP_WPCAP__/$$SYSDIR/drivers/npf.sys' files/npf32.sys
    51     53   	rm -rf __TMP_WPCAP__
    52     54   
    53     55   # TCPDUMP
    54         -$(TCPDUMP_TARBALL):
           56  +$(TCPDUMP_PATCHES): $(TCPDUMP_SRPM) $(TCPDUMP_LOCAL_PATCHES)
           57  +	for patch in `rpm2cpio '$(TCPDUMP_SRPM)' | cpio --extract --to-stdout tcpdump.spec | awk '/^Patch[0-9][0-9]*: tcpdump/{ print $$2 }'`; do \
           58  +		rpm2cpio '$(TCPDUMP_SRPM)' | cpio --extract --to-stdout "$${patch}" || exit 1; \
           59  +	done > '$(TCPDUMP_PATCHES).new'
           60  +	cat '$(TCPDUMP_LOCAL_PATCHES)' >> '$(TCPDUMP_PATCHES).new'
           61  +	mv '$(TCPDUMP_PATCHES).new' '$(TCPDUMP_PATCHES)'
           62  +
           63  +$(TCPDUMP_TARBALL): $(TCPDUMP_SRPM)
    55     64   	@-mkdir -p archive >/dev/null 2>/dev/null
    56         -	wget --no-use-server-timestamps -O "$(TCPDUMP_TARBALL).new" "$(TCPDUMP_URL)"
           65  +	rpm2cpio $(TCPDUMP_SRPM) | cpio --extract --to-stdout 'tcpdump-*.tar.*' > "$(TCPDUMP_TARBALL).new"
    57     66   	@if test -n "$(TCPDUMP_SHA256)"; then if test "`openssl sha256 "$(TCPDUMP_TARBALL).new" | sed 's@^.*= *@@'`" != "$(TCPDUMP_SHA256)"; then echo "$(TCPDUMP_TARBALL): Checksum Mismatch!"; exit 1; fi; fi
    58         -	gzip -dc "$(TCPDUMP_TARBALL).new" | tar -tf - >/dev/null
           67  +	bzip2 -dc "$(TCPDUMP_TARBALL).new" | tar -tf - >/dev/null
    59     68   	mv "$(TCPDUMP_TARBALL).new" "$(TCPDUMP_TARBALL)"
    60     69   
    61     70   $(WINPCAP_DEV_ZIP):
    62     71   	@-mkdir -p archive >/dev/null 2>/dev/null
    63     72   	wget --no-use-server-timestamps -O "$(WINPCAP_DEV_ZIP).new" "$(WINPCAP_DEV_URL)"
    64     73   	@if test -n "$(WINPCAP_DEV_SHA256)"; then if test "`openssl sha256 "$(WINPCAP_DEV_ZIP).new" | sed 's@^.*= *@@'`" != "$(WINPCAP_DEV_SHA256)"; then echo "$(WINPCAP_DEV_ZIP): Checksum Mismatch!"; exit 1; fi; fi
    65     74   	unzip -l "$(WINPCAP_DEV_ZIP).new"
    66     75   	mv "$(WINPCAP_DEV_ZIP).new" "$(WINPCAP_DEV_ZIP)"
    67     76   
    68         -files/tcpdump.exe: $(TCPDUMP_TARBALL) $(WINPCAP_DEV_ZIP) pcap-config
           77  +files/tcpdump.exe: $(TCPDUMP_TARBALL) $(TCPDUMP_PATCHES) $(WINPCAP_DEV_ZIP) pcap-config
    69     78   	rm -rf __TMP_TCP__
    70     79   	mkdir __TMP_TCP__
    71     80   	( \
    72     81   		set -e; \
    73     82   		cd __TMP_TCP__; \
    74         -		gzip -dc ../$(TCPDUMP_TARBALL) | tar -xf -; \
           83  +		bzip2 -dc ../$(TCPDUMP_TARBALL) | tar -xf -; \
    75     84   		unzip ../$(WINPCAP_DEV_ZIP); \
    76     85   		cp ../pcap-config WpdPack/; \
    77     86   		cd WpdPack; \
    78     87   		echo '#define pcap_can_set_rfmon(x) 0' >> Include/pcap/pcap.h; \
    79     88   		echo '#define pcap_set_rfmon(x, y) -1' >> Include/pcap/pcap.h; \
    80     89   		echo '#define pcap_statustostr(x) ""' >>  Include/pcap/pcap.h; \
    81         -		cd ../tcpdump-$(TCPDUMP_VERSION); \
           90  +		cd ../tcpdump; \
           91  +		patch -p1 < "../../$(TCPDUMP_PATCHES)"; \
           92  +		if [ -d win32/Include/Arpa -a ! -e win32/Include/arpa ]; then ln -s Arpa win32/Include/arpa; fi; \
           93  +		if [ -d win32/Include/Netinet -a ! -e win32/Include/netinet ]; then ln -s Netinet win32/Include/netinet; fi; \
           94  +		( echo '#include "config.h"'; cat missing/bittypes.h ) > missing/bittypes.h.new; \
           95  +		mv missing/bittypes.h.new missing/bittypes.h; \
    82     96   		./configure --without-smi --disable-smb --enable-ipv6 --without-crypto --host=$(TOOLCHAIN) PCAP_CONFIG="$$(pwd)/../WpdPack/pcap-config" LIBS='-lws2_32' ac_cv_func_getnameinfo='yes'; \
    83     97   		sed -i 's@Ws2tcpip\.h@ws2tcpip.h@' tcpdump-stdinc.h; \
    84     98   		grep -v '^# *define.*UNALIGNED' tcpdump-stdinc.h | \
    85     99   			grep -v '<net/netdb\.h>' > tcpdump-stdinc.h.new && mv tcpdump-stdinc.h.new tcpdump-stdinc.h; \
    86    100   		echo '#define HAVE_SOCKADDR_STORAGE 1' >> config.h; \
    87    101   		echo '#define HAVE_U_INT8_T 1' >> config.h; \
    88    102   		echo '#define HAVE_U_INT16_T 1' >> config.h; \
................................................................................
    91    105   		echo '#define HAVE_INT8_T 1' >> config.h; \
    92    106   		echo '#define HAVE_INT16_T 1' >> config.h; \
    93    107   		echo '#define HAVE_INT32_T 1' >> config.h; \
    94    108   		echo '#define HAVE_INT64_T 1' >> config.h; \
    95    109   		echo '#define HAVE_GENERATED_VERSION 1' >> config.h; \
    96    110   		echo '#define IN6_IS_ADDR_UNSPECIFIED IN6_IS_ADDR_UNSPECIFIED' >> config.h; \
    97    111   		echo '#undef HAVE_ALARM' >> config.h; \
          112  +		echo '#define getuid() 0' >> config.h; \
          113  +		echo '#define geteuid() 0' >> config.h; \
    98    114   		grep -v '^# *define *inline' config.h > config.h.new && mv config.h.new config.h; \
    99    115   		$(MAKE); \
   100    116   	)
   101    117   	@-mkdir -p files
   102         -	cp __TMP_TCP__/tcpdump-$(TCPDUMP_VERSION)/tcpdump files/tcpdump.exe.new
          118  +	cp __TMP_TCP__/tcpdump/tcpdump files/tcpdump.exe.new
   103    119   	$(TOOLCHAIN_CMD)strip files/tcpdump.exe.new
   104    120   	mv files/tcpdump.exe.new files/tcpdump.exe
   105    121   	rm -rf __TMP_TCP__
   106    122   
   107    123   # TWAPI (TCL Windows API)
   108    124   $(TWAPI_ZIP):
   109    125   	@-mkdir -p archive >/dev/null 2>/dev/null
................................................................................
   124    140   	gzip -dc "$(KITCREATOR_TARBALL).new" | tar -tf - >/dev/null
   125    141   	mv "$(KITCREATOR_TARBALL).new" "$(KITCREATOR_TARBALL)"
   126    142   
   127    143   tclkit-zip: $(KITCREATOR_TARBALL) tcpdump.rc icon/tcpdump.ico
   128    144   	rm -rf kitcreator-$(KITCREATOR_VERSION)
   129    145   	gzip -dc "$(KITCREATOR_TARBALL)" | tar -xf -
   130    146   	cp icon/tcpdump.ico kitcreator-$(KITCREATOR_VERSION)/kit.ico
   131         -	sed 's/@@TCPDUMP_VERSION_COMMA@@/$(shell echo $(TCPDUMP_VERSION) | sed 's@\.@,@g'),0/;s/@@TCPDUMP_VERSION@@/$(TCPDUMP_VERSION)/' tcpdump.rc > kitcreator-$(KITCREATOR_VERSION)/kit.rc
          147  +	sed 's/@@TCPDUMP_VERSION_COMMA@@/$(shell echo $(TCPDUMP_VERSION) | cut -f 1 -d - | sed 's@\.@,@g'),0/;s/@@TCPDUMP_VERSION@@/$(TCPDUMP_VERSION)/' tcpdump.rc > kitcreator-$(KITCREATOR_VERSION)/kit.rc
   132    148   	cd kitcreator-$(KITCREATOR_VERSION) && KITCREATOR_PKGS=' ' AR=$(TOOLCHAIN_CMD)ar CC=$(TOOLCHAIN_CMD)gcc ./kitcreator 8.5.15 --host=$(TOOLCHAIN) --enable-kit-storage=zip --enable-threads
   133    149   	cp kitcreator-$(KITCREATOR_VERSION)/tclkit-8.5.15 tclkit-zip.new
   134    150   	mv tclkit-zip.new tclkit-zip
   135    151   	rm -rf kitcreator-$(KITCREATOR_VERSION)
   136    152   
   137    153   # The wrapper
   138    154   ## Split Tclkit header from zip file contents
................................................................................
   157    173   	rm -rf kitcreator-$(KITCREATOR_VERSION)
   158    174   	rm -rf __TMP_TCP__ __TMP_WPCAP__
   159    175   	$(MAKE) -C icon clean
   160    176   
   161    177   distclean: clean
   162    178   	rm -f "$(TWAPI_ZIP)" "$(TCPDUMP_TARBALL)" "$(WINPCAP_DEV_ZIP)" "$(KITCREATOR_TARBALL)" "$(WINPCAP_INST_7ZIP)"
   163    179   	rm -f "$(TWAPI_ZIP).new" "$(TCPDUMP_TARBALL).new" "$(WINPCAP_DEV_ZIP).new" "$(KITCREATOR_TARBALL).new" "$(WINPCAP_INST_7ZIP).new"
          180  +	rm -f "$(TCPDUMP_PATCHES).new" "$(TCPDUMP_PATCHES)"
   164    181   	rm -f $(WINPCAP_INST_FILES)
   165    182   	rm -f tclkit-zip files/tcpdump.exe
   166    183   	-rmdir archive files
   167    184   
   168    185   .PHONY: all clean distclean

Added archive/tcpdump-4.0.0-3.20090921gitdf3cb4.2.el6-local.patches version [5cdb9b1556].

            1  +--- tcpdump/tcpdump.c	2014-02-20 13:04:20.077631000 -0600
            2  ++++ tcpdump-1rsk/tcpdump.c	2014-02-20 13:03:16.942631000 -0600
            3  +@@ -387,18 +387,20 @@
            4  + #define U_FLAG
            5  + #endif
            6  + 
            7  +-#ifndef WIN32
            8  + /* Drop root privileges and chroot if necessary */
            9  + static void
           10  + droproot(const char *username, const char *chroot_dir)
           11  + {
           12  ++#ifndef WIN32
           13  + 	struct passwd *pw = NULL;
           14  ++#endif
           15  + 
           16  + 	if (chroot_dir && !username) {
           17  + 		fprintf(stderr, "tcpdump: Chroot without dropping root is insecure\n");
           18  + 		exit(1);
           19  + 	}
           20  + 	
           21  ++#ifndef WIN32
           22  + 	pw = getpwnam(username);
           23  + 	if (pw) {
           24  + 		if (chroot_dir) {
           25  +@@ -423,8 +425,8 @@
           26  + 		    username);
           27  + 		exit(1);
           28  + 	}
           29  ++#endif
           30  + }
           31  +-#endif /* WIN32 */
           32  + 
           33  + static int
           34  + getWflagChars(int x)

Modified pcap-config from [3e755fbbad] to [228047bb61].

     2      2   
     3      3   opt="$1"
     4      4   
     5      5   ourdir="$(dirname "$(readlink -f "$(which "$0")")")"
     6      6   
     7      7   case "$opt" in
     8      8   	--cflags)
     9         -		echo "-Iwin32/Include -I${ourdir}/Include"
    10         -
            9  +		echo "-Iwin32/Include -I${ourdir}/Include -DNBBY=8"
    11     10   		;;
    12     11   	--libs)
    13     12   		echo "-L${ourdir}/Lib -lwpcap -lws2_32"
    14     13   		;;
    15     14   	*)
    16     15   		echo "Unknown option: $opt" >&2
    17     16   		exit 1
    18     17   		;;
    19     18   esac
    20     19   
    21     20   exit 0