X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo.pm;h=a6b773407e4320fa3c55c3e342bc6709e636f526;hb=0d54c05d27e53e16bc97eb47d63f11fc85e34f74;hp=8a75c24e09e546feba90ed628a26fb6631aa2a90;hpb=7308d012abc740db21ec93729bbcc8a3d9e2bff1;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 8a75c24..a6b7734 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -52,7 +52,73 @@ They favour depending on a C, on C, C or C to your F file. +Before installing this module, you should append C to your F file. + +You have two ways for installing this module : + +=over 4 + +=item * + +Use the perl overlay located at L. +It contains an ebuild for L. + +=item * + +Bootstrap an ebuild for L using itself. +Note that if your Gentoo system C is C<5.8.x>, L 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 and L : + + $ 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 : + + # cd /root/CPANPLUS-Dist-Gentoo-0.08 + # samples/g-cpanp CPANPLUS + +Reset the environment : + + # export PATH=$OLDPATH + # unset PERL5LIB OLDPATH + +Emerge L with the ebuilds you've just generated : + + # emerge -tv CPANPLUS + +As of september 2009, C and C may fail to emerge due to collisions. +You can work around this by disabling the C C 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 using the system L : + + # PERL5LIB=/root/CPANPLUS-Dist-Gentoo-0.08/blib/lib samples/g-cpanp CPANPLUS::Dist::Gentoo + # emerge -tv CPANPLUS-Dist-Gentoo + +=back =head1 METHODS @@ -124,7 +190,7 @@ sub init { my $conf = $self->parent->parent->configure_object; $stat->mk_accessors(qw/name version author distribution desc uri src license - fetched_arch deps + fetched_arch requires ebuild_name ebuild_version ebuild_dir ebuild_file portdir_overlay overlay distdir keywords do_manifest header footer @@ -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); @@ -267,8 +338,8 @@ sub prepare { $stat->license($self->intuit_license); - my $prereqs = $mod->status->prereqs; - my @depends; + my $prereqs = $mod->status->requires; + my @requires; for my $prereq (sort keys %$prereqs) { next if $prereq =~ /^perl(?:-|\z)/; my $obj = $int->module_tree($prereq); @@ -283,10 +354,10 @@ sub prepare { $version = $obj->package_version; } } - push @depends, [ $obj->package_name, $version ]; + push @requires, [ $obj->package_name, $version ]; } } - $stat->deps(\@depends); + $stat->requires(\@requires); return $OK->(); } @@ -439,8 +510,8 @@ sub ebuild_source { # We must resolve the deps now and not inside prepare because _cpan2portage # has to see the ebuilds already generated for the dependencies of the current # dist. - my @deps; - for (@{$stat->deps}) { + my @requires; + for (@{$stat->requires}) { my $dep = $self->_cpan2portage(@$_); unless (defined $dep) { $self->_abort( @@ -448,10 +519,10 @@ sub ebuild_source { ); return; } - push @deps, $dep; + push @requires, $dep; } - @deps = do { my %seen; sort grep !$seen{$_}++, 'dev-lang/perl', @deps }; + @requires = do { my %seen; sort grep !$seen{$_}++, 'dev-lang/perl',@requires }; my $d = $stat->header; $d .= "# Generated by CPANPLUS::Dist::Gentoo version $VERSION\n\n"; @@ -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", @requires) . "\"\n"; + $d .= "DEPEND=\"\${RDEPEND}\"\n"; $d .= "SRC_TEST=\"do\"\n"; $d .= $stat->footer;