Comment 2 for bug 1117755

Revision history for this message
Robert Ancell (robert-ancell) wrote :

This seems to do most of work and just requires

%:
 dh $@ --buildsystem=bake

in debian/rules. The main issue is I can't seem to know the 'destdir' at configure time which is what Bake currently expects..

# A debhelper build system class for handling Bake based projects.

package Debian::Debhelper::Buildsystem::bake;

use strict;
use base 'Debian::Debhelper::Buildsystem';

sub DESCRIPTION {
 "Bake (Recipe)"
}

sub check_auto_buildable {
 my $this=shift;
 return (-e $this->get_sourcepath("Recipe")) ? 1 : 0;
}

sub new {
 my $class=shift;
 my $this=$class->SUPER::new(@_);
 $this->enforce_in_source_building();
 return $this;
}

sub configure {
 my $this=shift;
 my $destdir=shift;

 # Standard set of options for configure.
 my @opts;
    # FIXME: Need to know the destdir at compile time
 # push @opts, "install-directory=$destdir";

 $this->doit_in_sourcedir("bake", "--configure", @opts, @_);
}

sub build {
 my $this=shift;
 $this->doit_in_sourcedir("bake", @_);
}

sub test {
 my $this=shift;
 $this->doit_in_sourcedir("bake", "test", @_);
}

sub install {
 my $this=shift;
 my $destdir=shift;
 $this->doit_in_sourcedir("bake", "install", @_);
}

sub clean {
 my $this=shift;
 $this->doit_in_sourcedir("bake", "clean", @_);
 $this->doit_in_sourcedir("bake", "--unconfigure", @_);
}

1