[prev in list] [next in list] [prev in thread] [next in thread]
List: openpkg-cvs
Subject: [CVS] OpenPKG: openpkg-src/perl-openpkg/ perl-openpkg.pl
From: "Ralf S. Engelschall" <rse () openpkg ! org>
Date: 2005-10-31 18:05:17
Message-ID: 20051031180517.4736C1B506D () master ! openpkg ! org
[Download RAW message or body]
OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: rse@openpkg.org
Module: openpkg-src Date: 31-Oct-2005 19:05:16
Branch: HEAD Handle: 2005103118051600
Modified files:
openpkg-src/perl-openpkg
perl-openpkg.pl
Log:
be more precise on choosing the build environment
Summary:
Revision Changes Path
1.16 +22 -22 openpkg-src/perl-openpkg/perl-openpkg.pl
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/perl-openpkg/perl-openpkg.pl
============================================================================
$ cvs diff -u -r1.15 -r1.16 perl-openpkg.pl
--- openpkg-src/perl-openpkg/perl-openpkg.pl 31 Oct 2005 16:01:49 -0000 1.15
+++ openpkg-src/perl-openpkg/perl-openpkg.pl 31 Oct 2005 18:05:16 -0000 1.16
@@ -328,9 +328,10 @@
if (grep { $_ eq "configure" } @steps_run) {
&verbose("step 2: configure");
- # determine Makefile.PL arguments
+ # determine build environment and basic arguments
+ my $environment = "";
my $perl_args = '';
- if (-f "Build.PL") {
+ if (-f "Build.PL" and (system("$perlwrap -MModule::Build -e '1;' >/dev/null \
2>&1") >> 8) == 0) { # new-style Module::Build "Build.PL"
$perl_args .= " installdirs=$CF->{perl_schema}";
$perl_args .= " --install_path libdoc=remove-me-later";
@@ -341,24 +342,29 @@
if ($CF->{path_libdir} ne '') {
$perl_args .= " --install_path lib=$CF->{path_libdir}";
}
+ $environment = 'Module::Build';
}
- elsif (-f "Makefile.PL") {
+ elsif (-f "Makefile.PL") { # ExtUtils::MakeMaker is part of the Perl \
distribution # old-style ExtUtils::MakeMaker "Makefile.PL"
$perl_args .= " PERL=$perlwrap FULLPERL=$perlwrap";
$perl_args .= " INSTALLDIRS=$CF->{perl_schema}";
$perl_args .= " INSTALLMAN3DIR=none INSTALLSITEMAN3DIR=none \
INSTALLVENDORMAN3DIR=none"; $perl_args .= " DESTDIR=$CF->{path_buildroot}";
- if ($CF->{path_prefix} ne '') {
+ if ($CF->{path_prefix} ne '' and $CF->{path_prefix} ne '@l_prefix@') {
$perl_args .= " PREFIX=$CF->{path_prefix}";
}
if ($CF->{path_libdir} ne '') {
$perl_args .= " LIB=$CF->{path_libdir}";
}
+ $environment = 'ExtUtils::MakeMaker';
}
else {
- die "neither Module::Build \"Build.PL\" nor ExtUtils::MakeMaker \
\"Makefile.PL\" file found"; + die "neither usable Module::Build \"Build.PL\" \
nor ExtUtils::MakeMaker \"Makefile.PL\" file found"; }
+ # determine build-time extra arguments
+ # (assuming that they are either work for both Module::Build and
+ # ExtUtils::MakeMaker or the supplier knows what is used by us)
if ($#{@{$CF->{perl_args}}} >= 0) {
my $user_args = join(" ", @{$CF->{perl_args}});
if ($user_args =~ m|#|) {
@@ -370,30 +376,24 @@
}
}
- # fixate Makefile.PL
- if (-f "Build.PL") {
- &runcmd("chmod u+rw Build.PL");
- &runcmd("cp Build.PL Build.PL.orig");
- &runcmd("sed -e \"s:\\\$^X:'$perlwrap':g\" <Build.PL.orig >Build.PL");
- }
- elsif (-f "Makefile.PL") {
- &runcmd("chmod u+rw Makefile.PL");
- &runcmd("cp Makefile.PL Makefile.PL.orig");
- &runcmd("sed -e \"s:\\\$^X:'$perlwrap':g\" <Makefile.PL.orig \
>Makefile.PL");
- }
-
# determine stdin
if ($CF->{perl_stdin} ne "-") {
$perl_args .= " <$CF->{perl_stdin}";
}
- # execute Makefile.PL
- if (-f "Build.PL") {
+ # setup the build environment
+ if ($environment eq 'Module::Build') {
&verbose("configuring module via Module::Build environment");
+ &runcmd("chmod u+rw Build.PL");
+ &runcmd("cp Build.PL Build.PL.orig");
+ &runcmd("sed -e \"s:\\\$^X:'$perlwrap':g\" <Build.PL.orig >Build.PL");
&runcmd("$perlwrap ./Build.PL $perl_args");
}
- elsif (-f "Makefile.PL") {
+ elsif ($environment eq 'ExtUtils::MakeMaker') {
&verbose("configuring module via ExtUtils::MakeMaker environment");
+ &runcmd("chmod u+rw Makefile.PL");
+ &runcmd("cp Makefile.PL Makefile.PL.orig");
+ &runcmd("sed -e \"s:\\\$^X:'$perlwrap':g\" <Makefile.PL.orig \
>Makefile.PL"); &runcmd("$perlwrap ./Makefile.PL $perl_args");
}
}
@@ -424,13 +424,13 @@
if (grep { $_ eq "install" } @steps_run) {
&verbose("step 4: install");
- if (-f "Build.PL") {
+ if (-f "Build.PL" and -f "Build") {
# execute Build script
&verbose("installing module via Module::Build environment");
&runcmd("$perlwrap Build install");
&runcmd("rm -rf $CF->{path_buildroot}$CF->{path_prefix}/remove-me-later");
}
- elsif (-f "Makefile.PL") {
+ elsif (-f "Makefile.PL" and -f "Makefile") {
# execute Makefile procedure
&verbose("installing module via ExtUtils::MakeMaker environment");
my $make = `$CF->{prog_rpm} --eval '\%{l_make} \%{l_mflags}'`;
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List openpkg-cvs@openpkg.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic