2001-07-17 21:57:57 +04:00
|
|
|
#!/usr/bin/perl
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# This script gets called after a full mozilla build & test.
|
|
|
|
# Use this to build and test an embedded or commercial branding of Mozilla.
|
|
|
|
#
|
|
|
|
# ./build-seamonkey-utils.pl will call PostMozilla::main() after
|
|
|
|
# a successful build and testing of mozilla. This package can report
|
|
|
|
# status via the $TinderUtils::build_status variable. Yeah this is a hack,
|
|
|
|
# but it works for now. Feel free to improve this mechanism to properly
|
|
|
|
# return values & stuff. -mcafee
|
|
|
|
#
|
2001-08-21 02:43:36 +04:00
|
|
|
# Things to do:
|
|
|
|
# * Get pull by branch working
|
|
|
|
#
|
|
|
|
#
|
2001-07-17 21:57:57 +04:00
|
|
|
use strict;
|
|
|
|
|
|
|
|
package PostMozilla;
|
|
|
|
|
2001-08-14 10:36:41 +04:00
|
|
|
sub checkout {
|
|
|
|
my ($mozilla_build_dir) = @_;
|
|
|
|
|
|
|
|
# chdir to build directory
|
|
|
|
chdir "$mozilla_build_dir";
|
|
|
|
|
2001-09-10 13:07:29 +04:00
|
|
|
# Hack to get around po/ChangeLog cvs conflict bug in gettext lib.
|
|
|
|
my $status = TinderUtils::run_shell_command("\\rm -f galeon/po/ChangeLog");
|
|
|
|
|
2001-10-19 03:36:57 +04:00
|
|
|
# Checkout galeon source. First set up cvsroot:
|
|
|
|
# Both of these as of 10/2001 are kinda flakey:
|
|
|
|
# $ENV{CVSROOT} = ":pserver:anonymous\@anoncvs.gnome.org:/cvs/gnome";
|
|
|
|
# $ENV{CVSROOT} = ":pserver:anonymous@cvs.galeon.sourceforge.net:/cvsroot/galeon";
|
|
|
|
#
|
|
|
|
# Asked for direct cvs access and got it:
|
|
|
|
$ENV{CVSROOT} = ":pserver:mcafee\@cvs.gnome.org:/cvs/gnome";
|
|
|
|
|
|
|
|
# Next, actually do the checkout:
|
2001-08-21 02:43:36 +04:00
|
|
|
my $status = TinderUtils::run_shell_command("$Settings::CVS checkout galeon");
|
2001-08-14 10:36:41 +04:00
|
|
|
|
|
|
|
# hack in the galeon prefs, if needed
|
|
|
|
|
|
|
|
return $status;
|
|
|
|
}
|
|
|
|
|
2001-07-17 21:57:57 +04:00
|
|
|
|
|
|
|
sub main {
|
2001-08-14 10:36:41 +04:00
|
|
|
my ($mozilla_build_dir) = @_;
|
|
|
|
|
2001-07-17 21:57:57 +04:00
|
|
|
TinderUtils::print_log "Post-Mozilla build goes here.\n";
|
|
|
|
|
2001-08-21 02:43:36 +04:00
|
|
|
# Pending a config file, stuff things here.
|
2001-07-17 21:57:57 +04:00
|
|
|
my $post_status = 'success'; # Success until we report a failure.
|
2001-09-10 07:27:27 +04:00
|
|
|
my $status = 0; # 0 = success
|
2001-08-16 06:48:40 +04:00
|
|
|
my $galeon_alive_test = 1;
|
|
|
|
my $galeon_test8_test = 1;
|
2001-08-14 10:36:41 +04:00
|
|
|
my $galeon_dir = "$mozilla_build_dir/galeon";
|
2001-09-10 07:27:27 +04:00
|
|
|
my $galeon_binary = "galeon-bin";
|
2001-07-17 21:57:57 +04:00
|
|
|
|
2001-08-14 10:36:41 +04:00
|
|
|
# Checkout/update the galeon code.
|
|
|
|
$status = checkout($mozilla_build_dir);
|
2001-09-10 07:27:27 +04:00
|
|
|
TinderUtils::print_log "Status from checkout: $status\n";
|
2001-07-17 21:57:57 +04:00
|
|
|
if ($status != 0) {
|
2001-08-14 10:36:41 +04:00
|
|
|
$post_status = 'busted';
|
2001-07-17 21:57:57 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# Build galeon if we passed the checkout command.
|
|
|
|
if ($post_status ne 'busted') {
|
2002-10-17 23:46:06 +04:00
|
|
|
# Build galeon.
|
|
|
|
|
|
|
|
chdir $galeon_dir;
|
|
|
|
|
|
|
|
# Make sure we have a configure
|
|
|
|
unless (-e "configure" and $post_status ne 'busted') {
|
|
|
|
$status = TinderUtils::run_shell_command("./autogen.sh");
|
|
|
|
TinderUtils::print_log "Status from autogen: $status\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
# Not sure how to only do this when we need to.
|
|
|
|
# Force a configure for now.
|
|
|
|
if ($status == 0) {
|
|
|
|
TinderUtils::print_log "configuring...\n";
|
|
|
|
$status = TinderUtils::run_shell_command("./configure --sysconfdir=/etc --with-mozilla-libs=$mozilla_build_dir/mozilla/dist/bin --with-mozilla-includes=$mozilla_build_dir/mozilla/dist/include --with-nspr-includes=$mozilla_build_dir/mozilla/dist/include/nspr --with-mozilla-home=$mozilla_build_dir/mozilla/dist/bin");
|
|
|
|
TinderUtils::print_log "Status from configure: $status\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($status == 0) {
|
|
|
|
TinderUtils::print_log "Deleting, gmake...\n";
|
|
|
|
TinderUtils::DeleteBinary("$galeon_dir/src/$galeon_binary");
|
|
|
|
|
|
|
|
my $foo = Cwd::getcwd();
|
|
|
|
TinderUtils::print_log "cwd = $foo\n";
|
|
|
|
$status = TinderUtils::run_shell_command("gmake");
|
|
|
|
TinderUtils::print_log "Status from gmake: $status\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
TinderUtils::print_log "Testing build status...\n";
|
|
|
|
if ($status != 0) {
|
|
|
|
TinderUtils::print_log "busted, gmake status non-zero\n";
|
|
|
|
$post_status = 'busted';
|
|
|
|
} elsif (not TinderUtils::BinaryExists("$galeon_dir/src/$galeon_binary")) {
|
|
|
|
TinderUtils::print_log "Error: binary not found: $galeon_dir/src/$galeon_binary\n";
|
|
|
|
$post_status = 'busted';
|
|
|
|
} else {
|
|
|
|
$post_status = 'success';
|
|
|
|
}
|
2001-07-17 21:57:57 +04:00
|
|
|
}
|
2002-10-17 23:46:06 +04:00
|
|
|
|
2001-07-17 21:57:57 +04:00
|
|
|
#
|
|
|
|
# Need a way to bypass initial setup dialog stuff, or
|
|
|
|
# we'll need to manually run this by hand the first time.
|
2001-07-22 06:02:53 +04:00
|
|
|
#
|
|
|
|
# Also, have to set crash_recovery=0 in ~/.gnome/galeon to avoid
|
|
|
|
# getting the crash dialog after the alive test times out.
|
|
|
|
#
|
2002-10-17 23:46:06 +04:00
|
|
|
|
2001-07-17 21:57:57 +04:00
|
|
|
# Test galeon, about:blank
|
|
|
|
if ($galeon_alive_test and $post_status eq 'success') {
|
2002-10-17 23:46:06 +04:00
|
|
|
$post_status = TinderUtils::AliveTest("GaleonAliveTest",
|
|
|
|
"$galeon_dir/src",
|
|
|
|
"galeon",
|
|
|
|
"about:blank",
|
|
|
|
45);
|
2001-07-17 21:57:57 +04:00
|
|
|
}
|
2002-10-17 23:46:06 +04:00
|
|
|
|
2001-07-17 21:57:57 +04:00
|
|
|
# Test galeon, test8
|
|
|
|
if ($galeon_test8_test and $post_status eq 'success') {
|
2002-10-17 23:46:06 +04:00
|
|
|
$post_status = TinderUtils::AliveTest("GaleonTest8Test",
|
|
|
|
"$galeon_dir/src",
|
|
|
|
"galeon",
|
|
|
|
"resource:///res/samples/test8.html",
|
|
|
|
45);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Startup test
|
|
|
|
if ($galeon_startup_test and $post_status eq 'success') {
|
|
|
|
TinderUtils::StartupPerformanceTest("GaleonStartupPerformanceTest",
|
|
|
|
"galeon",
|
|
|
|
"$galeon_dir/src",
|
|
|
|
"",
|
|
|
|
"$galeon_dir/src/../../../startup-test.html");
|
|
|
|
|
2001-07-17 21:57:57 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# Pass our status back to calling script.
|
|
|
|
return $post_status;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Need to end with a true value, (since we're using "require").
|
|
|
|
1;
|