3 use lib (-d 'lib' ? ('lib') : ());
7 use IPC::System::Simple qw(run);
9 die "Usage: ezpz-create-test-ezmlm-install ezmlm-source.tgz build-dir install-dir"
12 my ($ezmlm_tarball_path, $build_dir_path, $install_to_path) = @ARGV;
14 my $ezmlm_tarball = io->file(io->file($ezmlm_tarball_path)->rel2abs);
16 my $orig_cwd = io->dir(cwd);
18 my $build_dir = io->dir(io->dir($build_dir_path)->rel2abs);
19 my $install_to = io->dir(io->dir($install_to_path)->rel2abs);
21 unless ($build_dir->exists) {
24 run 'tar', 'xzf', $ezmlm_tarball;
28 my ($src_dir) = ($build_dir->all_dirs)[0];
30 die "No source dir found in ${build_dir}" unless $src_dir;
32 foreach my $type (qw(bin etc lib man qmail)) {
33 $src_dir->catfile("conf-${type}")->print($install_to->catdir($type)."\n");
42 $install_to->catdir('bin')->mkpath;
43 run make => 'install';