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 if (grep(/^\Q$action\E$/, qw{build install clean})) {
33 if ($self->get_builddir()) {
34 unshift @_, "--build-base=" . $self->get_builddir();
36 doit("python", "setup.py", $act, @_);
41 $self->setup_py("build", @_);
47 $self->setup_py("install", "--root=$destdir", "--no-compile", "-O0", @_);
52 $self->setup_py("clean", "-a", @_);
53 # The setup.py might import files, leading to python creating pyc
55 doit('find', '.', '-name', '*.pyc', '-exec', 'rm', '{}', ';');