summaryrefslogtreecommitdiffstats
path: root/Build.PL
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-12-04 19:25:14 +0100
committerDavid Lawrence <dkl@mozilla.com>2014-12-04 19:25:14 +0100
commit57c99986924bfebb7ad044ec1753220d1ff243cc (patch)
treef949f983c279b98b6157335733e778a00aa89d70 /Build.PL
parent1aa5e76d25f0eb1d9d59909b486d9549458c95f0 (diff)
downloadbugzilla-57c99986924bfebb7ad044ec1753220d1ff243cc.tar.gz
bugzilla-57c99986924bfebb7ad044ec1753220d1ff243cc.tar.xz
Bug 1107275: Include Build.PL file for bmo/4.2 to install Perl dependencies (useful for Travis CI, etc.)
Diffstat (limited to 'Build.PL')
-rw-r--r--Build.PL61
1 files changed, 61 insertions, 0 deletions
diff --git a/Build.PL b/Build.PL
new file mode 100644
index 000000000..024a56024
--- /dev/null
+++ b/Build.PL
@@ -0,0 +1,61 @@
+#!/usr/bin/perl
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+
+use 5.10.1;
+use strict;
+use warnings;
+
+use FindBin qw($RealBin);
+use lib ($RealBin, "$RealBin/lib");
+
+use Module::Build 0.36_14;
+
+use Bugzilla::Install::Requirements qw(REQUIRED_MODULES OPTIONAL_MODULES);
+use Bugzilla::Constants qw(BUGZILLA_VERSION);
+
+sub requires {
+ my $requirements = REQUIRED_MODULES();
+ my $hrequires = {};
+ foreach my $module (@$requirements) {
+ $hrequires->{$module->{module}} = $module->{version};
+ }
+ return $hrequires;
+};
+
+sub build_requires {
+ return requires();
+}
+
+sub recommends {
+ my $recommends = OPTIONAL_MODULES();
+ my @blacklist = ('Apache-SizeLimit', 'mod_perl'); # Does not compile properly on Travis
+ my $hrecommends = {};
+ foreach my $module (@$recommends) {
+ next if grep($_ eq $module->{package}, @blacklist);
+ $hrecommends->{$module->{module}} = $module->{version};
+ }
+ return $hrecommends;
+}
+
+my $build = Module::Build->new(
+ module_name => 'Bugzilla',
+ dist_abstract => <<END,
+Bugzilla is a free bug-tracking system that is developed by an active
+community of volunteers. You can install and use it without having to
+pay any license fee.
+END
+ dist_version_from => 'Bugzilla/Constants.pm',
+ dist_version => BUGZILLA_VERSION,
+ requires => requires(),
+ recommends => recommends(),
+ license => 'Mozilla_2_0',
+ create_readme => 0,
+ create_makefile_pl => 0
+);
+
+$build->create_build_script;