From c807bf78ae6e83700d8be6593739941c16840b29 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 22 May 2010 16:05:36 +0200 Subject: Add Makefile & standard perl tests --- .gitignore | 1 + Makefile | 35 +++++++++++++++++++++++++++++++++++ test/00-compile.t | 8 ++++++++ test/10-pod-coverage.t | 8 ++++++++ 4 files changed, 52 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100755 test/00-compile.t create mode 100755 test/10-pod-coverage.t diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..84c048a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1879fd1 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +PREFIX ?= /usr/local + +main_dir = ${DESTDIR}${PREFIX} +bin_dir = ${main_dir}/bin +man_dir = ${main_dir}/share/man + +all: build/comirror.1 build/comirror-setup.1 + +build/%.1: bin/% + @echo POD $< + @mkdir -p build + @pod2man $< > $@ + +install: all + @echo Installing executables to ${bin_dir} + @echo Installing manuals to ${man_dir} + @mkdir -p ${bin_dir} ${man_dir}/man1 + @cp bin/comirror ${bin_dir}/comirror + @cp bin/comirror-setup ${bin_dir}/comirror-setup + @cp build/comirror.1 ${man_dir}/man1/comirror.1 + @cp build/comirror-setup.1 ${man_dir}/man1/comirror-setup.1 + @chmod 755 ${bin_dir}/comirror ${bin_dir}/comirror-setup + @chmod 644 ${man_dir}/man1/comirror.1 ${man_dir}/man1/comirror-setup.1 + +test: + @prove test + +uninstall: + rm -f ${bin_dir}/comirror ${bin_dir}/comirror-setup + rm -f ${man_dir}/man1/comirror.1 ${man_dir}/man1/comirror-setup.1 + +clean: + rm -rf build + +.PHONY: all clean install test uninstall diff --git a/test/00-compile.t b/test/00-compile.t new file mode 100755 index 0000000..d7b89cb --- /dev/null +++ b/test/00-compile.t @@ -0,0 +1,8 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use 5.010; +use Test::More; +use Test::Compile; + +all_pl_files_ok(qw{ bin/comirror bin/comirror-setup }); diff --git a/test/10-pod-coverage.t b/test/10-pod-coverage.t new file mode 100755 index 0000000..df81177 --- /dev/null +++ b/test/10-pod-coverage.t @@ -0,0 +1,8 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use 5.010; +use Test::More; +use Test::Pod; + +all_pod_files_ok(qw{ bin/comirror bin/comirror-setup }); -- cgit v1.2.3