Author: randyk
Date: Sun Apr 24 19:42:41 2005
New Revision: 164528

URL: http://svn.apache.org/viewcvs?rev=164528&view=rev
Log:
Generate a PREREQ_PM in Makefile to list the perl prerequisites,
for the benefit of CPAN clients.

Modified:
    httpd/apreq/trunk/Makefile.am
    httpd/apreq/trunk/build/version_check.pl
    httpd/apreq/trunk/buildconf

Modified: httpd/apreq/trunk/Makefile.am
URL: 
http://svn.apache.org/viewcvs/httpd/apreq/trunk/Makefile.am?rev=164528&r1=164527&r2=164528&view=diff
==============================================================================
--- httpd/apreq/trunk/Makefile.am (original)
+++ httpd/apreq/trunk/Makefile.am Sun Apr 24 19:42:41 2005
@@ -1,8 +1,10 @@
+#   The following is a trick to get CPAN clients to follow prerequisites:
 #
+#    PREREQ_PM
 #
-# XXX  Trick the cpan client by listing some EU::MM-ish prereqs here? XXX
-#
-#
+
+# --- MakeMaker post_initialize section:
+
 
 AUTOMAKE_OPTIONS = foreign
 SUBDIRS = . include library module glue

Modified: httpd/apreq/trunk/build/version_check.pl
URL: 
http://svn.apache.org/viewcvs/httpd/apreq/trunk/build/version_check.pl?rev=164528&r1=164527&r2=164528&view=diff
==============================================================================
--- httpd/apreq/trunk/build/version_check.pl (original)
+++ httpd/apreq/trunk/build/version_check.pl Sun Apr 24 19:42:41 2005
@@ -93,6 +93,21 @@
     }
 }
 
+sub perl_prereqs {
+    my @prereqs = map {"$_ => q[$perl_glue{$_}->{version}]"} 
+        grep {!m{perl}} keys %perl_glue;
+    my $prereq_string = '';
+    if (@prereqs) {
+      $prereq_string = 'PREREQ_PM => { ' . (join ', ', @prereqs) . ' }'; 
+    }
+    return $prereq_string;
+}
+
+if ($path eq 'perl_prereqs') {
+    print perl_prereqs();
+    exit;
+}
+
 if (@ARGV == 0) {
 
     if ($opts{version}) {      # generate META.yml file content

Modified: httpd/apreq/trunk/buildconf
URL: 
http://svn.apache.org/viewcvs/httpd/apreq/trunk/buildconf?rev=164528&r1=164527&r2=164528&view=diff
==============================================================================
--- httpd/apreq/trunk/buildconf (original)
+++ httpd/apreq/trunk/buildconf Sun Apr 24 19:42:41 2005
@@ -72,6 +72,7 @@
 $perl build/version_check.pl automake $automake  || exit 1
 $perl build/version_check.pl ExtUtils::XSBuilder || exit 1
 $perl build/version_check.pl Test::Inline || exit 1
+PREREQ_PM=`$perl build/version_check.pl perl_prereqs`
 
 echo "running $libtoolize" && $libtoolize && \
 echo "running $aclocal"  && $aclocal && \
@@ -79,5 +80,6 @@
 echo "running $autoheader" && $autoheader && \
 echo "running $automake -a -c" && $automake -a -c && \
 echo "running xsbuilder" && (cd glue/perl && $perl ../../build/xsbuilder.pl) 
&& \
+echo "running cpan prereq fixups" && $perl -i -wpe "s/PREREQ_PM/$PREREQ_PM/" 
Makefile.in && \
 echo "buildconf successful."
 


Reply via email to