File: Makefile.PL

package info (click to toggle)
zonemaster-cli 8.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 512 kB
  • sloc: perl: 3,288; makefile: 17
file content (76 lines) | stat: -rw-r--r-- 1,774 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
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
72
73
74
75
76
use 5.014002;
use strict;
use warnings FATAL => 'all';
use inc::Module::Install;

use ExtUtils::MakeMaker ();

name 'Zonemaster-CLI';
all_from 'lib/Zonemaster/CLI.pm';
resources(
    repository => 'https://github.com/zonemaster/zonemaster-cli',
    bugtracker => 'https://github.com/zonemaster/zonemaster-cli/issues',
);

tests_recursive( 't' );

# "2.1.0" could be declared as "2.001" but not as "2.1"
# (see Zonemaster::LDNS below)

requires(
    'Readonly'           => 0,
    'Net::IP::XS'        => 0,
    'JSON::XS'           => 0,
    'Locale::TextDomain' => 1.23,
    'Try::Tiny'          => 0,
    'Zonemaster::LDNS'   => 5.000001,  # v5.0.1
    'Zonemaster::Engine' => 8.001000,  # v8.1.0
);

test_requires(
    'JSON::Validator'   => 0,
    'Test::Differences' => 0,
);

# Make all platforms include inc/Module/Install/External.pm
requires_external_bin 'find';
if ($^O eq "freebsd") {
    requires_external_bin 'gmake';
};

sub MY::postamble {
    my $pure_all;
    my $sharemakefile = 'share/GNUmakefile';
    if ($^O eq "freebsd") {
        # Make FreeBSD use gmake for share
        $pure_all = "GMAKE ?= \"gmake\"\n"
            . "pure_all :: $sharemakefile\n"
            . "\tcd share && \$(GMAKE) all\n";
    } else {
        # Here Linux and GNU Make is assumed
        $pure_all = "pure_all :: $sharemakefile\n"
            . "\tcd share && \$(MAKE) all\n";
    };

    my $docker = <<'END_DOCKER';

docker-build:
	docker build --tag zonemaster/cli:local --build-arg version=$(VERSION) .

docker-tag-version:
	docker tag zonemaster/cli:local zonemaster/cli:$(VERSION)

docker-tag-latest:
	docker tag zonemaster/cli:local zonemaster/cli:latest

END_DOCKER

    return $pure_all . $docker;
};



install_script 'zonemaster-cli';
install_share;

WriteAll;