X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Build.PL;h=27a9feee4fb43c3b07bf94a8b785b111b2f1a644;hb=50f63fb11060a1f9f0a013bd79ec05d94e4ee151;hp=34fcfd3fbba5c41d431daf3a63732dd0e0635707;hpb=a4fb1ddcc7c3257b7a8eafce20cbfef9fbd1332a;p=dbsrgits%2FSQL-Translator.git diff --git a/Build.PL b/Build.PL index 34fcfd3..27a9fee 100644 --- a/Build.PL +++ b/Build.PL @@ -1,9 +1,10 @@ -# $Id: Build.PL,v 1.8 2005-06-28 21:43:49 duality72 Exp $ +# $Id: Build.PL,v 1.9 2006-01-20 15:04:55 grommit Exp $ use strict; -use Module::Build; +use lib './lib'; +use SQL::Translator::Module::Build; -my $builder = Module::Build->new( +my $builder = SQL::Translator::Module::Build->new( create_readme => 0, dist_abstract => 'SQL DDL transformations and more', dist_author => 'Ken Y. Clark ', @@ -46,7 +47,32 @@ my $builder = Module::Build->new( 'Test::More' => 0.6, 'Test::Exception' => 0, 'Test::Differences' => 0, - } + }, + + get_options => { + # Where to store additional files such as templates. + # TODO: Should be OS dependant. See Module::Build::os_type() + install_dir => { type=>'=s', default=>'/usr/local/share/sqlfairy' }, + }, ); + +my $install_dir = $builder->args('install_dir'); +print "SqlFairy needs to install some additional files such as templates.\n"; +$install_dir = $builder->prompt( "Where should they go?", $install_dir ); +print "\n"; + +# Add the install (and template) dir to the config data. They will then be +# available via the (Module::Build) generated SQL::Translator::ConfigData. +# During build time they are availiable from $builder->config_data( NAME ) +my $template_dir = "$install_dir/template"; +$builder->config_data( install_dir => $install_dir ); +$builder->config_data( template_dir => $template_dir ); + +# Add build element for templates, these are processed by +# SQL::Translator::Module::Build::process_template_files +$builder->add_build_element('template'); +$builder->install_path->{template} = $template_dir; + + $builder->create_build_script; print "Now run './Build', './Build test', and './Build install'\n";