]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Buildsystem/python_distutils.pm
merge master
[debhelper.git] / Debian / Debhelper / Buildsystem / python_distutils.pm
index 2e7eacbb30eae5a9e3225e49d6b512f6ebd608e7..01a8c14ea28d2c21df796c3a2b99416ac2e5a020 100644 (file)
@@ -9,54 +9,40 @@ package Debian::Debhelper::Buildsystem::python_distutils;
 
 use strict;
 use Debian::Debhelper::Dh_Lib;
-use Debian::Debhelper::Dh_Buildsystem_Bases;
-use base 'Debian::Debhelper::Dh_Buildsystem_Option';
+use base 'Debian::Debhelper::Buildsystem';
 
 sub DESCRIPTION {
-       "support for building Python distutils based packages"
+       "Python distutils"
 }
 
-sub is_buildable {
+sub check_auto_buildable {
        return -e "setup.py";
 }
 
-sub get_builddir_option {
-       my $self=shift;
-       if ($self->get_builddir()) {
-               return "--build-base=". $self->get_builddir();
-       }
-       return;
-}
-
-# XXX JEH the default for all these methods is to do nothing successfully.
-# So either this, or those default stubs, need to be removed.
-sub configure_impl {
-       # Do nothing
-       1;
-}
+sub setup_py {
+       my $this=shift;
+       my $act=shift;
 
-sub build_impl {
-       my $self=shift;
-       doit("python", "setup.py", "build", @_);
+       if ($this->get_builddir()) {
+               unshift @_, "--build-base=" . $this->get_builddir();
+       }
+       doit("python", "setup.py", $act, @_);
 }
 
-# XXX JEH see anove comment
-sub test_impl {
-       1;
+sub build {
+       my $this=shift;
+       $this->setup_py("build", @_);
 }
 
-sub install_impl {
-       my $self=shift;
+sub install {
+       my $this=shift;
        my $destdir=shift;
-
-       doit("python", "setup.py", "install", 
-            "--root=$destdir",
-            "--no-compile", "-O0", @_);
+       $this->setup_py("install", "--root=$destdir", "--no-compile", "-O0", @_);
 }
 
-sub clean_impl {
-       my $self=shift;
-       doit("python", "setup.py", "clean", "-a", @_);
+sub clean {
+       my $this=shift;
+       $this->setup_py("clean", "-a", @_);
        # The setup.py might import files, leading to python creating pyc
        # files.
        doit('find', '.', '-name', '*.pyc', '-exec', 'rm', '{}', ';');