| 1 | package Enbld::Definition::Libevent; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use parent qw/Enbld::Definition/; | ||
| 7 | |||
| 8 | sub initialize { | ||
| 9 | my $self = shift; | ||
| 10 | |||
| 11 | $self->SUPER::initialize; | ||
| 12 | |||
| 13 | $self->{defined}{ArchiveName} = 'libevent'; | ||
| 14 | $self->{defined}{WebSite} = 'http://libevent.org'; | ||
| 15 | $self->{defined}{VersionForm} = '\d\.\d\.\d{1,2}'; | ||
| 16 | $self->{defined}{IndexSite} = | ||
| 17 | 'http://libevent.org/old-releases.html'; | ||
| 18 | $self->{defined}{DownloadSite} = | ||
| 19 | 'https://github.com/downloads/libevent/libevent/'; | ||
| 20 | $self->{defined}{IndexParserForm} = \&set_index_parser_form; | ||
| 21 | $self->{defined}{Filename} = \&set_filename; | ||
| 22 | |||
| 23 | $self->{defined}{TestAction} = 'verify'; | ||
| 24 | |||
| 25 | return $self; | ||
| 26 | } | ||
| 27 | |||
| 28 | sub set_filename { | ||
| 29 | my $attributes = shift; | ||
| 30 | |||
| 31 | my $filename = $attributes->ArchiveName . '-' . $attributes->Version . | ||
| 32 | '-stable.' . $attributes->Extension; | ||
| 33 | |||
| 34 | return $filename; | ||
| 35 | } | ||
| 36 | |||
| 37 | sub set_index_parser_form { | ||
| 38 | my $attributes = shift; | ||
| 39 | |||
| 40 | my $parser = 'href="' .quotemeta( $attributes->DownloadSite ). | ||
| 41 | quotemeta( $attributes->ArchiveName ). '-' . $attributes->VersionForm . | ||
| 42 | '-stable.' . quotemeta( $attributes->Extension ) . '">'; | ||
| 43 | |||
| 44 | return $parser; | ||
| 45 | } | ||
| 46 | |||
| 47 | 1; | ||
| 48 | |||
| 49 | =pod | ||
| 50 | |||
| 51 | =head1 NAME | ||
| 52 | |||
| 53 | Enbld::Definition::Libevent - definition module for libevent | ||
| 54 | |||
| 55 | =head1 SEE ALSO | ||
| 56 | |||
| 57 | L<libevent|http://libevent.org> | ||
| 58 | |||
| 59 | L<Enbld::Definition> | ||
| 60 | |||
| 61 | =head1 COPYRIGHT | ||
| 62 | |||
| 63 | copyright 2013- Magnolia C<< <magnolia.k@me.com> >>. | ||
| 64 | |||
| 65 | =head1 LICENSE | ||
| 66 | |||
| 67 | This is free software; you can redistribute it and/or modify it under | ||
| 68 | the same terms as the Perl 5 programming language system itself. | ||
| 69 | |||
| 70 | =cut |