--- python-pcs-0.6+debian.orig/debian/changelog +++ python-pcs-0.6+debian/debian/changelog @@ -0,0 +1,40 @@ +python-pcs (0.6+debian-0ubuntu3) trusty; urgency=medium + + * Port to dh_python2. + * Change to arch:any, as compiled extensions are shipped. + + -- Dimitri John Ledkov Sun, 26 Jan 2014 22:53:26 +0000 + +python-pcs (0.6+debian-0ubuntu2) natty; urgency=low + + * Rebuild for python2.7 + + -- Matthias Klose Thu, 09 Dec 2010 16:25:43 +0100 + +python-pcs (0.6+debian-0ubuntu1) lucid; urgency=low + + * New upstream release + * Rebuild the upstream tarball to remove the duplicate copy of python-pypcap + and the compiled PDF manual. + * Redo 10_remove_pypcap.dpatch. + * debian/control: Build-depend on cython and libpcap-dev. + * Add 10_fix_docs_build.dpatch to fix compilation of documentation. + + -- Andreas Wenning Thu, 14 Jan 2010 12:38:31 +0100 + +python-pcs (0.5+debian-1.1) unstable; urgency=low + + * NMU. Rebuild to move files to /usr/share/pyshared. Closes: #490499. + + -- Matthias Klose Fri, 18 Jul 2008 15:41:00 +0000 + +python-pcs (0.5+debian-1) unstable; urgency=low + + * Initial release; closes: #436369. + * Rebuild the upstream tarball to remove the duplicate copy of python-pypcap + and the compiled PDF manual. + * Patch setup.py and pcs/__init__.py to allow for an external copy of + python-pypcap. + + -- Robert S. Edmonds Tue, 14 Aug 2007 22:21:13 -0400 + --- python-pcs-0.6+debian.orig/debian/compat +++ python-pcs-0.6+debian/debian/compat @@ -0,0 +1 @@ +5 --- python-pcs-0.6+debian.orig/debian/control +++ python-pcs-0.6+debian/debian/control @@ -0,0 +1,18 @@ +Source: python-pcs +Section: net +Priority: extra +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Robert S. Edmonds +Build-Depends: debhelper (>= 5.0.38), python-all-dev (>= 2.3.5-11), dh-python, dpatch, texlive-latex-recommended, cython, libpcap-dev +Standards-Version: 3.7.2 + +Package: python-pcs +Architecture: any +Depends: ${python:Depends}, python-pypcap +Description: Packet Construction Set for Python + PCS is a set of Python modules and objects that make building network + protocol code easier for the protocol developer. It provides functionality + to encode and decode network packets in various formats as well as a set + of classes for the most commonly used network protocols. libpcap can be + used to read packets from dump files or network devices and to inject + constructed packets into the network. --- python-pcs-0.6+debian.orig/debian/copyright +++ python-pcs-0.6+debian/debian/copyright @@ -0,0 +1,46 @@ +This package was debianized by Robert S. Edmonds on +Wed, 08 Aug 2007 01:21:50 -0400. + +It was downloaded from + http://sourceforge.net/projects/pcs/ + +Upstream Author: + George Neville-Neil + +Copyright: + Copyright (C) 2006 Neville-Neil Consulting + +License: + + Copyright (c) 2006, Neville-Neil Consulting + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + Neither the name of Neville-Neil Consulting nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS 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 COPYRIGHT + OWNER OR 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. + +The Debian packaging is (C) 2007, Robert S. Edmonds and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. --- python-pcs-0.6+debian.orig/debian/docs +++ python-pcs-0.6+debian/debian/docs @@ -0,0 +1,2 @@ +docs/tmp/pcs.pdf +docs/Web --- python-pcs-0.6+debian.orig/debian/examples +++ python-pcs-0.6+debian/debian/examples @@ -0,0 +1,2 @@ +scripts +tests --- python-pcs-0.6+debian.orig/debian/patches/00list +++ python-pcs-0.6+debian/debian/patches/00list @@ -0,0 +1,3 @@ +10_import_pypcap +10_remove_pypcap +10_fix_docs_build --- python-pcs-0.6+debian.orig/debian/patches/10_fix_docs_build.dpatch +++ python-pcs-0.6+debian/debian/patches/10_fix_docs_build.dpatch @@ -0,0 +1,36 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_fix_docs_build.dpatch by Andreas Wenning +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad python-pcs-0.6+debian~/docs/pcs.tex python-pcs-0.6+debian/docs/pcs.tex +--- python-pcs-0.6+debian~/docs/pcs.tex 2009-09-20 22:50:28.000000000 +0200 ++++ python-pcs-0.6+debian/docs/pcs.tex 2010-01-14 12:34:43.000000000 +0100 +@@ -556,11 +556,11 @@ + Figure \ref{fig:ethernet_packet_and_mapping_classes} shows an + abbreviated and combined listing of the \class{Ethernet} class and its + associated mapping class. The full implementation can be found in the +-source tree in the files \filepath{pcs/packets/ethernet.py} and +-\filepath{pcs/packets/ethernet_map.py} respectively. On line ++source tree in the files \file{pcs/packets/ethernet.py} and ++\file{pcs/packets/ethernet\_map.py} respectively. On line + \ref{list:map_class_variable} a class variable, one that will be + shared across all instances of this object, is created and set to the +-map that is defined in the \module{ethernet_map} module. ++map that is defined in the ethernet\_map module. + + The actual mapping of discriminators to higher layer packets is done + in the mapping module. Line \ref{list:importing_higher_layer_packets} +@@ -586,8 +586,8 @@ + + Mapping classes exist now for most packets, although some packets, + such as TCP and UDP, require special handling. Refer to the +-\method{next} method implementations in \filepath{pcs/packets/tcp.py} +-and \filepath{pcs/packets/udp.py} for more information. ++\method{next} method implementations in \file{pcs/packets/tcp.py} ++and \file{pcs/packets/udp.py} for more information. + + \section{Retrieving Packets} + \label{sec:retrieving-packets} --- python-pcs-0.6+debian.orig/debian/patches/10_import_pypcap.dpatch +++ python-pcs-0.6+debian/debian/patches/10_import_pypcap.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_import_pypcap.dpatch by Robert S. Edmonds +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: fake the pcs.pcap namespace + +@DPATCH@ +diff -urNad python-pcs-0.5+debian~/pcs/__init__.py python-pcs-0.5+debian/pcs/__init__.py +--- python-pcs-0.5+debian~/pcs/__init__.py 2007-08-08 23:47:52.000000000 -0400 ++++ python-pcs-0.5+debian/pcs/__init__.py 2007-08-14 22:12:14.000000000 -0400 +@@ -65,7 +65,8 @@ + # We need the socket module for to implement some of the Connector classes. + from socket import * + +-import pcs.pcap as pcap ++import pcap ++import sys; sys.modules['pcs.pcap'] = pcap + + import itertools + --- python-pcs-0.6+debian.orig/debian/patches/10_remove_pypcap.dpatch +++ python-pcs-0.6+debian/debian/patches/10_remove_pypcap.dpatch @@ -0,0 +1,108 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_remove_pypcap.dpatch by Andreas Wenning +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad python-pcs-0.6+debian~/setup.py python-pcs-0.6+debian/setup.py +--- python-pcs-0.6+debian~/setup.py 2009-09-22 03:57:30.000000000 +0200 ++++ python-pcs-0.6+debian/setup.py 2010-01-14 11:29:23.000000000 +0100 +@@ -38,79 +38,13 @@ + # + + from distutils.core import setup +-from distutils.command import config, clean + from distutils.extension import Extension + from Cython.Distutils import build_ext +-import glob, os, sys +- +-class config_pcap(config.config): +- description = 'configure pcap paths' +- user_options = [ ('with-pcap=', None, +- 'path to pcap build or installation directory') ] +- +- def initialize_options(self): +- config.config.initialize_options(self) +- self.dump_source = 0 +- self.noisy = 1 +- self.with_pcap = None +- +- def _write_config_h(self, cfg): +- # XXX - write out config.h for pcap_ex.c +- d = {} +- if os.path.exists(os.path.join(cfg['include_dirs'][0], 'pcap-int.h')): +- d['HAVE_PCAP_INT_H'] = 1 +- buf = open(os.path.join(cfg['include_dirs'][0], 'pcap.h')).read() +- if buf.find('pcap_file(') != -1: +- d['HAVE_PCAP_FILE'] = 1 +- if buf.find('pcap_compile_nopcap(') != -1: +- d['HAVE_PCAP_COMPILE_NOPCAP'] = 1 +- if buf.find('pcap_setnonblock(') != -1: +- d['HAVE_PCAP_SETNONBLOCK'] = 1 +- f = open('pcs/pcap/config.h', 'w') +- for k, v in d.iteritems(): +- f.write('#define %s %s\n' % (k, v)) +- f.close() +- +- def _pcap_config(self, dirs=[ None ]): +- cfg = {} +- if not dirs[0]: +- dirs = [ '/usr', sys.prefix ] + glob.glob('/opt/libpcap*') + \ +- glob.glob('../libpcap*') + glob.glob('../wpdpack*') +- for d in dirs: +- for sd in ('include/pcap', 'include', ''): +- incdirs = [ os.path.join(d, sd) ] +- if os.path.exists(os.path.join(d, sd, 'pcap.h')): +- cfg['include_dirs'] = [ os.path.join(d, sd) ] +- for sd in ('lib', ''): +- for lib in (('pcap', 'libpcap.a'), +- ('pcap', 'libpcap.dylib'), +- ('wpcap', 'wpcap.lib')): +- if os.path.exists(os.path.join(d, sd, lib[1])): +- cfg['library_dirs'] = [ os.path.join(d, sd) ] +- cfg['libraries'] = [ lib[0] ] +- if lib[0] == 'wpcap': +- cfg['libraries'].append('iphlpapi') +- cfg['extra_compile_args'] = \ +- [ '-DWIN32', '-DWPCAP' ] +- print 'found', cfg +- self._write_config_h(cfg) +- return cfg +- raise "couldn't find pcap build or installation directory" +- +- def run(self): +- self._pcap_config([ self.with_pcap ]) + + # XXX The Pyrex Distutils extension is currently unable to propagate + # dependencies on *.pxd files. If you change them you SHOULD rebuild from + # scratch to be sure dependencies are not stale. + +-pcap = Extension(name='pcs.pcap', +- sources=[ 'pcs/pcap/pcap.pyx', 'pcs/pcap/pcap_ex.c' ], +- include_dirs=['/usr/include/pcap', './pcs/bpf/', '.'], +- library_dirs=['/usr/lib'], +- libraries=['pcap'] +- ) +- + bpf = Extension(name='bpf', + sources=[ 'pcs/bpf/bpf.pyx' ], + include_dirs=['/usr/include/pcap'], +@@ -124,7 +58,7 @@ + libraries=[], + ) + +-pcs_cmds = { 'config': config_pcap, 'build_ext':build_ext } ++pcs_cmds = { 'build_ext':build_ext } + + setup(name='pcs', + version='0.6', +@@ -134,7 +68,7 @@ + url='http://pcs.sf.net', + packages = ['pcs', 'pcs.packets'], + cmdclass=pcs_cmds, +- ext_modules = [ bpf, clock, pcap ], ++ ext_modules = [ bpf, clock ], + ) + + --- python-pcs-0.6+debian.orig/debian/rules +++ python-pcs-0.6+debian/debian/rules @@ -0,0 +1,47 @@ +#!/usr/bin/make -f +#export DH_VERBOSE=1 + +include /usr/share/dpatch/dpatch.make + +PYVERS = $(shell pyversions -r) +PKG = python-pcs + +build: patch-stamp + dh_testdir + for python in $(PYVERS); do $$python setup.py config build; done + mkdir -p docs/tmp + cd docs \ + && pdflatex --output-directory=tmp pcs.tex \ + && pdflatex --output-directory=tmp pcs.tex + +clean: unpatch + dh_testdir + dh_testroot + rm -rf build docs/tmp + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + for python in $(PYVERS); do $$python setup.py install --no-compile --root=debian/$(PKG); done + +binary-indep: build install +binary-arch: build install + dh_testdir + dh_testroot + dh_python2 + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_link + dh_compress -Xexamples -Xpdf + dh_strip + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- python-pcs-0.6+debian.orig/debian/watch +++ python-pcs-0.6+debian/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://sf.net/pcs/pcs-(.*)\.tar\.gz