]> git.vpit.fr Git - perl/modules/CPANPLUS-Dist-Gentoo.git/blobdiff - lib/CPANPLUS/Dist/Gentoo.pm
Document how to install or bootstrap the module on Gentoo
[perl/modules/CPANPLUS-Dist-Gentoo.git] / lib / CPANPLUS / Dist / Gentoo.pm
index 8a75c24e09e546feba90ed628a26fb6631aa2a90..297a15d1eb33ca1ae932b56aae109447848b9770 100644 (file)
@@ -52,7 +52,73 @@ They favour depending on a C<virtual>, on C<perl-core>, C<dev-perl> or C<perl-gc
 
 =head1 INSTALLATION
 
-After installing this module, you should append C<perl-gcpanp> to your F</etc/portage/categories> file.
+Before installing this module, you should append C<perl-gcpanp> to your F</etc/portage/categories> file.
+
+You have two ways for installing this module :
+
+=over 4
+
+=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>.
+
+=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> :
+
+    $ cd /tmp
+    $ wget http://search.cpan.org/CPAN/authors/id/K/KA/KANE/CPANPLUS-0.88.tar.gz
+    $ wget http://search.cpan.org/CPAN/authors/id/V/VP/VPIT/CPANPLUS-Dist-Gentoo-0.08.tar.gz
+
+Log in as root and unpack them in e.g. your home directory :
+
+    # cd
+    # tar xzf /tmp/CPANPLUS-0.88.tar.gz
+    # tar xzf /tmp/CPANPLUS-Dist-Gentoo-0.08.tar.gz
+
+Set up environment variables so that the toolchain is temporarily available :
+
+    # export OLDPATH=$PATH
+    # export PATH=/root/CPANPLUS-Dist-Gentoo-0.08/bin:$PATH
+    # export PERL5LIB=/root/CPANPLUS-Dist-Gentoo-0.08/blib/lib:/root/CPANPLUS-0.88/lib:/root/CPANPLUS-0.88/inc/bundle
+
+Make sure you don't have an old C<.cpanplus> configuration visible :
+
+    # [ -d /root/.cpanplus ] && mv /root/.cpanplus{,.bak}
+
+Bootstrap L<CPANPLUS> :
+
+    # cd /root/CPANPLUS-Dist-Gentoo-0.08
+    # samples/g-cpanp CPANPLUS
+
+Reset the environment :
+
+    # export PATH=$OLDPATH
+    # unset PERL5LIB OLDPATH
+
+Emerge L<CPANPLUS> with the ebuilds you've just generated :
+
+    # emerge -tv CPANPLUS
+
+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 :
+
+    # FEATURES="-protect-owned" emerge podlators
+    # FEATURES="-protect-owned" emerge ExtUtils-MakeMaker
+
+You may need to run each of these commands two times for them to succeed.
+
+At this point, you can bootstrap L<CPANPLUS::Dist::Gentoo> using the system L<CPANPLUS> :
+
+    # PERL5LIB=/root/CPANPLUS-Dist-Gentoo-0.08/blib/lib samples/g-cpanp CPANPLUS::Dist::Gentoo
+    # emerge -tv CPANPLUS-Dist-Gentoo
+
+=back
 
 =head1 METHODS
 
@@ -167,7 +233,12 @@ sub prepare {
   1 while chomp $header;
   $header .= "\n\n";
  } else {
-  $header = '';
+  my $year = (localtime)[5] + 1900;
+  $header = <<"  DEF_HEADER";
+# Copyright 1999-$year Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# \$Header: \$
+  DEF_HEADER
  }
  $stat->header($header);
 
@@ -463,7 +534,8 @@ sub ebuild_source {
  $d   .= "SLOT=\"0\"\n";
  $d   .= 'LICENSE="|| ( ' . join(' ', sort @{$stat->license}) . " )\"\n";
  $d   .= 'KEYWORDS="' . join(' ', sort @{$stat->keywords}) . "\"\n";
- $d   .= 'DEPEND="' . join("\n", @deps) . "\"\n";
+ $d   .= 'RDEPEND="' . join("\n", @deps) . "\"\n";
+ $d   .= "DEPEND=\"\${RDEPEND}\"\n";
  $d   .= "SRC_TEST=\"do\"\n";
  $d   .= $stat->footer;