File: Makefile.PL

package info (click to toggle)
feedgnuplot 1.58-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,644 kB
  • sloc: perl: 1,332; lisp: 70; makefile: 8
file content (71 lines) | stat: -rw-r--r-- 1,964 bytes parent folder | download | duplicates (3)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
use strict;
use warnings;
use ExtUtils::MakeMaker;

sub parseversion
{
# grab the version number from the changelog. I look for lines line
#
# libpackage-perl (0.02)
#
# I parse out the 0.02 part
  open DCH, '<', 'Changes' or die "Couldn't open 'Changes'";
  my ($version) = <DCH> =~ /^\S+ \s* \( ([0-9\.]+) \)/x
    or die "Couldn't parse version from 'Changes'";
  close DCH;

  # The version is also stored in the script itself. Here I extract that version
  # number and make sure the two match
  open PL, '<', 'bin/feedgnuplot' or die "Couldn't open 'bin/feedgnuplot'";

  while(<PL>)
  {
    if( /VERSION = '([0-9\.]+)'/ )
    {
      if ( $1 ne $version )
      {
        die "Version mismatch. Changes says version is '$version', but 'bin/feedgnuplot' says it is '$1'";
      }

      return $version;
    }
  }
  die "Couldn't parse version from 'bin/feedgnuplot'";
}

sub MY::libscan
{
    package MY;

    my ($self, $file) = @_;

    # Don't install any symlinks (i.e. README.pod)
    return undef if -l $file;

    return $self->SUPER::libscan ($file);
}

# I want my manpage to go into the man section '1', NOT '1p'. Here I add a
# snippet to the end of the generated Makefile to force this
sub MY::postamble
{
  return "MAN1EXT := 1\n";
}


WriteMakefile
  (
   NAME                       => 'feedgnuplot',
   AUTHOR                     => q{Dima Kogan <dima@secretsauce.net>},
   VERSION                    => parseversion(),
   ($ExtUtils::MakeMaker::VERSION >= 6.3002
    ? ('LICENSE'              => 'perl')
    : ()),
   PL_FILES                   => {},
   EXE_FILES                  => [ 'bin/feedgnuplot' ],
   BUILD_REQUIRES             => { 'String::ShellQuote' => 0,
                                   'List::MoreUtils'    => 0,
                                   'IPC::Run'           => 0},
   dist                       => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
   clean                      => { FILES => 'feedgnuplot-*' },
  );