From a01588a03471a652043145eefeec5ef4bf77d05c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 5 Aug 2010 20:48:14 +0200 Subject: Makefile -> Build.PL --- .gitignore | 4 +++- Build.PL | 25 +++++++++++++++++++++++++ Makefile | 27 --------------------------- bin/icli | 4 ++-- 4 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 Build.PL delete mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 84c048a..201c581 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -/build/ +/_build +/Build +/blib diff --git a/Build.PL b/Build.PL new file mode 100644 index 0000000..0b2c587 --- /dev/null +++ b/Build.PL @@ -0,0 +1,25 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Module::Build; + +my $build = Module::Build->new( + build_requires => { + 'Test::More' => 0, + 'Test::Compile' => 0, + 'Test::Pod' => 0, + 'Test::Command' => 0, + }, + dist_name => 'icli', + dist_version_from => 'bin/icli', + license => 'unrestricted', + requires => { + 'perl' => '5.10.0', + 'Date::Format' => 0, + 'Getopt::Long' => 0, + 'Term::ANSIColor' => 0, + }, + script_files => 'bin/', +); +$build->create_build_script(); diff --git a/Makefile b/Makefile deleted file mode 100644 index 550126d..0000000 --- a/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -PREFIX ?= /usr/local - -main_dir = ${DESTDIR}${PREFIX} - -build/icli.1: bin/icli - mkdir -p build - pod2man $< > $@ - -install: build/icli.1 - mkdir -p ${main_dir}/bin ${main_dir}/share/man/man1 - cp bin/icli ${main_dir}/bin/icli - cp build/icli.1 ${main_dir}/share/man/man1/icli.1 - chmod 755 ${main_dir}/bin/icli - chmod 644 ${main_dir}/share/man/man1/icli.1 - - -test: - @prove - -uninstall: - rm -f ${main_dir}/bin/icli - rm -f ${main_dir}/share/man/man1/icli.1 - -clean: - rm -rf build - -.PHONY: clean install test uninstall diff --git a/bin/icli b/bin/icli index b1d7a92..1716fed 100755 --- a/bin/icli +++ b/bin/icli @@ -8,7 +8,7 @@ use Date::Format; use Getopt::Long qw/:config bundling/; use Term::ANSIColor; -my $version = '0.1+git'; +my $VERSION = '0.1+git'; my ($cache, $config, $data, $extra); my $config_file = '/var/cache/icinga/objects.cache'; @@ -235,7 +235,7 @@ GetOptions( 'h|host=s' => sub { push(@for_hosts, split(/,/, $_[1])) }, 'l|list=s' => sub { $list_type = substr($_[1], 0, 1) }, 's|short' => \$short, - 'V|version' => sub { say "icli version $version"; exit 0 }, + 'V|version' => sub { say "icli version $VERSION"; exit 0 }, ); read_objects($status_file, \$data); -- cgit v1.2.3