=head1 VERSION
-Version 0.02_01
+Version 0.04
=cut
-our $VERSION = '0.02_01';
+our $VERSION = '0.04';
=head1 SYNOPSIS
--dist-opts distdir=/usr/portage/distfiles \
--dist-opts manifest=yes \
--dist-opts keywords=x86 \
+ --dist-opts header="# Copyright 1999-2008 Gentoo Foundation" \
+ --dist-opts footer="# End" \
Any::Module You::Like
=head1 DESCRPITON
my $stat = $self->status;
my $conf = $self->parent->parent->configure_object;
- $stat->mk_accessors(qw/name version dist desc uri src license deps
+ $stat->mk_accessors(qw/name version author dist desc uri src license deps
eb_name eb_version eb_dir eb_file fetched_arch
- overlay distdir keywords do_manifest
+ overlay distdir keywords do_manifest header footer
force verbose/);
$stat->force($conf->get_conf('force'));
$manifest = 0 if $manifest =~ /^\s*no?\s*$/i;
$stat->do_manifest($manifest);
+ my $header = delete $opts{'header'};
+ if (defined $header) {
+ 1 while chomp $header;
+ $header .= "\n\n";
+ } else {
+ $header = '';
+ }
+ $stat->header($header);
+
+ my $footer = delete $opts{'footer'};
+ if (defined $footer) {
+ $footer = "\n" . $footer;
+ } else {
+ $footer = '';
+ }
+ $stat->footer($footer);
+
$stat->overlay(delete($opts{'overlay'}) || '/usr/local/portage');
$stat->distdir(delete($opts{'distdir'}) || '/usr/portage/distfiles');
my $version = $mod->package_version;
$stat->version($version);
+ my $author = $mod->author->cpanid;
+ $stat->author($author);
+
$stat->dist($name . '-' . $version);
$version =~ s/[^\d._]+//g;
$stat->uri('http://search.cpan.org/dist/' . $name);
- unless ($name =~ /^([^-]+)/) {
- error 'Wrong distribution name -- aborting';
+ unless ($author =~ /^(.)(.)/) {
+ error 'Wrong author name -- aborting';
return 0;
}
- $stat->src('mirror://cpan/modules/by-module/' . $1 . '/' . $mod->package);
+ $stat->src("mirror://cpan/modules/by-authors/id/$1/$1$2/$author/"
+ . $mod->package);
$stat->license([ qw/Artistic GPL-2/ ]);
}
}
- my $d = "# Generated by CPANPLUS::Dist::Gentoo\n\ninherit perl-module\n\n";
+ my $d = $stat->header;
+ $d .= "# Generated by CPANPLUS::Dist::Gentoo version $VERSION\n\n";
+ $d .= 'MODULE_AUTHOR="' . $stat->author . "\"\ninherit perl-module\n\n";
$d .= 'S="${WORKDIR}/' . $stat->dist . "\"\n";
$d .= 'DESCRIPTION="' . $stat->desc . "\"\n";
$d .= 'HOMEPAGE="' . $stat->uri . "\"\n";
. ' )';
} @{$stat->deps};
$d .= "\"\n";
+ $d .= "SRC_TEST=\"do\"\n";
+ $d .= $stat->footer;
my $file = $stat->eb_file;
open my $eb, '>', $file or do {
The module is to some extend cargo-culted from L<CPANPLUS::Dist::Deb> and L<CPANPLUS::Dist::Mdv>.
+Kent Fredric, for testing and suggesting improvements.
+
=head1 COPYRIGHT & LICENSE
Copyright 2008 Vincent Pit, all rights reserved.