File: Makefile.PL

package info (click to toggle)
clive 2.2.13-5+squeeze5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 600 kB
  • ctags: 199
  • sloc: perl: 2,355; makefile: 5
file content (46 lines) | stat: -rwxr-xr-x 1,046 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env perl

use warnings;
use strict;

use ExtUtils::MakeMaker;

my $version = get_version();

WriteMakefile(
    'NAME' => 'clive',
    ( $[ >= 5.8 )
    ? ( AUTHOR     => 'Toni Gundogdu <legatvs@gmail.com>',
        'ABSTRACT' => 'command line video extraction utility'
        )
    : (),
    'VERSION'   => $version,
    'EXE_FILES' => ['bin/clive'],
    'PREREQ_PM' => {
        'Getopt::ArgvFile' => 1.11,
        'Class::Singleton' => 1.4,
        'HTML::TokeParser' => 2.37,
        'URI::Escape'      => 3.29,
        'Digest::SHA'      => 5.45,
        'WWW::Curl'        => 4.05,
        'Config::Tiny'     => 2.12,
    },
    'LICENSE' => 'gpl',
    dist      => {
        COMPRESS => "bzip2",
        SUFFIX   => ".bz2"
    },
);

sub get_version {
    my $file = "lib/clive/Config.pm";
    my $re   = qr/VERSION => "(.*?)"/;
    open my $fh, "<", $file
        or die "$file: $!";
    foreach (<$fh>) {
        close $fh and return $1
            if $_ =~ /$re/;
    }
    close $fh;
    die "$file: `$re`: not matched";
}