]> git.vpit.fr Git - perl/modules/CPANPLUS-Dist-Gentoo.git/blobdiff - lib/CPANPLUS/Dist/Gentoo.pm
Complete the bootstrapping process description
[perl/modules/CPANPLUS-Dist-Gentoo.git] / lib / CPANPLUS / Dist / Gentoo.pm
index cc57cbdab4d5f8cdb049de1036e71412e50e84e7..c86573c0e17f3053f009551419643bfce310e19f 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 
 use Cwd        ();
-use List::Util qw/reduce/;
+use List::Util qw<reduce>;
 use File::Copy ();
 use File::Path ();
 use File::Spec;
@@ -14,7 +14,7 @@ use Parse::CPAN::Meta ();
 
 use CPANPLUS::Error ();
 
-use base qw/CPANPLUS::Dist::Base/;
+use base qw<CPANPLUS::Dist::Base>;
 
 use CPANPLUS::Dist::Gentoo::Atom;
 use CPANPLUS::Dist::Gentoo::Guard;
@@ -63,61 +63,42 @@ You have two ways for installing this module :
 =item *
 
 Use the perl overlay located at L<http://git.overlays.gentoo.org/gitweb/?p=proj/perl-overlay.git>.
-It contains an ebuild for L<CPANPLUS::Dist::Gentoo>.
+It contains an ebuild for L<CPANPLUS::Dist::Gentoo> which will most likely be up-to-date given the reactivity of Gentoo's Perl herd.
 
 =item *
 
 Bootstrap an ebuild for L<CPANPLUS::Dist::Gentoo> using itself.
-Note that if your Gentoo system C<perl> is C<5.8.x>, L<CPANPLUS> and its dependencies are not installed and not even available in the main portage tree.
-So you need to bootstrap them as well.
 
-First, fetch tarballs for L<CPANPLUS> and L<CPANPLUS::Dist::Gentoo> :
+First, make sure your system C<perl> is C<5.10> or greater, so that the L<CPANPLUS> toolchain is available.
 
-    $ cd /tmp
-    $ wget http://search.cpan.org/CPAN/authors/id/B/BI/BINGOS/CPANPLUS-0.9003.tar.gz
-    $ wget http://search.cpan.org/CPAN/authors/id/V/VP/VPIT/CPANPLUS-Dist-Gentoo-0.10.tar.gz
-
-Log in as root and unpack them in e.g. your home directory :
-
-    # cd
-    # tar xzf /tmp/CPANPLUS-0.9003.tar.gz
-    # tar xzf /tmp/CPANPLUS-Dist-Gentoo-0.10.tar.gz
-
-Set up environment variables so that the toolchain is temporarily available :
-
-    # export OLDPATH=$PATH
-    # export PATH=/root/CPANPLUS-0.9003/bin:$PATH
-    # export PERL5LIB=/root/CPANPLUS-Dist-Gentoo-0.10/blib/lib:/root/CPANPLUS-0.9003/lib:/root/CPANPLUS-0.9003/inc/bundle
+    $ perl -v
+    This is perl 5, version 12, subversion 2 (v5.12.2)...
 
-Make sure you don't have an old C<.cpanplus> configuration visible :
+C<perl> C<5.12> is the current stable Perl version in Gentoo.
+If you still have C<perl> C<5.8.x>, you can upgrade it by running the following commands as root :
 
-    # [ -d /root/.cpanplus ] && mv /root/.cpanplus{,.bak}
+    # emerge -tv ">=dev-lang/perl-5.10"
+    # perl-cleaner --all
 
-Bootstrap L<CPANPLUS> :
+Then, fetch the L<CPANPLUS::Dist::Gentoo> tarball :
 
-    # cd /root/CPANPLUS-Dist-Gentoo-0.10
-    # samples/g-cpanp CPANPLUS
-
-Reset the environment :
-
-    # export PATH=$OLDPATH
-    # unset PERL5LIB OLDPATH
-
-Emerge L<CPANPLUS> with the ebuilds you've just generated :
+    $ cd /tmp
+    $ wget http://search.cpan.org/CPAN/authors/id/V/VP/VPIT/CPANPLUS-Dist-Gentoo-0.10.tar.gz
 
-    # emerge -tv CPANPLUS
+Log in as root and unpack it in e.g. your home directory :
 
-As of september 2009, C<podlators> and C<ExtUtils-MakeMaker> may fail to emerge due to collisions.
-You can work around this by disabling the C<protect-owned> C<FEATURE> for them :
+    # cd
+    # tar xzf /tmp/CPANPLUS-Dist-Gentoo-0.10.tar.gz
+    # cd CPANPLUS-Dist-Gentoo-0.10
 
-    # FEATURES="-protect-owned" emerge podlators
-    # FEATURES="-protect-owned" emerge ExtUtils-MakeMaker
+Bootstrap L<CPANPLUS::Dist::Gentoo> using the bundled shell script C<g-cpanp> :
 
-You may need to run each of these commands two times for them to succeed.
+    # perl Makefile.PL
+    # make
+    # PERL5LIB=blib/lib samples/g-cpanp CPANPLUS::Dist::Gentoo
 
-At this point, you can bootstrap L<CPANPLUS::Dist::Gentoo> using the system L<CPANPLUS> :
+Finally, emerge the C<CPANPLUS-Dist-Gentoo> ebuild you've just generated :
 
-    # PERL5LIB=/root/CPANPLUS-Dist-Gentoo-0.10/blib/lib samples/g-cpanp CPANPLUS::Dist::Gentoo
     # emerge -tv CPANPLUS-Dist-Gentoo
 
 =back
@@ -151,7 +132,7 @@ my $format_available;
 sub format_available {
  return $format_available if defined $format_available;
 
- for my $prog (qw/emerge ebuild/) {
+ for my $prog (qw<emerge ebuild>) {
   unless (IPC::Cmd::can_run($prog)) {
    __PACKAGE__->_abort("$prog is required to write ebuilds");
    return $format_available = 0;
@@ -161,7 +142,7 @@ sub format_available {
  if (IPC::Cmd->can_capture_buffer) {
   my $buffers;
   my ($success, $errmsg) = IPC::Cmd::run(
-   command => [ qw/emerge --info/ ],
+   command => [ qw<emerge --info> ],
    verbose => 0,
    buffer  => \$buffers,
   );
@@ -180,6 +161,7 @@ sub format_available {
    }
   } else {
    __PACKAGE__->_abort($errmsg);
+   return $format_available = 0;
   }
  }
 
@@ -194,14 +176,15 @@ sub init {
  my $stat = $self->status;
  my $conf = $self->parent->parent->configure_object;
 
- $stat->mk_accessors(qw/name version author distribution desc uri src license
-                        meta min_perl
-                        fetched_arch
-                        requires configure_requires recursive_requires
-                        ebuild_name ebuild_version ebuild_dir ebuild_file
-                        portdir_overlay
-                        overlay distdir keywords do_manifest header footer
-                        force verbose/);
+ $stat->mk_accessors(qw<
+  name version author distribution desc uri src license
+  meta min_perl
+  fetched_arch
+  requires configure_requires recursive_requires
+  ebuild_name ebuild_version ebuild_dir ebuild_file
+  portdir_overlay overlay distdir keywords do_manifest header footer
+  force verbose
+ >);
 
  $stat->force($conf->get_conf('force'));
  $stat->verbose($conf->get_conf('verbose'));
@@ -398,7 +381,7 @@ sub meta {
 
  my $extract_dir = $mod->status->extract;
 
- for my $name (qw/META.json META.yml/) {
+ for my $name (qw<META.json META.yml>) {
   my $meta_file = File::Spec->catdir($extract_dir, $name);
   next unless -e $meta_file;
 
@@ -665,7 +648,7 @@ sub _cpan2portage {
 
  my @portdirs = ($main_portdir, @{$self->status->portdir_overlay});
 
- for my $category (qw/virtual perl-core dev-perl perl-gcpan/, CATEGORY) {
+ for my $category (qw<virtual perl-core dev-perl perl-gcpan>, CATEGORY) {
   my $name = ($category eq 'virtual' ? 'perl-' : '') . $name;
 
   for my $portdir (@portdirs) {