installer - Install an .installer configuration file
version 0.004
# Directly usable without install via http://installer.pm curl -s -L http://installer.pm | perl - ~/myprojectenv # Will use .installer file in current directory installer ~/myprojectenv # Using a specific installer file installer -f /other/installer_file ~/myprojectenv # The .installer file can also be fetched by URL: installer -u http://stardestroyer.de/postgis.installer ~/myprojectenv # On shell do the following for using the environment after installation . ~/myprojectenv/export.sh
Sample .installer file might look like
perl "5.18.1"; url "http://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.gz", with => { pgport => 15432, }; url "http://download.osgeo.org/gdal/1.10.1/gdal-1.10.1.tar.gz"; url "http://download.osgeo.org/geos/geos-3.4.2.tar.bz2"; url "http://download.osgeo.org/postgis/source/postgis-2.1.0.tar.gz"; cpanm "DBD::Pg";
TOTALLY BETA, PLEASE TEST :D
Bigger example for installer file options:
url "http://host/file.tar.gz", with => { key => "value", other_key => undef, }, enable => [qw( satan )], disable => [qw( god )], without => [qw( religion )], testable => 1;
Would endup with the following parameter on ./configure: --with-key=value --with-other_key --enable-satan --disable-god --without-religion. Also it would run "make test" if there is a Makefile after configuration. Another options possible (so far):
url "http://host/file.tar.gz", custom_test => sub { $_[0]->run($_[0]->unpack_path,'testcommand','--args') }, custom_configure => sub { $self->run($self->unpack_path,'./Configure','-des','-Dprefix='.$self->target_directory); }, post_install => sub { $self->run(undef,'command'); # run in target directory after install }, export_sh => sub { return "# extra lines", "# for getting added to", "# export.sh"; };
Same options can go towards a local file:
file "/some/local/file.tar.gz";
You can also run a custom command (it will be run inside the target directory):
run "custom_command", "args", "args";
Install specific perl (so far no options):
perl "5.8.8";
Or install packages via cpanm:
cpanm qw( Yeb Dist::Zilla );
Be careful! It doesn't care if you have installed a perl in the target directory or not, and just fire up cpanm, so it would install on your local perl installation, if you don't install perl before.
Or install packages via pip:
pip qw( rtree imposm );
Be careful! It doesn't care if you have installed pip in the target directory or not, and just fire up pip, so it would install on your local python environment, if you don't installed pip before.
Torsten Raudssus <torsten@raudss.us>
This software is copyright (c) 2013 by Torsten Raudssus.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Installer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Installer
CPAN shell
perl -MCPAN -e shell install Installer
For more information on module installation, please visit the detailed CPAN module installation guide.