Skip to content

Instantly share code, notes, and snippets.

@chrisa
Created August 17, 2009 21:46
Show Gist options
  • Save chrisa/169395 to your computer and use it in GitHub Desktop.
Save chrisa/169395 to your computer and use it in GitHub Desktop.
$ENV{PERL_MM_USE_DEFAULT} = '1';
# cpan2rpm causes these to be set, which makes AutoInstall not install deps.
delete $ENV{PERL5_CPAN_IS_RUNNING};
delete $ENV{PERL5_CPANPLUS_IS_RUNNING};
use FindBin;
my $sitelib = "$FindBin::Bin/site-lib";
use local::lib '--self-contained', "$FindBin::Bin/site-lib";
# Load the Module::Install bundled in ./inc/
use lib '.';
use inc::Module::Install;
# Define metadata
name 'InstMaint';
all_from 'lib/InstMaint.pm';
# Specific dependencies
requires 'File::Find::Rule' => '0.30';
requires 'MIME::Lite' => '3.021';
requires 'Number::Compare' => '0.01';
requires 'Sys::SigAction' => '0.10';
requires 'Text::Glob' => '0.08';
requires 'Email::Date::Format' => '1.002';
requires 'Config::IniFiles' => '2.38';
requires 'Text::CSV' => '1.00';
requires 'IPC::Run' => '0.80';
requires 'POE' => '1.007';
requires 'POE::Component::Client::Stomp' => '0.09';
requires 'YAML::XS' => '0.32';
install_script 'script/instmaint';
install_script 'script/instmaint-helpers/instmaint-server';
install_script 'script/instmaint-helpers/instmaint-rsync';
auto_install;
sub MY::postamble {
my $lib = local::lib->install_base_perl_path($sitelib);
my $arch = local::lib->install_base_arch_path($sitelib);
use Config;
my $postamble =<<"END";
pure_instmaint_install :: all
\$(NOECHO) \$(MOD_INSTALL) \\
\$(INST_LIB) \$(INSTALL_BASE)/lib/perl5/vendor_perl \\
\$(INST_ARCHLIB) \$(INSTALL_BASE)/lib/perl5/vendor_perl/$Config{version}/$Config{archname} \\
\$(INST_BIN) \$(DESTINSTALLVENDORBIN) \\
\$(INST_SCRIPT) \$(DESTINSTALLVENDORSCRIPT) \\
\$(INST_MAN1DIR) \$(DESTINSTALLVENDORMAN1DIR) \\
\$(INST_MAN3DIR) \$(DESTINSTALLVENDORMAN3DIR)
doc_instmaint_install :: all
\$(NOECHO) \$(NOOP)
install_sitelib: all
(cd $arch && tar cf - . ) | (cd blib/arch && tar xf -)
(cd $lib && tar --exclude $Config{archname} -cf - . ) | (cd blib/lib && tar xf -)
END
}
installdirs 'instmaint';
WriteAll;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment