| 1 | package Enbld::Definition::Tmux; | ||
| 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}{DarwinArgument} = \&set_argument; | ||
| 14 | $self->{defined}{ArchiveName} = 'tmux'; | ||
| 15 | $self->{defined}{WebSite} = 'http://tmux.sourceforge.net'; | ||
| 16 | $self->{defined}{VersionForm} = '\d\.\d'; | ||
| 17 | $self->{defined}{Dependencies} = [ 'pkgconfig', 'libevent' ]; | ||
| 18 | $self->{defined}{DownloadSite} = | ||
| 19 | 'http://sourceforge.net/projects/tmux/files/tmux/'; | ||
| 20 | |||
| 21 | $self->{defined}{IndexParserForm} = \&set_index_parser_form; | ||
| 22 | $self->{defined}{URL} = \&set_URL; | ||
| 23 | |||
| 24 | $self->{defined}{TestAction} = 'test'; | ||
| 25 | |||
| 26 | $self->{defined}{CommandConfigure} = 'sh configure'; | ||
| 27 | |||
| 28 | return $self; | ||
| 29 | } | ||
| 30 | |||
| 31 | sub set_argument { | ||
| 32 | |||
| 33 | require Enbld::Home; | ||
| 34 | my $path = File::Spec->catdir( | ||
| 35 | Enbld::Home->install_path, | ||
| 36 | 'lib', | ||
| 37 | 'pkgconfig' | ||
| 38 | ); | ||
| 39 | |||
| 40 | my $env = 'PKG_CONFIG_PATH=' . $path; | ||
| 41 | |||
| 42 | return $env; | ||
| 43 | } | ||
| 44 | |||
| 45 | sub set_index_parser_form { | ||
| 46 | my $attributes = shift; | ||
| 47 | |||
| 48 | my $index_form = quotemeta( $attributes->ArchiveName ) . '-' . | ||
| 49 | $attributes->VersionForm; | ||
| 50 | |||
| 51 | my $index_parser_form = '<a href="/projects/tmux/files/tmux/' . | ||
| 52 | $index_form . '/stats/timeline"'; | ||
| 53 | |||
| 54 | return $index_parser_form; | ||
| 55 | } | ||
| 56 | |||
| 57 | sub set_URL { | ||
| 58 | my $attributes = shift; | ||
| 59 | |||
| 60 | my $dir = $attributes->ArchiveName . '-' . $attributes->Version; | ||
| 61 | my $file = $attributes->ArchiveName . '-' . $attributes->Version . | ||
| 62 | '.' . $attributes->Extension; | ||
| 63 | |||
| 64 | my $url = $attributes->DownloadSite . $dir . '/' . $file . '/download'; | ||
| 65 | |||
| 66 | return $url; | ||
| 67 | } | ||
| 68 | |||
| 69 | 1; | ||
| 70 | |||
| 71 | =pod | ||
| 72 | |||
| 73 | =head1 NAME | ||
| 74 | |||
| 75 | Enbld::Definition::Tmux - definition module for Tmux | ||
| 76 | |||
| 77 | =head1 SEE ALSO | ||
| 78 | |||
| 79 | L<tmux|http://tmux.sourceforge.net> | ||
| 80 | |||
| 81 | L<Enbld::Definition> | ||
| 82 | |||
| 83 | =head1 COPYRIGHT | ||
| 84 | |||
| 85 | copyright 2013- Magnolia C<< <magnolia.k@me.com> >>. | ||
| 86 | |||
| 87 | =head1 LICENSE | ||
| 88 | |||
| 89 | This is free software; you can redistribute it and/or modify it under | ||
| 90 | the same terms as the Perl 5 programming language system itself. | ||
| 91 | |||
| 92 | =cut |