-
- unless (
- GetOptions(
- 'directory=s' => \$context->{directory},
- 'webgen_base=s' => \$context->{webgen_base},
- 'tar=s' => \$context->{tar_cmd},
- 'make=s' => \$context->{make_cmd},
- 'lzip!' => \$context->{compressors}{lzip},
- 'verbose!' => \$verbose,
- 'debug!' => \$debug,
- 'help|?' => \$help,
- 'man!' => \$man,
- 'delete!' => \$delete,
- 'cleanup!' => \$cleanup,
- 'build-docs!' => \$context->{build_docs},
- 'web!' => \$context->{web},
- )
- )
- {
- pod2usage( -exitval => 1, -verbose => 0 );
- }
- pod2usage(0) if $help;
- pod2usage( -verbose => 2 ) if $man;
-
+ # We are creating files for mass distribution, so work harder to make smaller files.
+ $ENV{'GZIP'} = '-9';
+ $ENV{'BZIP2'} = '-9';
+ # xz documents minimum file sizes for levels higher than -6 to be useful and each
+ # requires more RAM on the decompressing system. Exim tarball currently 24MiB so
+ # using -8.
+ $ENV{'XZ_DEFAULTS'} = '-8';
+
+ GetOptions(
+ 'directory=s' => \$context->{directory},
+ 'webgen_base=s' => \$context->{webgen_base},
+ 'tar=s' => \$context->{tar_cmd},
+ 'make=s' => \$context->{make_cmd},
+ 'lzip!' => \$context->{compressors}{lzip},
+ 'verbose!' => \$verbose,
+ 'debug!' => \$debug,
+ 'help|?' => sub { pod2usage(-verbose => 1, -exit => 0) },
+ 'man!' => sub { pod2usage(-verbose => 2, -exit => 0, -noperldoc => system('perldoc -V >/dev/null 2>&1')) },
+ 'delete!' => \$delete,
+ 'cleanup!' => \$cleanup,
+ 'build-docs!' => \$context->{build_docs},
+ 'web!' => \$context->{web},
+ ) and @ARGV == 1 or pod2usage;
+
+ umask(022);