#!/usr/bin/perl -w use strict; use Module::Build; # don't prompt the user if we're not being called interactively (e.g., if we're # being called from cron or some such program instead of directly by the user): my $interactive; $interactive = 1 if (-t STDIN and -t STDOUT); # first, make sure the line endings in the test items are correct: my %files_and_newlines = ( 'index' => 'LF', gp_index => 'CRLF', gp_s_byte_term => 'LF', gp_s_period_term => 'CRLF', gp_s_no_term => 'CRLF', gp_byte_term => 'CR', gp_period_term => 'CRLF', gp_no_term => 'LF', gp_partial_response => 'LF', item_blocks => 'CR', directory_blocks => 'LF', error_not_found => 'CRLF', error_multiline => 'CR', malformed_menu => 'LF', bad_blocks => 'LF' ); print "Converting the line endings in the test items...\n" if ($interactive); while (my ($file, $nl) = each %files_and_newlines) { my $rc = system("perl ./t/newlines.pl -n $nl ./t/items/$file"); die "Couldn't fix line endings in test item ($file) via newlines.pl: $!" if ($rc); } print "Done.\n\n" if ($interactive); print < to continue. END_OF_MESSAGE if ($interactive); my $mb = new Module::Build ( module_name => 'Net::Gopher', license => 'LGPL', requires => { IO => 1.20, URI => 1.27 } )->create_build_script;