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 base 'Debian::Debhelper::Buildsystem';
17 sub check_auto_buildable {
19 return -e $this->get_sourcepath("setup.py");
26 if ($this->get_builddir()) {
27 unshift @_, "--build-base=" . $this->get_build_rel2sourcedir();
29 $this->doit_in_sourcedir("python", "setup.py", $act, @_);
34 $this->setup_py("build", @_);
40 $this->setup_py("install", "--root=$destdir", "--no-compile", "-O0", @_);
45 $this->setup_py("clean", "-a", @_);
46 # The setup.py might import files, leading to python creating pyc
48 $this->doit_in_sourcedir('find', '.', '-name', '*.pyc', '-exec', 'rm', '{}', ';');