1 # A buildsystem plugin for building Python Distutils based
4 # Copyright: © 2008 Joey Hess
5 # © 2008-2009 Modestas Vainius
8 package Debian::Debhelper::Buildsystem::python_distutils;
11 use Debian::Debhelper::Dh_Lib;
12 use base 'Debian::Debhelper::Dh_Buildsystem_Basic';
15 "support for building Python distutils based packages"
18 sub is_auto_buildable {
22 # Handle build install clean; the rest - next class
23 # XXX JEH shouldn't it also handle configure? It would be handled
24 # by doing nothing, but that's what's appropriate for python.
25 if (grep(/^\Q$action\E$/, qw{build install clean})) {
35 if ($self->get_builddir()) {
36 unshift @_, "--build-base=" . $self->get_builddir();
38 doit("python", "setup.py", $act, @_);
43 $self->setup_py("build", @_);
49 $self->setup_py("install", "--root=$destdir", "--no-compile", "-O0", @_);
54 $self->setup_py("clean", "-a", @_);
55 # The setup.py might import files, leading to python creating pyc
57 doit('find', '.', '-name', '*.pyc', '-exec', 'rm', '{}', ';');