#!/usr/bin/perl #use lib './install_util'; use ExtUtils::MakeMaker; use GuessDirectories; use FindBin '$Bin'; use Cwd; require 5.005003; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. my $VERSION = '0.01'; WriteMakefile( NAME => 'Audio::DB', VERSION => $VERSION, PREREQ_PM => { }, PL_FILES => { 'bin/album_distribution.PLS' => 'bin/album_distribution.pl', 'bin/albums_below_threshold.PLS' => 'bin/albums_below_threshold.pl', 'bin/artists_with_multiple_genres.PLS' => 'bin/artists_with_multiple_genres.pl', 'bin/create_database.PLS' => 'bin/create_database.pl', 'bin/create_schema.PLS' => 'bin/create_schema.pl', 'bin/generate_album_list.PLS' => 'bin/generate_album_list.pl', 'bin/genre_statistics.PLS' => 'bin/genre_statistics.pl', 'bin/library_statistics.PLS' => 'bin/library_statistics.pl', 'bin/song_distribution.PLS' => 'bin/song_distribution.pl', }, ($] >= 5.005 ? (ABSTRACT => 'Relational databases and statistics of music collections' AUTHOR => 'Todd Harris (harris@cshl.edu)') : ()), ); my $working_dir = cwd; my @OPTIONS = qw(APACHE BIN CGIBIN HTDOCS CONF NONROOT LIB) my $OPTIONS = join ('|',@OPTIONS); my %OPTIONS; my @argv = @ARGV; @ARGV = (); foreach (@argv) { if (/^--?h/i) { die <); if (!$line || $line =~ /^[yY]/) { print STDERR "Using previous settings for file paths and options.\n"; open F,'MusicDB.def' or die "MusicDB.def: $!"; while () { chomp; next if /^\#/; next unless /^($OPTIONS)=(.+)/o; $OPTIONS{$1} = interpolate($2); } close F; } } $OPTIONS{APACHE} ||= $OPTIONS{PREFIX} if exists $OPTIONS{PREFIX}; $OPTIONS{BIN} ||= $OPTIONS{INSTALLSCRIPT} if exists $OPTIONS{INSTALLSCRIPT}; if ($OPTIONS{APACHE} && !(defined $OPTIONS{CONF})) { $OPTIONS{CONF} = "$OPTIONS{APACHE}/conf"; } if ($OPTIONS{APACHE} && !(defined $OPTIONS{HTDOCS})) { $OPTIONS{HTDOCS} = "$OPTIONS{APACHE}/htdocs"; } if ($OPTIONS{APACHE} && !(defined $OPTIONS{CGIBIN})) { $OPTIONS{CGIBIN} = "$OPTIONS{APACHE}/cgi-bin"; } # set hard-coded values $OPTIONS{APACHE} ||= '/usr/local/apache'; unless ($OPTIONS{CONF}) { $OPTIONS{CONF} = GuessDirectories->conf || "$OPTIONS{APACHE}/conf"; } unless ($OPTIONS{HTDOCS}) { $OPTIONS{HTDOCS} = GuessDirectories->htdocs || "$OPTIONS{APACHE}/htdocs"; } unless ($OPTIONS{CGIBIN}) { $OPTIONS{CGIBIN} = GuessDirectories->cgibin || "$OPTIONS{APACHE}/cgi-bin"; } unless (defined $OPTIONS{DO_XS}) { $OPTIONS{DO_XS} = $^O =~ /^(MSWin|dos)/i ? '' : 1; } # look for non-root installation if (defined $OPTIONS{NONROOT}) { $OPTIONS{INSTALLSITEMAN3DIR} = 'none'; $OPTIONS{INSTALLSITEMAN1DIR} = 'none'; } # workaround for known bug in FindBin library $Bin = "." if -f './Makefile.PL' && -T './Makefile.PL'; open F,">$Bin/GGB.def" or die "Can't open $Bin/MusicDB.def for writing: $!"; print F "# This hints file contains configuration information used by the generic browser\n\n"; print F "# To reconfigure, run perl Makefile.PL `cat MusicDB.def`\n\n"; foreach (keys %OPTIONS) { print F "$_=$OPTIONS{$_}\n"; } print F "VERSION=$VERSION\n"; close F; #print STDERR < 'Generic-Genome-Browser', ###### 'VERSION' => $VERSION, # 'PREREQ_PM' => { # Bio::Perl => 1.02, # GD => 2.07, # IO::String => 0, # Text::Shellwords => 1.0, # }, # e.g., Module::Name => 1.1 # PL_FILES => { # 'install_util/htdocs_install.PLS' => 'install_util/htdocs_install.pl', # 'install_util/cgi_install.PLS' => 'install_util/cgi_install.pl', # 'install_util/conf_install.PLS' => 'install_util/conf_install.pl', # 'bin/make_das_conf.PLS' => 'bin/make_das_conf.pl', # 'bin/process_sgd.PLS' => 'bin/process_sgd.pl', # 'bin/process_gadfly.PLS' => 'bin/process_gadfly.pl', # 'bin/process_wormbase.PLS' => 'bin/process_wormbase.pl', # 'bin/ucsc_genes2gff.PLS' => 'bin/ucsc_genes2gff.pl', # 'bin/load_genbank.PLS' => 'bin/load_genbank.pl', # 'bin/register_moby_services.PLS' => 'bin/register_moby_services.pl', # 'install_util/gbrowse_ppm_install.PLS' => 'gbrowse_ppm_install.pl', # 'cgi-bin/gbrowse.PLS' => 'cgi-bin/gbrowse', # 'cgi-bin/gbrowse_syn.PLS' => 'cgi-bin/gbrowse_syn', # 'cgi-bin/gbrowse_img.PLS' => 'cgi-bin/gbrowse_img', # 'cgi-bin/gbrowse_details.PLS' => 'cgi-bin/gbrowse_details', # 'cgi-bin/gbrowse_est.PLS' => 'cgi-bin/gbrowse_est', # 'cgi-bin/gbrowse_moby.PLS' => 'cgi-bin/gbrowse_moby', # 'cgi-bin/moby_server.PLS' => 'cgi-bin/moby_server', # 'cgi-bin/das.PLS' => 'cgi-bin/das', # 'conf/MobyServices/GbrowseServices.PMS' => 'conf/MobyServices/GbrowseServices.pm', # }, # EXE_FILES => [ # 'bin/register_moby_services.pl', # 'bin/make_das_conf.pl', # 'bin/process_wormbase.pl', # 'bin/process_sgd.pl', # 'bin/process_gadfly.pl', # 'bin/load_genbank.pl', # ], # 'LIBS' => [''], # e.g., '-lm' # 'LIB' => $OPTIONS{LIB}, # custom location for perl modules # 'DIR' => $OPTIONS{DO_XS} ? ['libalign'] : [], # 'DEFINE' => '', # 'INC' => '', # e.g., '-I/usr/include/other' ###### ($] ge '5.005') ? ( ###### 'AUTHOR' => 'Lincoln Stein (lstein@cshl.org)', ##### 'ABSTRACT' => 'A CGI-driven browser for genomic annotations.', ###### ) : (), # 'INSTALLSITEMAN1DIR' => $OPTIONS{INSTALLSITEMAN1DIR}, # don't install man pages for # 'INSTALLSITEMAN3DIR' => $OPTIONS{INSTALLSITEMAN3DIR}, # non-root user # 'INSTALLSCRIPT' => $OPTIONS{BIN} || $OPTIONS{INSTALLSCRIPT} #); #sub interpolate { # my $path = shift; # my ($to_expand,$homedir); # return $path unless $path =~ m!^~([^/]*)!; # eval { # if ($to_expand = $1) { # $homedir = (getpwnam($to_expand))[7]; # } else { # $homedir = (getpwuid($<))[7]; # } # return $path unless $homedir; # $path =~ s!^~[^/]*!$homedir!; # }; # return $path; #} #sub MY::clean { # package MY; # my $inherited = shift->SUPER::clean(@_); # $inherited .= "\t-\$(PERL) install_util/make_clean_add.pl\n"; # $inherited; #} #sub MY::dist_dir { # package MY; # my $inherited = shift->SUPER::dist_dir(@_); # $inherited =~ s!^(\s+.+)!\tpod2text docs/pod/INSTALL.pod > INSTALL\n$1!m; # $inherited; #} #sub MY::processPL { # package MY; # my $inherited = shift->SUPER::processPL(@_); # $inherited =~ s/(cgi-bin\/gbrowse\w*)\s\:\:.+/$1 : FORCE/g; # $inherited; #} #sub MY::install { # package MY; # my $inherited = shift->SUPER::install(@_); # $inherited =~ s/doc_install/doc_install conf_install cgi_install htdocs_install/; # $inherited; #} #sub MY::postamble { # my $paths; # for my $key (keys %OPTIONS) { # $paths .= qq('$key=$OPTIONS{$key}' ) if defined $OPTIONS{$key}; # } #qq{ #conf_install :: # \$(PERL) \"$working_dir/install_util/conf_install.pl\" $paths #htdocs_install :: # \$(PERL) \"$working_dir/install_util/htdocs_install.pl\" $paths #cgi_install :: # \$(PERL) \"$working_dir/install_util/cgi_install.pl\" $paths #}; #} #sub MY::ppd { # package MY; # my $repository = 'http://www.gmod.org/ggb/ppm'; # my $arch = 'MSWin32-x86-multi-thread'; # my $inherited = shift->SUPER::ppd(@_); # my $implementation; # my $newimp; # my $oldMM =0; ##VERY irritating--different versions of ExtUtils::MakeMaker has ##different ways of generating the ppd file. # if ($inherited =~ /qq\{(\\n)\}.*qq\{(\\t\\n)\}.*qq\{(\\t\\t\\n)\}/sg){ # $oldMM=1; # my $xml = $1.$2.$3; # #warn "$xml\n"; # $inherited =~ s/qq\{.*>>/qq{$xml}" >/s; # } elsif ($inherited =~ /NOECHO/) { # my @la = split /\n/, $inherited; # my $grab = 0; # for (@la) { # $grab++ if (m!!); # if ($grab and $_ =~ /\'(.*)\'/) { # $implementation .= "$1\n"; # } # $grab = 0 if (m!!); # } # } # if ($oldMM and $inherited =~ /(\s*\.*\<\/IMPLEMENTATION\>)/m) { # $implementation = $newimp = $1; # $newimp =~ s/ARCHITECTURE NAME=\\"\S+\\"/ARCHITECTURE NAME=\\"$arch\\"/; # $newimp =~ s/\$\(OSNAME\)/MSWin32/; # my $impl58 = $newimp; # $impl58 =~ s/\Q$arch\E/$arch\-5\.8/; # $newimp .= "\\n\\t\\t$impl58"; # $inherited =~ s/\Q$implementation\E/$newimp/; # } elsif (!$oldMM and $implementation) { # $newimp = $implementation; # $newimp =~ s/ARCHITECTURE NAME="\S+"/ARCHITECTURE NAME="$arch"/; # $newimp =~ s/\$\(OSNAME\)/MSWin32/; # my $impl58 = $newimp; # $impl58 =~ s/\Q$arch\E/$arch\-5\.8/; # $newimp .= $impl58; # my @la = split /\n/, $newimp; # for my $line (@la) { # $line = qq{\t\$(NOECHO) \$(ECHO) '$line' >> \$(DISTNAME).ppd}; # } # my @inherit_array = split /\n/, $inherited; # my @newinherit; # $inherited = ''; # for (@inherit_array) { # if (//) { # push @newinherit, @la; # last; # } else { # push @newinherit, $_; # } # } # push @newinherit, qq{\t\$(NOECHO) \$(ECHO) '' >> \$(DISTNAME).ppd\n}; # $inherited = join "\n", @newinherit; # } # $inherited .= <)!\\t\\t\\n\\1!' Generic-Genome-Browser.ppd # \@perl -pi -e 's!Bio-Perl!bioperl!' Generic-Genome-Browser.ppd #END #; #}