Index: cvs/install.pl --- cvs/install.pl.orig 2008-05-17 16:22:38 +0200 +++ cvs/install.pl 2008-05-18 12:06:39 +0200 @@ -112,11 +112,11 @@ } # prior installation may not have supported .makepp/*.mk files --r "$datadir/FileInfo_makepp.pm" and - (stat "$datadir/FileInfo_makepp.pm")[9] < 1102710870 || # check-in time +-r "$ENV{DESTDIR}$datadir/FileInfo_makepp.pm" and + (stat "$ENV{DESTDIR}$datadir/FileInfo_makepp.pm")[9] < 1102710870 || # check-in time do { my $found; - open F, "$datadir/FileInfo_makepp.pm"; + open F, "$ENV{DESTDIR}$datadir/FileInfo_makepp.pm"; while( ) { $found = 1, last if /build_info_subdir.+\.mk/; } @@ -162,13 +162,13 @@ @sig_num{split ' ', $Config{sig_name}} = split ' ', $Config{sig_num}; $USR1 = $sig_num{USR1}; $USR1 = $USR1; # suppress used-only-once warning -substitute_file( $_, $bindir, 0755, 1 ) for +substitute_file( $_, "$ENV{DESTDIR}$bindir", 0755, 1 ) for qw(makepp makeppbuiltin makeppclean makeppgraph makeppinfo makepplog makepp_build_cache_control); -substitute_file( $_, $datadir, 0644 ) for +substitute_file( $_, "$ENV{DESTDIR}$datadir", 0644 ) for qw(recursive_makepp FileInfo_makepp.pm BuildCacheControl.pm); -make_dir("$datadir/$_") for +make_dir("$ENV{DESTDIR}$datadir/$_") for qw(ActionParser BuildCheck CommandParser Scanner Signature); foreach $module (qw(AutomakeFixer BuildCache FileInfo Glob MakeEvent Makecmds Makefile Makesubs Rule TextSubs Utils @@ -189,13 +189,13 @@ Signature Signature/c_compilation_md5 Signature/md5 Signature/shared_object Signature/verilog_simulation_md5 Signature/verilog_synthesis_md5)) { - copy("$module.pm", "$datadir/$module.pm"); - chmod 0644, "$datadir/$module.pm"; + copy("$module.pm", "$ENV{DESTDIR}$datadir/$module.pm"); + chmod 0644, "$ENV{DESTDIR}$datadir/$module.pm"; } foreach $include (qw(makepp_builtin_rules makepp_default_makefile)) { - copy("$include.mk", "$datadir/$include.mk"); - chmod 0644, "$datadir/$include.mk"; + copy("$include.mk", "$ENV{DESTDIR}$datadir/$include.mk"); + chmod 0644, "$ENV{DESTDIR}$datadir/$include.mk"; } # @@ -214,11 +214,11 @@ my $manfile = $file; $manfile =~ s/\.pod$/.1/; # Get the name of the man file. $manfile =~ s@^pod/@@; - system("pod2man $file > $mandir/man1/$manfile 2>/dev/null"); + system("pod2man $file > $ENV{DESTDIR}$mandir/man1/$manfile 2>/dev/null"); # Ignore stderr because older versions of # pod2man (e.g., perl 5.006) don't understand # =head3. - chmod 0644, "$mandir/man1/$manfile"; + chmod 0644, "$ENV{DESTDIR}$mandir/man1/$manfile"; } } @@ -387,8 +387,8 @@ $nav .= join '
', map $link{$_}, @links; } $nav .= ''; - open my $outfile, ">$htmldir_val/$_" or die "can't create `$htmldir_val/$_'--$!"; - chmod 0644, "$htmldir_val/$_"; + open my $outfile, ">$ENV{DESTDIR}$htmldir_val/$_" or die "can't create `$htmldir_val/$_'--$!"; + chmod 0644, "$ENV{DESTDIR}$htmldir_val/$_"; s/\.html$//; my $title = (s/^makepp(?:_|$)// ? 'Makepp ' : '') . $alias{$_ || 'makepp'}; my $index; @@ -540,11 +540,11 @@ unlink $tmp; for( qw'google.png makepp.gif makepp.css pre.png sflogo.png url.png' ) { - copy $_, "$htmldir_val/$_"; - chmod 0644, "$htmldir_val/$_"; + copy $_, "$ENV{DESTDIR}$htmldir_val/$_"; + chmod 0644, "$ENV{DESTDIR}$htmldir_val/$_"; } - symlink 'makepp.html', "$htmldir_val/index.html"; + symlink 'makepp.html', "$ENV{DESTDIR}$htmldir_val/index.html"; } # @@ -637,6 +637,7 @@ } sub read_with_prompt { + return undef; local $| = 1; # Enable autoflush on STDOUT. print @_; # Print the prompt.