summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Drung <bdrung@ubuntu.com>2011-07-09 20:22:00 +0200
committerBenjamin Drung <bdrung@ubuntu.com>2011-07-09 20:22:00 +0200
commitc5178d7b50957a9f54f9bed8a6d7ccf081798118 (patch)
tree5a69ef5711c18b80607bcec84bc52ead63934450
parentdf58f3a3d891a494232d6e49a5a1862a557e8930 (diff)
Add an --all parameter to dh_xul-ext to make packages that work with every
browser they can actually work with (Closes: #610499).
-rw-r--r--Makefile1
-rw-r--r--debian/changelog2
-rw-r--r--debian/control7
-rw-r--r--man/dh_xul-ext.16
-rw-r--r--src/Makefile3
-rwxr-xr-xsrc/dh_xul-ext56
-rw-r--r--tests/dh_xul-ext/all/debian/changelog5
-rw-r--r--tests/dh_xul-ext/all/debian/compat1
-rw-r--r--tests/dh_xul-ext/all/debian/control17
-rwxr-xr-xtests/dh_xul-ext/all/debian/rules8
-rw-r--r--tests/dh_xul-ext/all/install.rdf40
-rw-r--r--tests/dh_xul-ext/debian/debian/changelog5
-rw-r--r--tests/dh_xul-ext/debian/debian/compat1
-rw-r--r--tests/dh_xul-ext/debian/debian/control17
-rwxr-xr-xtests/dh_xul-ext/debian/debian/rules8
-rw-r--r--tests/dh_xul-ext/debian/install.rdf40
-rw-r--r--tests/dh_xul-ext/expected_result/all.substvars4
-rw-r--r--tests/dh_xul-ext/expected_result/debian.substvars4
-rw-r--r--tests/dh_xul-ext/expected_result/ubuntu.substvars4
-rwxr-xr-xtests/dh_xul-ext/test78
-rw-r--r--tests/dh_xul-ext/ubuntu/debian/changelog5
-rw-r--r--tests/dh_xul-ext/ubuntu/debian/compat1
-rw-r--r--tests/dh_xul-ext/ubuntu/debian/control17
-rwxr-xr-xtests/dh_xul-ext/ubuntu/debian/rules8
-rw-r--r--tests/dh_xul-ext/ubuntu/install.rdf40
25 files changed, 367 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 93207d8..4602c6a 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@ build:
$(MAKE) -C src $@
test:
+ tests/dh_xul-ext/test
tests/test-moz-version
install:
diff --git a/debian/changelog b/debian/changelog
index a4ce127..b5ab751 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ mozilla-devscripts (0.27) UNRELEASED; urgency=low
* Update package lists for Debian unstable and Ubuntu oneiric.
* Add a MOZ_XPI_CLEAN_COMMAND to xpi.mk; thanks to Ximin Luo for the patch
(Closes: #632895).
+ * Add an --all parameter to dh_xul-ext to make packages that work with every
+ browser they can actually work with (Closes: #610499).
-- Benjamin Drung <bdrung@debian.org> Sat, 09 Jul 2011 11:07:58 +0200
diff --git a/debian/control b/debian/control
index b8ae1bd..c9d967f 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,10 @@ Uploaders: Fabien Tassin <fta@ubuntu.com>,
Alexander Sack <asac@debian.org>,
Alexander Sack <asac@ubuntu.com>,
Benjamin Drung <bdrung@debian.org>
-Build-Depends: debhelper (>= 7), python-all (>= 2.6.6-3~)
+Build-Depends: debhelper (>= 7.0.50~),
+ dpkg-dev (>= 1.15.1),
+ python-all (>= 2.6.6-3~),
+ python-librdf
Standards-Version: 3.9.2
Homepage: https://launchpad.net/mozilla-devscripts
X-Python-Version: >= 2.6
@@ -15,7 +18,7 @@ Vcs-Browser: https://code.launchpad.net/~mozillateam/mozilla-devscripts/mozilla-
Package: mozilla-devscripts
Architecture: all
-Depends: dpkg-dev,
+Depends: dpkg-dev (>= 1.15.1),
fakeroot,
python-librdf,
quilt,
diff --git a/man/dh_xul-ext.1 b/man/dh_xul-ext.1
index f37f425..b54fa95 100644
--- a/man/dh_xul-ext.1
+++ b/man/dh_xul-ext.1
@@ -34,6 +34,12 @@ Unknown options will be ignored.
\fB\-h\fR, \fB\-\-help\fR
Display a brief help message.
.TP
+\fB\-a\fR, \fB\-\-all\fR
+Expand substvars to all known XUL applications. If this parameter is not
+provided, substvars will only be expanded to the XUL applications that are
+available on your distribution. Use this parameter if you want to create a
+package that can be installed on all Debian-based systems without recompiling.
+.TP
\fB\-p\fR \fIpackage\fP, \fB\-\-package\fR=\fIpackage\fP
Calcalate the substvars only for the specified package. If this parameter is not
provided, all package listed in the control file will be processed.
diff --git a/src/Makefile b/src/Makefile
index 04a65ae..1c285d1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -79,7 +79,8 @@ install: $(subst_files) $(extra_files) $(foreach dir,$(extra_dirs),$(wildcard $(
done
find $(DESTDIR)$(DATADIR) -type f \( -name \*.pl -o -name \*.sh \) -exec chmod -v 755 {} \;
chmod 755 $(DESTDIR)$(DATADIR)/minefield-packager.mk
- install -m 644 xul-app-data.csv.$(VENDOR) $(DESTDIR)$(DATADIR)/xul-app-data.csv
+ install -m 644 xul-app-data.csv.Debian $(DESTDIR)$(DATADIR)/xul-app-data.csv.Debian
+ install -m 644 xul-app-data.csv.Ubuntu $(DESTDIR)$(DATADIR)/xul-app-data.csv.Ubuntu
install -D -m 644 xul-ext.pm $(DESTDIR)$(PREFIX)/share/perl5/Debian/Debhelper/Sequence/xul_ext.pm
install -D -m 644 xul-ext_build.pm $(DESTDIR)$(PREFIX)/share/perl5/Debian/Debhelper/Buildsystem/xul_ext.pm
diff --git a/src/dh_xul-ext b/src/dh_xul-ext
index 8413b3f..df9cb2b 100755
--- a/src/dh_xul-ext
+++ b/src/dh_xul-ext
@@ -15,8 +15,10 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
import csv
+import glob
import optparse
import os
+import subprocess
import sys
from moz_version import compare_versions, convert_moz_to_debian_version
@@ -59,6 +61,9 @@ class XulApp(object):
versioned_package += " (>= " + deb_min_version + ")"
return versioned_package
+ def is_same_package(self, xul_app):
+ return self.xul_id == xul_app.xul_id and self.package == xul_app.package
+
def set_max_version(self, max_version):
if compare_versions(self.eol, max_version) > 0:
self.max_version = max_version
@@ -67,14 +72,44 @@ class XulApp(object):
if compare_versions(self.sol, min_version) < 0:
self.min_version = min_version
+ def update_version(self, sol, eol):
+ if compare_versions(self.sol, sol) > 0:
+ self.sol = sol
+ if compare_versions(self.eol, eol) < 0:
+ self.eol = eol
+
+
+def _get_data_dir():
+ """Get the data directory based on the module location."""
+ if __file__.startswith("/usr/bin"):
+ data_dir = "/usr/share/mozilla-devscripts"
+ else:
+ data_dir = os.path.dirname(__file__)
+ return data_dir
+
+def get_xul_apps(all_distros):
+ data_dir = _get_data_dir()
+ if all_distros:
+ csv_filenames = glob.glob(os.path.join(data_dir, "xul-app-data.csv.*"))
+ else:
+ cmd = ["dpkg-vendor", "--query", "Vendor"]
+ process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+ vendor = process.communicate()[0].strip()
+ csv_filenames = [os.path.join(data_dir, "xul-app-data.csv." + vendor)]
-def get_xul_apps():
- csvfile = open("/usr/share/mozilla-devscripts/xul-app-data.csv")
- csv_reader = csv.DictReader(csvfile)
xul_apps = []
- for row in csv_reader:
- xul_app = XulApp(row["id"], row["package"], row["sol"], row["eol"])
- xul_apps.append(xul_app)
+ for csv_filename in csv_filenames:
+ csvfile = open(csv_filename)
+ csv_reader = csv.DictReader(csvfile)
+ for row in csv_reader:
+ xul_app = XulApp(row["id"], row["package"], row["sol"], row["eol"])
+ existing = [x for x in xul_apps if x.is_same_package(xul_app)]
+ if existing:
+ xul_app = existing[0]
+ xul_app.update_version(row["sol"], row["eol"])
+ else:
+ xul_apps.append(xul_app)
+
return xul_apps
def get_supported_apps(script_name, xul_apps, install_rdf, package,
@@ -207,7 +242,9 @@ def find_install_rdfs(path):
def generate_substvars(script_name, xul_apps, package, verbose=False):
install_rdfs = find_install_rdfs("debian/" + package)
if len(install_rdfs) == 0:
- # this package does not contain a xul extension
+ if verbose:
+ print script_name + ": " + package + \
+ " does not contain a XUL extension (no install.rdf found)."
return
elif len(install_rdfs) > 1:
print >> sys.stderr, ("%s: %s contains multiple install.rdf files. "
@@ -277,6 +314,9 @@ def main():
script_name = os.path.basename(sys.argv[0])
epilog = "See %s(1) for more info." % (script_name)
parser = UnknownOptionIgnoringOptionParser(epilog=epilog)
+ parser.add_option("-a", "--all", action="store_true", dest="all",
+ help="expand substvars to all known XUL applications "
+ "(not only of your distribution)", default=False)
parser.add_option("-p", "--package", dest="packages", metavar="PACKAGE",
action="append", default=[],
help="calculate substvars only for the specified PACKAGE")
@@ -294,7 +334,7 @@ def main():
(script_name, unknown_option))
print script_name + ": packages:", ", ".join(options.packages)
- xul_apps = get_xul_apps()
+ xul_apps = get_xul_apps(options.all)
if options.verbose and len(xul_apps) > 0:
print script_name + ": found %i Xul applications:" % (len(xul_apps))
for xul_app in xul_apps:
diff --git a/tests/dh_xul-ext/all/debian/changelog b/tests/dh_xul-ext/all/debian/changelog
new file mode 100644
index 0000000..1b45ee9
--- /dev/null
+++ b/tests/dh_xul-ext/all/debian/changelog
@@ -0,0 +1,5 @@
+test-package (1.0-1) UNRELEASED; urgency=low
+
+ * Initial release.
+
+ -- Benjamin Drung <bdrung@debian.org> Sat, 09 Jul 2011 12:55:23 +0200
diff --git a/tests/dh_xul-ext/all/debian/compat b/tests/dh_xul-ext/all/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/tests/dh_xul-ext/all/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/tests/dh_xul-ext/all/debian/control b/tests/dh_xul-ext/all/debian/control
new file mode 100644
index 0000000..346ceba
--- /dev/null
+++ b/tests/dh_xul-ext/all/debian/control
@@ -0,0 +1,17 @@
+Source: test-package
+Section: web
+Priority: extra
+Maintainer: Ubuntu Mozilla Team <ubuntu-mozillateam@lists.ubuntu.com>
+Build-Depends: debhelper (>= 7.0.50~), mozilla-devscripts (>= 0.22~)
+Standards-Version: 3.9.2
+
+Package: xul-ext-test-package
+Architecture: all
+Depends: ${misc:Depends}, ${xpi:Depends}
+Recommends: ${xpi:Recommends}
+Provides: ${xpi:Provides}
+Enhances: ${xpi:Enhances}
+Description: mozilla-devscripts test package
+ This is a test package designed to test some scripts in mozilla-devscripts.
+ It is part of the mozilla-devscripts test suite and may do very odd things. It
+ should not be installed like a regular package. It may be an empty package.
diff --git a/tests/dh_xul-ext/all/debian/rules b/tests/dh_xul-ext/all/debian/rules
new file mode 100755
index 0000000..d69fe4a
--- /dev/null
+++ b/tests/dh_xul-ext/all/debian/rules
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
+
+override_dh_install:
+ dh_install install.rdf /usr/share/xul-ext/test-package/
+ ../../../src/dh_xul-ext -a
diff --git a/tests/dh_xul-ext/all/install.rdf b/tests/dh_xul-ext/all/install.rdf
new file mode 100644
index 0000000..773eaa0
--- /dev/null
+++ b/tests/dh_xul-ext/all/install.rdf
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+ <Description about="urn:mozilla:install-manifest">
+ <em:id>{deadda7a-fee1-dead-coo1-d00ddeadc0de}</em:id>
+ <em:version>1.0</em:version>
+ <em:name>mozilla-devscripts test package</em:name>
+ <em:targetApplication>
+ <Description>
+ <!-- Iceweasel/Firefox -->
+ <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+ <em:minVersion>3.5</em:minVersion>
+ <em:maxVersion>7.0a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Icedove/Thunderbird -->
+ <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
+ <em:minVersion>3.0</em:minVersion>
+ <em:maxVersion>7.0a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Iceape/Seamonkey -->
+ <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
+ <em:minVersion>2.0</em:minVersion>
+ <em:maxVersion>2.4a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Conkeror -->
+ <em:id>{a79fe89b-6662-4ff4-8e88-09950ad4dfde}</em:id>
+ <em:minVersion>0.1</em:minVersion>
+ <em:maxVersion>100.0</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ </Description>
+</RDF>
diff --git a/tests/dh_xul-ext/debian/debian/changelog b/tests/dh_xul-ext/debian/debian/changelog
new file mode 100644
index 0000000..1b45ee9
--- /dev/null
+++ b/tests/dh_xul-ext/debian/debian/changelog
@@ -0,0 +1,5 @@
+test-package (1.0-1) UNRELEASED; urgency=low
+
+ * Initial release.
+
+ -- Benjamin Drung <bdrung@debian.org> Sat, 09 Jul 2011 12:55:23 +0200
diff --git a/tests/dh_xul-ext/debian/debian/compat b/tests/dh_xul-ext/debian/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/tests/dh_xul-ext/debian/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/tests/dh_xul-ext/debian/debian/control b/tests/dh_xul-ext/debian/debian/control
new file mode 100644
index 0000000..346ceba
--- /dev/null
+++ b/tests/dh_xul-ext/debian/debian/control
@@ -0,0 +1,17 @@
+Source: test-package
+Section: web
+Priority: extra
+Maintainer: Ubuntu Mozilla Team <ubuntu-mozillateam@lists.ubuntu.com>
+Build-Depends: debhelper (>= 7.0.50~), mozilla-devscripts (>= 0.22~)
+Standards-Version: 3.9.2
+
+Package: xul-ext-test-package
+Architecture: all
+Depends: ${misc:Depends}, ${xpi:Depends}
+Recommends: ${xpi:Recommends}
+Provides: ${xpi:Provides}
+Enhances: ${xpi:Enhances}
+Description: mozilla-devscripts test package
+ This is a test package designed to test some scripts in mozilla-devscripts.
+ It is part of the mozilla-devscripts test suite and may do very odd things. It
+ should not be installed like a regular package. It may be an empty package.
diff --git a/tests/dh_xul-ext/debian/debian/rules b/tests/dh_xul-ext/debian/debian/rules
new file mode 100755
index 0000000..2872153
--- /dev/null
+++ b/tests/dh_xul-ext/debian/debian/rules
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
+
+override_dh_install:
+ dh_install install.rdf /usr/share/xul-ext/test-package/
+ DEB_VENDOR=Debian ../../../src/dh_xul-ext
diff --git a/tests/dh_xul-ext/debian/install.rdf b/tests/dh_xul-ext/debian/install.rdf
new file mode 100644
index 0000000..773eaa0
--- /dev/null
+++ b/tests/dh_xul-ext/debian/install.rdf
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+ <Description about="urn:mozilla:install-manifest">
+ <em:id>{deadda7a-fee1-dead-coo1-d00ddeadc0de}</em:id>
+ <em:version>1.0</em:version>
+ <em:name>mozilla-devscripts test package</em:name>
+ <em:targetApplication>
+ <Description>
+ <!-- Iceweasel/Firefox -->
+ <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+ <em:minVersion>3.5</em:minVersion>
+ <em:maxVersion>7.0a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Icedove/Thunderbird -->
+ <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
+ <em:minVersion>3.0</em:minVersion>
+ <em:maxVersion>7.0a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Iceape/Seamonkey -->
+ <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
+ <em:minVersion>2.0</em:minVersion>
+ <em:maxVersion>2.4a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Conkeror -->
+ <em:id>{a79fe89b-6662-4ff4-8e88-09950ad4dfde}</em:id>
+ <em:minVersion>0.1</em:minVersion>
+ <em:maxVersion>100.0</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ </Description>
+</RDF>
diff --git a/tests/dh_xul-ext/expected_result/all.substvars b/tests/dh_xul-ext/expected_result/all.substvars
new file mode 100644
index 0000000..0b86163
--- /dev/null
+++ b/tests/dh_xul-ext/expected_result/all.substvars
@@ -0,0 +1,4 @@
+xpi:Depends=iceweasel (>= 3.5) | icedove (>= 3.0) | iceape (>= 2.0) | conkeror | firefox | thunderbird (>= 3.0) | seamonkey (>= 2.0)
+xpi:Recommends=
+xpi:Enhances=conkeror, firefox, iceape, icedove, iceweasel, seamonkey, thunderbird
+xpi:Provides=conkeror-test-package, firefox-test-package, iceape-test-package, icedove-test-package, iceweasel-test-package, seamonkey-test-package, test-package, thunderbird-test-package
diff --git a/tests/dh_xul-ext/expected_result/debian.substvars b/tests/dh_xul-ext/expected_result/debian.substvars
new file mode 100644
index 0000000..923b41b
--- /dev/null
+++ b/tests/dh_xul-ext/expected_result/debian.substvars
@@ -0,0 +1,4 @@
+xpi:Depends=iceweasel (>= 3.5) | icedove (>= 3.0) | iceape (>= 2.0) | conkeror
+xpi:Recommends=
+xpi:Enhances=conkeror, iceape, icedove, iceweasel
+xpi:Provides=conkeror-test-package, iceape-test-package, icedove-test-package, iceweasel-test-package, test-package
diff --git a/tests/dh_xul-ext/expected_result/ubuntu.substvars b/tests/dh_xul-ext/expected_result/ubuntu.substvars
new file mode 100644
index 0000000..6f7e3be
--- /dev/null
+++ b/tests/dh_xul-ext/expected_result/ubuntu.substvars
@@ -0,0 +1,4 @@
+xpi:Depends=firefox | thunderbird (>= 3.0) | seamonkey (>= 2.0)
+xpi:Recommends=
+xpi:Enhances=firefox, seamonkey, thunderbird
+xpi:Provides=firefox-test-package, seamonkey-test-package, test-package, thunderbird-test-package
diff --git a/tests/dh_xul-ext/test b/tests/dh_xul-ext/test
new file mode 100755
index 0000000..9936ca6
--- /dev/null
+++ b/tests/dh_xul-ext/test
@@ -0,0 +1,78 @@
+#!/usr/bin/python
+
+# Copyright (c) 2011, Benjamin Drung <bdrung@debian.org>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+import os
+import sys
+import subprocess
+
+TESTS = ("all", "debian", "ubuntu")
+
+class TestError(Exception):
+ pass
+
+def escape_arg(arg):
+ "Shell-escpae arg, if necessary"
+ if ' ' not in arg:
+ return arg
+ return '"%s"' % arg.replace('\\', r'\\').replace('"', r'\"')
+
+def fail(message):
+ print >> sys.stderr, "dh_xul-ext test error: " + message
+ sys.exit(1)
+
+def check_call(cmd, cwd=None):
+ return_code = subprocess.call(cmd, cwd=cwd)
+ if return_code != 0:
+ raise TestError("'" + " ".join(escape_arg(cmd)) + "' returned " +
+ str(return_code) + ".")
+
+def compare_files(file1, file2):
+ actual = open(file1).read().strip()
+ expected = open(file2).read().strip()
+ if actual != expected:
+ raise TestError("Actual substvars files differs from expected file.\n"
+ "Expected content:\n" + expected + "\n" + \
+ "Actual content:\n" + actual)
+
+def test_dh_xul_ext(test):
+ basedir = os.path.dirname(__file__)
+ testdir = os.path.join(basedir, test)
+ clean_cmd = ["fakeroot", "debian/rules", "clean"]
+ check_call(clean_cmd, cwd=testdir)
+ try:
+ cmd = ["fakeroot", "debian/rules", "install"]
+ check_call(cmd, cwd=testdir)
+ substvars = os.path.join(testdir, "debian",
+ "xul-ext-test-package.substvars")
+ expected = os.path.join(basedir, "expected_result", test + ".substvars")
+ compare_files(substvars, expected)
+ finally:
+ check_call(clean_cmd, cwd=testdir)
+
+def main():
+ errors = 0
+ for test in TESTS:
+ try:
+ test_dh_xul_ext(test)
+ except TestError, error:
+ errors += 1
+ print >> sys.stderr, "dh_xul-ext error in " + test + " test: " + \
+ str(error)
+ if errors > 0:
+ sys.exit(1)
+
+if __name__ == "__main__":
+ main()
diff --git a/tests/dh_xul-ext/ubuntu/debian/changelog b/tests/dh_xul-ext/ubuntu/debian/changelog
new file mode 100644
index 0000000..1b45ee9
--- /dev/null
+++ b/tests/dh_xul-ext/ubuntu/debian/changelog
@@ -0,0 +1,5 @@
+test-package (1.0-1) UNRELEASED; urgency=low
+
+ * Initial release.
+
+ -- Benjamin Drung <bdrung@debian.org> Sat, 09 Jul 2011 12:55:23 +0200
diff --git a/tests/dh_xul-ext/ubuntu/debian/compat b/tests/dh_xul-ext/ubuntu/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/tests/dh_xul-ext/ubuntu/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/tests/dh_xul-ext/ubuntu/debian/control b/tests/dh_xul-ext/ubuntu/debian/control
new file mode 100644
index 0000000..346ceba
--- /dev/null
+++ b/tests/dh_xul-ext/ubuntu/debian/control
@@ -0,0 +1,17 @@
+Source: test-package
+Section: web
+Priority: extra
+Maintainer: Ubuntu Mozilla Team <ubuntu-mozillateam@lists.ubuntu.com>
+Build-Depends: debhelper (>= 7.0.50~), mozilla-devscripts (>= 0.22~)
+Standards-Version: 3.9.2
+
+Package: xul-ext-test-package
+Architecture: all
+Depends: ${misc:Depends}, ${xpi:Depends}
+Recommends: ${xpi:Recommends}
+Provides: ${xpi:Provides}
+Enhances: ${xpi:Enhances}
+Description: mozilla-devscripts test package
+ This is a test package designed to test some scripts in mozilla-devscripts.
+ It is part of the mozilla-devscripts test suite and may do very odd things. It
+ should not be installed like a regular package. It may be an empty package.
diff --git a/tests/dh_xul-ext/ubuntu/debian/rules b/tests/dh_xul-ext/ubuntu/debian/rules
new file mode 100755
index 0000000..0d70add
--- /dev/null
+++ b/tests/dh_xul-ext/ubuntu/debian/rules
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
+
+override_dh_install:
+ dh_install install.rdf /usr/share/xul-ext/test-package/
+ DEB_VENDOR=Ubuntu ../../../src/dh_xul-ext
diff --git a/tests/dh_xul-ext/ubuntu/install.rdf b/tests/dh_xul-ext/ubuntu/install.rdf
new file mode 100644
index 0000000..773eaa0
--- /dev/null
+++ b/tests/dh_xul-ext/ubuntu/install.rdf
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+ <Description about="urn:mozilla:install-manifest">
+ <em:id>{deadda7a-fee1-dead-coo1-d00ddeadc0de}</em:id>
+ <em:version>1.0</em:version>
+ <em:name>mozilla-devscripts test package</em:name>
+ <em:targetApplication>
+ <Description>
+ <!-- Iceweasel/Firefox -->
+ <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+ <em:minVersion>3.5</em:minVersion>
+ <em:maxVersion>7.0a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Icedove/Thunderbird -->
+ <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
+ <em:minVersion>3.0</em:minVersion>
+ <em:maxVersion>7.0a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Iceape/Seamonkey -->
+ <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
+ <em:minVersion>2.0</em:minVersion>
+ <em:maxVersion>2.4a1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ <em:targetApplication>
+ <Description>
+ <!-- Conkeror -->
+ <em:id>{a79fe89b-6662-4ff4-8e88-09950ad4dfde}</em:id>
+ <em:minVersion>0.1</em:minVersion>
+ <em:maxVersion>100.0</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ </Description>
+</RDF>