diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-03-04 07:20:21 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-03-04 07:20:21 +0000 |
commit | 78fb326be62816fa0a0eeda0d62532cf0eb6e734 (patch) | |
tree | 46486f9c4731c9c4c775815617812d8c52bcad53 /Makefile.PL | |
parent | 9ce221b58ff8e5df3707cdf7d2272600da25a303 (diff) | |
download | mangemanche-78fb326be62816fa0a0eeda0d62532cf0eb6e734.tar.gz mangemanche-78fb326be62816fa0a0eeda0d62532cf0eb6e734.tar.bz2 |
Add Perl build infrastructure
Diffstat (limited to 'Makefile.PL')
-rw-r--r-- | Makefile.PL | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..2d0cd6e --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,69 @@ +# -*- perl -*- +use strict; +use warnings; +use ExtUtils::MakeMaker; +use Module::Metadata; +use File::Basename; + +WriteMakefile( + NAME => 'mangemanche', + ABSTRACT_FROM => 'lib/App/Mangemanche.pm', + VERSION_FROM => 'lib/App/Mangemanche.pm', + AUTHOR => 'Sergey Poznyakoff <gray@gnu.org>', + LICENSE => 'gpl_3', + EXE_FILES => [ 'mangemanche' ], + MIN_PERL_VERSION => 5.014002, + PREREQ_PM => { + 'Getopt::Long' => 2.34, + 'DBI' => 0, + 'File::Basename' => 0, + 'File::Spec' => 0, + 'File::Temp' => 0.23, + 'Getopt::Long' => 0, + 'HTTP::Status' => 6.11, + 'JSON' => 2.90, + 'Nagios::Config' => 36, + 'Pod::Find' => 0, + 'Pod::Man' => 0, + 'Pod::Usage' => 0 + }, + META_MERGE => { + 'meta-spec' => { version => 2 }, + resources => { + repository => { + type => 'git', + url => 'git://git.gnu.org.ua/ping903/mangemanche.git', + web => 'http://git.gnu.org.ua/cgit/ping903/mangemanche.git/', + }, + }, + provides => Module::Metadata->provides(version => '1.4', + dir => 'lib') + } +); + +sub MY::postamble { + my $s = <<'_MAKE_' +all:: subcommand-manpages +.PHONY: subcommand-manpages +subcommand-manpages: manifypods + $(NOECHO) $(ECHO) Generating manpages for the subcommands + $(NOECHO) $(FULLPERLRUN) -pe 's/App::Mangemanche\s+3/mangemanche 1/g;s/App::Mangemanche/mangemanche/g' $(INST_MAN3DIR)/App::Mangemanche.$(MAN3EXT) > $(INST_MAN1DIR)/mangemanche.$(MAN1EXT) + $(NOECHO) $(RM_F) $(INST_MAN3DIR)/App::Mangemanche.$(MAN3EXT) +_MAKE_ +; + push @INC, 'lib'; + foreach my $file (glob("lib/App/Mangemanche/Command/*.pm")) { + my ($command) = fileparse($file, '.pm'); + my $mod = $file; + $mod =~ s{^.*lib/}{}; + $mod =~ s{\.pm$}{}; + $mod =~ s{/}{::}g; + + my $man1file = $command . '.$(MAN1EXT)'; + $s .= "\t\$(NOECHO)\$(FULLPERLRUN) -pe 's/$mod\\s+3/$command 1/' \$(INST_MAN3DIR)/$mod.\$(MAN3EXT) > \$(INST_MAN1DIR)/$man1file\n"; + $s .= "\t\$(NOECHO)\$(RM_F) \$(INST_MAN3DIR)/$mod.\$(MAN3EXT)\n"; + } + pop @INC; + $s .= "\n"; + return $s; +} |