On Thu, Apr 08, 2010 at 04:02:00PM +0200, Mike Hommey wrote:
> On Thu, Apr 08, 2010 at 03:54:57PM +0200, Benjamin Drung wrote:
> > Am Donnerstag, den 08.04.2010, 15:02 +0200 schrieb Mike Hommey:
> > > dh allows to create extra build systems, for use by dh_auto_configure,
> > > dh_auto_build and friends. The attached patch just does this.
> > > 
> > > Provided a package is a single extension, and has no tmp.xpi file in the
> > > source directory, the debian/rules can look like this:
> > > 
> > > #!/usr/bin/make -f
> > > %:
> > >   dh --with xul-ext --buildsystem=xul_ext $@
> > 
> > Thanks for the patch. Is it possible to rename the xpi to $PACKAGE.xpi?
> 
> I'd need to check if that's easily retrievable with the buildsystem API.
> 
> > Can
> > you update the patch against mozilla-devscripts 0.21, which was released
> > two days ago?
> 
> Ok.

Both done.

Mike
diff -Nru mozilla-devscripts-0.21/src/Makefile 
mozilla-devscripts-0.21+nmu1/src/Makefile
--- mozilla-devscripts-0.21/src/Makefile        2010-04-06 16:27:48.000000000 
+0200
+++ mozilla-devscripts-0.21.1/src/Makefile      2010-04-08 16:14:46.000000000 
+0200
@@ -101,6 +101,7 @@
        install -m 644 xul-app-data.csv.$(VENDOR) 
$(DESTDIR)$(DATADIR)/xul-app-data.csv
        mkdir -p $(DESTDIR)/usr/share/perl5/Debian/Debhelper/Sequence
        install -m 644 xul-ext.pm 
$(DESTDIR)/usr/share/perl5/Debian/Debhelper/Sequence/xul_ext.pm
+       install -m 644 xul-ext_build.pm 
$(DESTDIR)/usr/share/perl5/Debian/Debhelper/Buildsystem/xul_ext.pm
 
 clean:
        rm -f $(subst_files)
diff -Nru mozilla-devscripts-0.21/src/xul-ext_build.pm 
mozilla-devscripts-0.21+nmu1/src/xul-ext_build.pm
--- mozilla-devscripts-0.21/src/xul-ext_build.pm        1970-01-01 
01:00:00.000000000 +0100
+++ mozilla-devscripts-0.21.1/src/xul-ext_build.pm      2010-04-08 
16:14:57.000000000 +0200
@@ -0,0 +1,43 @@
+# A debhelper build system class for handling XUL extensions.
+#
+# Copyright: © 2010 Mike Hommey
+# License: GPL-2+
+
+package Debian::Debhelper::Buildsystem::xul_ext;
+
+use strict;
+use base 'Debian::Debhelper::Buildsystem';
+use Debian::Debhelper::Dh_Lib;
+
+sub DESCRIPTION {
+       "XUL Extensions"
+}
+
+sub check_auto_buildable {
+       my $this=shift;
+       return (-e $this->get_sourcepath("install.rdf")) ? 1 : 0;
+}
+
+sub new {
+       my $class=shift;
+       my $this=$class->SUPER::new(@_);
+       $this->enforce_in_source_building();
+       return $this;
+}
+
+sub build {
+       my $this=shift;
+       $this->doit_in_sourcedir("xpi-pack", ".", $dh{FIRSTPACKAGE} . ".xpi");
+}
+
+sub install {
+       my $this=shift;
+       $this->doit_in_sourcedir("install-xpi", $dh{FIRSTPACKAGE} . ".xpi");
+}
+
+sub clean {
+       my $this=shift;
+       $this->doit_in_sourcedir("rm", "-f", $dh{FIRSTPACKAGE} . ".xpi");
+}
+
+1

Reply via email to