2 # Package Namespace is hardcoded. Modules must live in
5 package EximBuild::Modules::FileTextArrayFDW;
7 use EximBuild::Options;
12 # strip required namespace from package name
13 (my $MODULE = __PACKAGE__ ) =~ s/EximBuild::Modules:://;
15 use vars qw($VERSION); $VERSION = 'REL_0.1';
18 'checkout' => \&checkout,
19 'setup-target' => \&setup_target,
21 # 'need-run' => \&need_run,
22 # 'configure' => \&configure,
26 'install' => \&install,
27 'installcheck' => \&installcheck,
28 'cleanup' => \&cleanup,
33 my $class = __PACKAGE__;
35 my $buildroot = shift; # where we're building
36 my $branch = shift; # The branch of exim that's being built.
37 my $conf = shift; # ref to the whole config object
38 my $exim = shift; # exim build dir
40 #return unless $branch ge 'REL9_1_STABLE' || $branch eq 'HEAD';
42 # could even set up several of these (e.g. for different branches)
44 buildroot => $buildroot,
53 scmrepo => 'git://github.com/adunstan/file_text_array_fdw.git',
54 git_reference => undef,
55 git_keep_mirror => 'true',
56 git_ignore_mirror_failure => 'true',
57 build_root => $self->{buildroot},
60 $self->{scm} = new EximBuild::SCM $scmconf, 'file_text_array_fdw';
61 my $where = $self->{scm}->get_build_path();
62 $self->{where} = $where;
64 # for each instance you create, do:
65 main::register_module_hooks($self,$hooks);
72 my $savescmlog = shift; # array ref to the log lines
74 print main::time_str(), "checking out $MODULE\n" if $verbose;
76 my $scmlog = $self->{scm}->checkout($self->{eximbranch});
79 "------------- $MODULE checkout ----------------\n",@$scmlog);
86 # copy the code or setup a vpath dir if supported as appropriate
88 print main::time_str(), "copying source to ...$self->{where}\n"
91 $self->{scm}->copy_source(undef);
98 my $run_needed = shift; # ref to flag
103 print main::time_str(), "checking if run needed by $MODULE\n"
112 print main::time_str(), "configuring $MODULE\n" if $verbose;
120 print main::time_str(), "building $MODULE\n" if $verbose;
122 my $cmd = "PATH=../inst:$ENV{PATH} make USE_PGXS=1";
124 my @makeout = `cd $self->{where} && $cmd 2>&1`;
127 main::writelog("$MODULE-build",\@makeout);
128 print "======== make log ===========\n",@makeout if ($verbose > 1);
129 main::send_result("$MODULE-build",$status,\@makeout) if $status;
137 print main::time_str(), "installing $MODULE\n" if $verbose;
139 my $cmd = "PATH=../inst:$ENV{PATH} make USE_PGXS=1 install";
141 my @log = `cd $self->{where} && $cmd 2>&1`;
144 main::writelog("$MODULE-install",\@log);
145 print "======== install log ===========\n",@log if ($verbose > 1);
146 main::send_result("$MODULE-install",$status,\@log) if $status;
154 print main::time_str(), "checking ",__PACKAGE__,"\n" if $verbose;
162 print main::time_str(), "install-checking $MODULE\n" if $verbose;
164 my $cmd = "PATH=../inst:$ENV{PATH} make USE_PGXS=1 installcheck";
166 my @log = `cd $self->{where} && $cmd 2>&1`;
169 my $installdir = "$self->{buildroot}/$self->{eximbranch}/inst";
170 my @logfiles =("$self->{where}/regression.diffs","$installdir/logfile");
171 foreach my $logfile(@logfiles)
174 next unless (-e $logfile );
175 push(@log,"\n\n================== $logfile ==================\n");
177 open($handle,$logfile);
185 main::writelog("$MODULE-installcheck-$locale",\@log);
186 print "======== installcheck ($locale) log ===========\n",@log
188 main::send_result("$MODULE-installcheck-$locale",$status,\@log) if $status;
196 print main::time_str(), "cleaning up $MODULE\n" if $verbose > 1;
198 system("rm -rf $self->{where}");