openbsd-ports/www/reportmagic/patches/patch-Install_PL

89 lines
2.9 KiB
Plaintext

$OpenBSD: patch-Install_PL,v 1.2 2004/04/13 19:38:37 naddy Exp $
--- Install.PL.orig 2003-04-02 10:21:00.000000000 +0100
+++ Install.PL 2004-04-08 17:49:53.000000000 +0100
@@ -46,7 +46,7 @@ use strict;
use File::Copy;
use File::Path;
use Cwd;
-use vars qw( $DEST $DOC $FILE_MODE $EXEC_MODE );
+use vars qw( $DEST $PERL_DEST $BIN_DEST $DOC_DEST $FILE_MODE $EXEC_MODE );
#
# The following configurations may be made to modify the install
@@ -59,13 +59,15 @@ use vars qw( $DEST $DOC $FILE_MODE $EXEC
# example to use the version number in your path.
# Make sure this remains in single quotes.
#
-$DEST = '/usr/local/bin/rmagic-$(VERSION)/';
+$DEST = "$ENV{'PREFIX'}/share/reportmagic/";
+$BIN_DEST = "$ENV{'PREFIX'}/bin/";
+$PERL_DEST = "$ENV{'PREFIX'}/libdata/perl5/site_perl/";
#
# Where do you want documentation to be installed?
# You can use string concatenation, as in this example,
# to install the docs below the program.
-$DOC = $DEST . 'docs/';
+$DOC_DEST = "$ENV{'PREFIX'}/share/doc/reportmagic/";
#
@@ -100,19 +102,19 @@ foreach ( @ARGV ) {
$args{$k} = $v;
} else {
$DEST = $_;
- $DOC = $DEST . 'docs/';
+ $DOC_DEST = $DEST . 'docs/';
} # end if
} # end foreach
# Convert DEST, DOC
$DEST =~ s/\$\(VERSION\)/$VERSION/g;
-$DOC =~ s/\$\(VERSION\)/$VERSION/g;
+$DOC_DEST=~ s/\$\(VERSION\)/$VERSION/g;
if( $DEST !~ m#/$# ) {
$DEST .= '/';
} # end if
-if( $DOC !~ m#/$# ) {
- $DOC .= '/';
+if( $DOC_DEST !~ m#/$# ) {
+ $DOC_DEST .= '/';
} # end if
# Get CWD for later ('cause CPAN module is poorly behaved!)
@@ -246,16 +247,16 @@ unless( defined $args{only_modules} || $
print "... Installing Report Magic language files.\n";
&install( $FILE_MODE, 'lang/', $DEST.'lang/' ) || $err_cnt++;
print "... Installing Report Magic program files.\n";
- &install( $EXEC_MODE, 'rmagic.pl', $DEST ) || $err_cnt++;
- &install( $FILE_MODE, 'wadg/', $DEST.'wadg/' ) || $err_cnt++;
+ &install( $EXEC_MODE, 'rmagic.pl', $BIN_DEST.'rmagic' ) || $err_cnt++;
+ &install( $FILE_MODE, 'wadg/', $PERL_DEST.'wadg/' ) || $err_cnt++;
#
# Now install Report Magic Documentation
#
- print "Installing documentation in $DOC.\n";
- &install( $FILE_MODE, 'docs/', $DOC ) || $err_cnt++;
- &install( $FILE_MODE, 'docs/images/', $DOC.'images/' ) || $err_cnt++;
+ print "Installing documentation.\n";
+ &install( $FILE_MODE, 'docs/', $DOC_DEST ) || $err_cnt++;
+ &install( $FILE_MODE, 'docs/images/', $DOC_DEST.'images/' ) || $err_cnt++;
} # end unless
@@ -266,10 +267,8 @@ if( $err_cnt ) {
print "correct the situation. Often, by reading the error \n";
print "messages you can determine what needs to be changed.\n";
} else {
- $DOC = 'docs/' if defined $args{only_modules};
+ $DOC_DEST = 'docs/' if defined $args{only_modules};
print "\nInstallation complete.\n";
- print "For help on using Report Magic see $DOC"."index.html.\n";
- print "You must agree to the license agreement at $DOC"."license.html before using Report Magic.\n";
} # end if