From: Matt S Trout Date: Sat, 14 Jul 2012 21:04:34 +0000 (+0000) Subject: test install creation script X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FApp-EzPz.git;a=commitdiff_plain;h=710038daa7cfefd17772433989638c8a227890e4 test install creation script --- diff --git a/bin/ezpz-create-test-ezmlm-install b/bin/ezpz-create-test-ezmlm-install new file mode 100755 index 0000000..b766352 --- /dev/null +++ b/bin/ezpz-create-test-ezmlm-install @@ -0,0 +1,40 @@ +#!/usr/bin/env perl + +use strictures 1; +use IO::All; +use Cwd; +use IPC::System::Simple qw(run); + +die "Usage: ezpz-create-test-ezmlm-install ezmlm-source.tgz build-dir install-dir" + unless @ARGV == 3; + +my ($ezmlm_tarball, $build_dir_path, $install_to_path) = @ARGV; + +my $orig_cwd = io->dir(cwd); + +my $build_dir = io->dir(io->dir($build_dir_path)->rel2abs); +my $install_to = io->dir(io->dir($install_to_path)->rel2abs); + +unless ($build_dir->exists) { + $build_dir->mkpath; + $build_dir->chdir; + run 'tar', '-xzf', $ezmlm_tarball; + $orig_cwd->chdir; +} + +my ($src_dir) = ($build_dir->all_dirs)[0]; + +die "No source dir found in ${build_dir}" unless $src_dir; + +foreach my $type (qw(bin etc lib man qmail)) { + $src_dir->catfile("conf-${type}")->print($install_to->catdir($type)."\n"); +} + +$src_dir->chdir; + +run make => 'clean'; +run 'make'; +run make => 'man'; +run './ezmlm-test'; +$install_to->catdir('bin')->mkpath; +run make => 'install';