| 1 |
use strict; |
| 2 |
use warnings; |
| 3 |
use Module::Build; |
| 4 |
|
| 5 |
my $class = Module::Build->subclass( |
| 6 |
class => 'My::Builder', |
| 7 |
code => q{ |
| 8 |
sub ACTION_tarball_name { print shift->dist_dir . ".tar.gz\n" } |
| 9 |
sub ACTION_latest_changes { |
| 10 |
my $self = shift; |
| 11 |
(my $dv = $self->dist_version) =~ s/^v//; |
| 12 |
open my $in, '<:raw', 'Changes' or die "Cannot open Changes: $!\n"; |
| 13 |
open my $out, '>:raw', 'latest_changes.md' or die "Cannot open latest_changes.md: $!\n"; |
| 14 |
while (<$in>) { last if /^\Q$dv\E\b/ } |
| 15 |
print {$out} "Changes for v$dv\n"; |
| 16 |
while (<$in>) { |
| 17 |
last if /^\s*$/; |
| 18 |
chomp; |
| 19 |
if (s/^\s+-/- /) { |
| 20 |
print {$out} "\n"; |
| 21 |
} else { |
| 22 |
s/^\s+/ /; |
| 23 |
} |
| 24 |
print {$out} $_; |
| 25 |
} |
| 26 |
$self->add_to_cleanup('latest_changes.md'); |
| 27 |
} |
| 28 |
}, |
| 29 |
); |
| 30 |
|
| 31 |
my $build = $class->new( |
| 32 |
module_name => 'Text::Markup', |
| 33 |
license => 'perl', |
| 34 |
create_makefile_pl => 'traditional', |
| 35 |
configure_requires => { 'Module::Build' => '0.4209' }, |
| 36 |
recommends => { 'CommonMark' => '0.290000' }, |
| 37 |
test_requires => { |
| 38 |
'File::Spec::Functions' => 0, |
| 39 |
'Module::Build' => '0.4209', |
| 40 |
'Test::More' => '0.96', |
| 41 |
}, |
| 42 |
requires => { |
| 43 |
'File::BOM' => '0.14', |
| 44 |
'HTML::Entities' => 0, |
| 45 |
'HTML::Tagset' => 0, # Needed by Text::MediawikiFormat |
| 46 |
'IPC::Open3' => 0, |
| 47 |
'perl' => 5.008001, |
| 48 |
'Pod::Simple::XHTML' => '3.16', |
| 49 |
'Symbol' => 0, |
| 50 |
'Text::Markdown::Discount' => '0.13', |
| 51 |
'Text::MultiMarkdown' => '1.000028', |
| 52 |
'Text::MediawikiFormat' => '1.0', |
| 53 |
'Text::Textile' => '2.10', |
| 54 |
'Text::Trac' => '0.10', |
| 55 |
'Parse::BBCode' => '0.15', |
| 56 |
'Text::WikiCreole' => '0.07', |
| 57 |
}, |
| 58 |
meta_merge => { |
| 59 |
"meta-spec" => { version => 2 }, |
| 60 |
resources => { |
| 61 |
homepage => 'https://metacpan.org/pod/Text::Markup', |
| 62 |
bugtracker => 'https://github.com/theory/text-markup/issues/', |
| 63 |
repository => 'https://github.com/theory/text-markup', |
| 64 |
}, |
| 65 |
prereqs => { |
| 66 |
develop => { |
| 67 |
requires => { |
| 68 |
'Test::Pod' => '1.41', |
| 69 |
'Test::Pod::Coverage' => '1.06', |
| 70 |
'Test::Spelling' => '0.25', |
| 71 |
}, |
| 72 |
}, |
| 73 |
}, |
| 74 |
}, |
| 75 |
); |
| 76 |
$build->add_build_element('py'); |
| 77 |
$build->create_build_script; |