summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Build.PL25
-rw-r--r--Makefile26
-rw-r--r--README9
-rwxr-xr-xbin/efa4
5 files changed, 35 insertions, 33 deletions
diff --git a/.gitignore b/.gitignore
index 378eac2..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..4c0c554
--- /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 => 'efa',
+ dist_version_from => 'bin/efa',
+ license => 'unrestricted',
+ requires => {
+ 'perl' => '5.10.0',
+ 'Getopt::Long' => 0,
+ 'XML::LibXML' => 0,
+ 'WWW::Mechanize' => 0,
+ },
+ script_files => 'bin/',
+);
+$build->create_build_script;
diff --git a/Makefile b/Makefile
deleted file mode 100644
index a6df06e..0000000
--- a/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-PREFIX ?= /usr/local
-
-basedir = ${DESTDIR}${PREFIX}
-
-build/efa.1: bin/efa
- mkdir -p build
- pod2man $< > $@
-
-install: build/efa.1
- mkdir -p ${basedir}/bin ${basedir}/share/man/man1
- cp bin/efa ${basedir}/bin/efa
- cp build/efa.1 ${basedir}/share/man/man1/efa.1
- chmod 755 ${basedir}/bin/efa
- chmod 644 ${basedir}/share/man/man1/efa.1
-
-uninstall:
- rm -f ${basedir}/bin/efa
- rm -f ${basedir}/share/man/man1/efa.1
-
-test:
- prove
-
-clean:
- rm -rf build
-
-.PHONY: install uninstall test clean
diff --git a/README b/README
index b41ab86..b3df4ba 100644
--- a/README
+++ b/README
@@ -6,11 +6,12 @@ Requires:
Installation
-> make
-> make test
-> sudo make install
+> perl Build.PL
+> ./Build
+> ./Build test
+> sudo ./Build install
-You can skip "make test" if you want.
+See also the Module::Build documentation.
Extra modules required for testing:
- Test::More
diff --git a/bin/efa b/bin/efa
index b96d7d4..c532f13 100755
--- a/bin/efa
+++ b/bin/efa
@@ -13,7 +13,7 @@ use WWW::Mechanize;
my $firsturl = 'http://efa.vrr.de/vrr/XSLT_TRIP_REQUEST2?language=de&itdLPxx_transpCompany=vrr';
my $posturl = 'http://efa.vrr.de/vrr/XSLT_TRIP_REQUEST2';
-my $version = '1.3+git';
+my $VERSION = '1.3+git';
my $content;
my $connections;
my %post;
@@ -294,7 +294,7 @@ GetOptions(
't|time=s' => \&opt_time,
'timeout=i' => \&opt_timeout,
'to=s{2}' => \@to,
- 'v|version' => sub {print "efa version $version\n"; exit 0},
+ 'v|version' => sub {print "efa version $VERSION\n"; exit 0},
'via=s{2}' => \@via,
'w|walk-speed=s' => \&opt_walk_speed,