diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 5feaa8a..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: pcapdiff -# $Id$ -NAME := pcapdiff -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/pcapdiff b/pcapdiff new file mode 100644 index 0000000..87ad9db --- /dev/null +++ b/pcapdiff @@ -0,0 +1,6 @@ +#!/usr/bin/env python +if __name__ == '__main__': + import sys + sys.path.insert(0, '/usr/share/pcapdiff') + from pcapdiff import main + main() diff --git a/pcapdiff-pcapdiff-noshebang.patch b/pcapdiff-pcapdiff-noshebang.patch new file mode 100644 index 0000000..6c9d63a --- /dev/null +++ b/pcapdiff-pcapdiff-noshebang.patch @@ -0,0 +1,7 @@ +--- pcapdiff.py 2007-11-30 14:17:27.000000000 -0600 ++++ pcapdiff.py 2007-11-30 14:17:27.000000000 -0600 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # + # pcapdiff: shows you the differences between two pcap dump files + # (such as those produced by tcpdump), with an eye towards counting diff --git a/pcapdiff-pcapdiff_helper-noshebang.patch b/pcapdiff-pcapdiff_helper-noshebang.patch new file mode 100644 index 0000000..4e6049d --- /dev/null +++ b/pcapdiff-pcapdiff_helper-noshebang.patch @@ -0,0 +1,7 @@ +--- pcapdiff_helper.py 2007-11-30 14:22:23.000000000 -0600 ++++ pcapdiff_helper.py 2007-11-30 14:22:23.000000000 -0600 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # + # pcapdiff_helper: helper functions for pcapdiff.py + # diff --git a/pcapdiff-printpackets-noshebang.patch b/pcapdiff-printpackets-noshebang.patch new file mode 100644 index 0000000..db45e1d --- /dev/null +++ b/pcapdiff-printpackets-noshebang.patch @@ -0,0 +1,7 @@ +--- printpackets.py 2007-11-30 14:17:58.000000000 -0600 ++++ printpackets.py 2007-11-30 14:17:58.000000000 -0600 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # + # printpackets: + # prints out packets from a pcap dump file with ether and ip header info diff --git a/pcapdiff.spec b/pcapdiff.spec new file mode 100644 index 0000000..64c29a5 --- /dev/null +++ b/pcapdiff.spec @@ -0,0 +1,74 @@ +Name: pcapdiff +Version: 0.1 +Release: 2%{?dist} +Summary: Compares packet captures, detects forged, dropped or mangled packets + +Group: Development/Languages +License: GPLv2+ and GPLv3+ +URL: http://www.eff.org/testyourisp/pcapdiff/ +Source0: http://www.eff.org/files/pcapdiff-%{version}.tar.gz +Source1: pcapdiff +Source2: printpackets +Patch0: pcapdiff-pcapdiff-noshebang.patch +Patch1: pcapdiff-printpackets-noshebang.patch +Patch2: pcapdiff-pcapdiff_helper-noshebang.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root%(%{__id_u} -n) +BuildArch: noarch +BuildRequires: python-devel +Requires: pcapy + +%description +Pcapdiff is a tool developed by the EFF to compare two packet captures and +identify potentially forged, dropped, or mangled packets. Two technically- +inclined friends can set up packet captures (e.g. tcpdump or Wireshark) on +their own computers and produce network traffic between their two computers +over the Internet. Later, they can run pcapdiff on the two packet capture +files to identify suspicious packets for further investigation. See +Detecting packet injection: a guide to observing packet spoofing by ISPs +and EFF's Test Your ISP Project for more background. + +%prep +%setup -qn pcapdiff + +%patch0 -p0 +%patch1 -p0 +%patch2 -p0 + +%build + + +#fix encodings +#sed -i 's/\r//' LICENSE +#sed -i 's/\r//' README +#sed -i 's/\r//' pcapdiff.html +#iconv -f IBM850 -t UTF8 pcapdiff.html > pcapdiff.html.tmp +#mv pcapdiff.html.tmp pcapdiff.html + + +%install +rm -rf $RPM_BUILD_ROOT +install -D -m 755 -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/pcapdiff +install -D -m 644 -p pcapdiff.py $RPM_BUILD_ROOT%{_datadir}/pcapdiff/pcapdiff.py +install -D -m 755 -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/printpackets +install -D -m 644 -p printpackets.py $RPM_BUILD_ROOT%{_datadir}/pcapdiff/printpackets.py +install -D -m 644 -p pcapdiff_helper.py $RPM_BUILD_ROOT%{_datadir}/pcapdiff/pcapdiff_helper.py + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc README COPYING.2 COPYING.3 +%{_bindir}/pcapdiff +%{_bindir}/printpackets +%dir %{_datadir}/pcapdiff/ +%{_datadir}/pcapdiff/*.py + +%changelog +* Tue Dec 04 2007 Jon Ciesla - 0.1-2 +- Added python-devel BR to fix .pyc/.pyo issue. + +* Fri Nov 30 2007 Jon Ciesla - 0.1-1 +- create. diff --git a/printpackets b/printpackets new file mode 100644 index 0000000..ed87944 --- /dev/null +++ b/printpackets @@ -0,0 +1,6 @@ +#!/usr/bin/env python +if __name__ == '__main__': + import sys + sys.path.insert(0, '/usr/share/pcapdiff') + from printpackets import main + main() diff --git a/sources b/sources index e69de29..dc80159 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +2f7f122969c7894a6aff3e72c886f63d pcapdiff-0.1.tar.gz