diff --git a/.gitignore b/.gitignore index e69de29..456ed63 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +dpkt-1.7.tar.gz diff --git a/dpkt-1.7-r73.patch b/dpkt-1.7-r73.patch new file mode 100644 index 0000000..e816b70 --- /dev/null +++ b/dpkt-1.7-r73.patch @@ -0,0 +1,20 @@ +Index: dpkt/http.py +=================================================================== +--- dpkt/http.py (revision 72) ++++ dpkt/http.py (revision 73) +@@ -15,11 +15,11 @@ + line = line.strip() + if not line: + break +- l = line.split(None, 1) +- if not l[0].endswith(':'): ++ l = line.split(':', 1) ++ if len(l[0].split()) != 1: + raise dpkt.UnpackError('invalid header: %r' % line) +- k = l[0][:-1].lower() +- v = len(l) != 1 and l[1] or '' ++ k = l[0].lower() ++ v = len(l) != 1 and l[1].lstrip() or '' + if k in d: + if not type(d[k]) is list: + d[k] = [d[k]] diff --git a/python-dpkt.spec b/python-dpkt.spec new file mode 100644 index 0000000..3952b11 --- /dev/null +++ b/python-dpkt.spec @@ -0,0 +1,44 @@ +Name: python-dpkt +Version: 1.7 +Release: 1%{?dist} +Summary: Simple packet creation/parsing library + +Group: Development/Libraries +License: BSD +URL: http://dpkt.googlecode.com/ +Source0: http://dpkt.googlecode.com/files/dpkt-%{version}.tar.gz +Patch0: dpkt-1.7-r73.patch + +BuildArch: noarch +BuildRequires: python-devel + +Obsoletes: dpkt < 1.7-4 + +%description +Fast, simple packet creation and parsing library +with definitions for the basic TCP/IP protocols. + + +%prep +%setup -q -n dpkt-%{version} +%patch0 -p0 -b .r73 + + +%build +%{__python} setup.py build + + +%install +%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc AUTHORS CHANGES HACKING LICENSE README examples +%{python_sitelib}/* + + +%changelog +* Wed Jul 28 2010 Yanko Kaneti - 1.7-1 +- python-dpkt previously known as dpkt +- Incorporated feedback from the new review diff --git a/sources b/sources index e69de29..27e101b 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +0baa25fd5d87066cf6189a66cf452ac0 dpkt-1.7.tar.gz