include Makefile MANIFEST MANIFEST.in checkpath.pyx
+include debian/rules debian/changelog debian/copyright debian/control
PYREXC = pyrexc
prefix = /usr/local
-all: setup.py checkpath.c
+all: setup.py
$(PYTHON) setup.py build
clean: setup.py
$(PYTHON) setup.py clean
rm -rf build checkpath.c
-checkpath.c: checkpath.pyx
- pyrexc -o $@.new checkpath.pyx
- mv $@.new $@
-
-dist: setup.py checkpath.c
+dist: setup.py
$(PYTHON) setup.py sdist
-install: setup.py checkpath.c
+install: setup.py
$(PYTHON) setup.py install --prefix $(prefix)
.PHONY: all clean dist install
--- /dev/null
+python-checkpath (1.1.0) experimental; urgency=low
+
+ * Debianization!
+
+ -- Mark Wooding <mdw@distorted.org.uk> Thu, 13 Oct 2005 17:32:44 +0100
--- /dev/null
+Source: python-checkpath
+Section: libs
+Priority: extra
+Build-Depends:
+ python, python2.3, python2.3-pyrex, python2.4, python2.4-pyrex,
+ libcheckpath-dev, mlib-dev
+Maintainer: Mark Wooding <mdw@distorted.org.uk>
+Standards-Version: 3.1.1
+
+Package: python-checkpath
+Architecture: all
+Depends: ${python:Depends}
+Description: Checks paths for security
+ Walks a pathname, checking every symlink and directory on the way,
+ and issuing alerts if any element is writable by someone other than
+ the calling uid or root. Useful if you're paranoid. This package
+ just contains the shared library. If you want to write programs which
+ use this library, you need libcheckpath-dev.
+ .
+ This is a dummy package to install the correct bindings for the default
+ Debian verison of Python.
+
+Package: python2.3-checkpath
+Architecture: any
+Depends: ${shlibs:Depends}, ${python:Depends}
+Description: Checks paths for security
+ Walks a pathname, checking every symlink and directory on the way,
+ and issuing alerts if any element is writable by someone other than
+ the calling uid or root. Useful if you're paranoid. This package
+ just contains the shared library. If you want to write programs which
+ use this library, you need libcheckpath-dev.
+ .
+ This package contains a Python binding for the library for Python version
+ 2.3.
+
+Package: python2.4-checkpath
+Architecture: any
+Depends: ${shlibs:Depends}, ${python:Depends}
+Description: Checks paths for security
+ Walks a pathname, checking every symlink and directory on the way,
+ and issuing alerts if any element is writable by someone other than
+ the calling uid or root. Useful if you're paranoid. This package
+ just contains the shared library. If you want to write programs which
+ use this library, you need libcheckpath-dev.
+ .
+ This package contains a Python binding for the library for Python version
+ 2.4.
--- /dev/null
+chkpath-python is copyright (c) 2003 Straylight/Edgeware.
+
+chkpath-python is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+chkpath-python is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have a copy of the GNU General Public License in
+/usr/share/common-licenses/GPL; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+USA.
--- /dev/null
+#! /usr/bin/make -f
+
+export DH_COMPAT = 4
+
+DEFVERSION = 2.3
+VERSIONS = $(DEFVERSION) 2.4
+
+build: build-stamp
+
+build-stamp:
+ for v in $(VERSIONS); do python$$v setup.py build; done
+ touch build-stamp
+
+clean:
+ dh_clean
+ make clean
+ rm -rf build build-stamp
+
+install: build
+ dh_clean
+ for v in $(VERSIONS); do \
+ python$$v setup.py build; \
+ python$$v setup.py install --root=debian/python$$v-checkpath; \
+ done
+ mkdir -p debian/python-checkpath
+
+binary-indep: install
+ dh_testdir -i
+ dh_testroot -i
+ dh_compress -i
+ dh_installdocs -i
+ dh_python -i
+ dh_gencontrol -i
+ dh_fixperms -i
+ dh_installdeb -i
+ dh_md5sums -i
+ dh_builddeb -i
+
+binary-arch: install
+ dh_testdir -a
+ dh_testroot -a
+ dh_compress -a
+ dh_installdocs -a
+ dh_strip -a
+ dh_shlibdeps -a
+ dh_python -a
+ dh_gencontrol -a
+ dh_fixperms -a
+ dh_installdeb -a
+ dh_md5sums -a
+ dh_builddeb -a
+
+binary: binary-indep binary-arch
+
+source:
+ rm -rf dist/*.tar.gz dist/=deb=
+ python setup.py sdist
+ mkdir dist/=deb=
+ cd dist/=deb=; tar xvfz ../*.tar.gz
+ d=`pwd`; cd ..; dpkg-source -i -i'/\.svn/' -b $$d/dist/=deb=/*
+ rm -rf dist/=deb=
+
+.PHONY: binary binary-arch binary-indep clean install source build
#! /usr/bin/python
from distutils.core import setup, Extension
+from Pyrex.Distutils import build_ext
from os import *
from errno import *
libconfig('mLib', '2.0.3')
libconfig('checkpath', '1.1.0')
-class SubprocessFailure (Exception):
- def __init__(me, file, rc):
- me.args = (file, rc)
- me.file = file
- me.rc = rc
- def __str__(me):
- if WIFEXITED(me.rc):
- return '%s failed (rc = %d)' % (me.file, WEXITSTATUS(me.rc))
- elif WIFSIGNALED(me.rc):
- return '%s died (signal %d)' % (me.file, WTERMSIG(me.rc))
- else:
- return '%s died inexplicably' % (me.file)
-
chk = Extension('checkpath',
- ['checkpath.c'],
+ ['checkpath.pyx'],
+ ##extra_compile_args = ['-O0'],
include_dirs = uniquify(incdirs),
library_dirs = uniquify(libdirs),
libraries = uniquify(libs))
-setup(name = 'CheckPath',
+setup(name = 'checkpath-python',
version = '1.1.0',
description = 'Checking paths for security',
author = 'Straylight/Edgeware',
- author_email = 'mdw@nsict.org',
+ author_email = 'mdw@distorted.org.uk',
license = 'GNU General Public License',
- ext_modules = [chk])
+ ext_modules = [chk],
+ cmdclass = {'build_ext': build_ext})