Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 19 additions & 23 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ requires(
'JSON::XS' => 0,
'Locale::TextDomain' => 1.23,
'Try::Tiny' => 0,
'Zonemaster::LDNS' => 5.000000, # v5.0.0
'Zonemaster::Engine' => 8.000000, # v8.0.0
'Zonemaster::LDNS' => 5.000000, # v5.0.0
'Zonemaster::Engine' => 8.000000, # v8.0.0
);

test_requires(
Expand All @@ -34,43 +34,39 @@ test_requires(

# Make all platforms include inc/Module/Install/External.pm
requires_external_bin 'find';
if ($^O eq "freebsd") {
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';
return <<'MAKE_END';

pure_all :: share/GNUmakefile
$(MAKE) -C share all

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

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

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

END_DOCKER

return $pure_all . $docker;
};

.PHONY: mydist
mydist:
$(MAKE) -C share mo
$(MAKE) tardist

MAKE_END
} ## end sub MY::postamble

install_script 'zonemaster-cli';
install_share;

makemaker_args( macro => { DIST_DEFAULT => 'mydist' } );

WriteAll;
3 changes: 3 additions & 0 deletions share/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ tidy-po:
trap 'rm -rf "$$tmpdir"' EXIT ;\
for f in $(POFILES) ; do msgcat $$f -o $$tmpdir/$$f && mv -f $$tmpdir/$$f $$f ; done

.PHONY: mo
mo: $(MOFILES)

update-po: extract-pot
@for f in $(POFILES) ; do msgmerge --update --backup=none --quiet --no-location $(MSGMERGE_OPTS) $$f $(POTFILE) ; done

Expand Down