Commit | Line | Data |
710038da |
1 | #!/usr/bin/env perl |
2 | |
778d3118 |
3 | use lib (-d 'lib' ? ('lib') : ()); |
710038da |
4 | use strictures 1; |
5 | use IO::All; |
6 | use Cwd; |
7 | use IPC::System::Simple qw(run); |
8 | |
9 | die "Usage: ezpz-create-test-ezmlm-install ezmlm-source.tgz build-dir install-dir" |
10 | unless @ARGV == 3; |
11 | |
9ec9210e |
12 | my ($ezmlm_tarball_path, $build_dir_path, $install_to_path) = @ARGV; |
13 | |
14 | my $ezmlm_tarball = io->file(io->file($ezmlm_tarball_path)->rel2abs); |
710038da |
15 | |
16 | my $orig_cwd = io->dir(cwd); |
17 | |
6a99a8c7 |
18 | my $build_dir = io->dir($build_dir_path)->absolute; |
19 | my $install_to = io->dir($install_to_path)->absolute; |
710038da |
20 | |
21 | unless ($build_dir->exists) { |
22 | $build_dir->mkpath; |
23 | $build_dir->chdir; |
9ec9210e |
24 | run 'tar', 'xzf', $ezmlm_tarball; |
710038da |
25 | $orig_cwd->chdir; |
26 | } |
27 | |
28 | my ($src_dir) = ($build_dir->all_dirs)[0]; |
29 | |
30 | die "No source dir found in ${build_dir}" unless $src_dir; |
31 | |
32 | foreach my $type (qw(bin etc lib man qmail)) { |
33 | $src_dir->catfile("conf-${type}")->print($install_to->catdir($type)."\n"); |
34 | } |
35 | |
36 | $src_dir->chdir; |
37 | |
38 | run make => 'clean'; |
39 | run 'make'; |
40 | run make => 'man'; |
41 | run './ezmlm-test'; |
42 | $install_to->catdir('bin')->mkpath; |
43 | run make => 'install'; |