Hallo Monks,
What I've written tonight in the endeavor to make my project ready for GitHub makes me humbly feel that I reinvented the wheel once again. I know there is Dist::Zilla and what not, but my FlowTime project is bloody alpha and not yet at all ready to pack an installable distribution. I just want to simplify for others who clone my repository the process of making sure all requirements are met to run the program in the first place.
Could you tell me if there is a standard way to go? However, I would consider it weird to introduce new dependencies just to check dependencies. So, I want to get along without if this is possible.
Here, the section of my README file:
Check the dependencies
-----------------------
Please run the following script now:
script/gather_check_dependencies
Someday there will certainly be an automatic installation routine that
+ would resolve all dependencies as needed. In the meantime, you need
+to make sure yourself that all required CPAN modules are installed. Y
+ou may want to prefer prebuilt packages to install from your distribu
+tion repository (for Ubuntu or Debian e.g. lib-algorithm-dependency-p
+erl etc.). The indicated versions I tested work, earlier might do as
+well. Please note that I deleted lines of modules used internally in
+the following example run:
$ script/gather_check_dependencies
Algorithm::Dependency::Ordered => OK, 1.110
Algorithm::Dependency::Source::HoA => OK, 1.110
Benchmark => OK, 1.15
Bit::Vector => OK, 7.3
Carp => OK, 1.29
Date::Calc => OK, 6.3
FindBin => OK, 1.51
JSON => OK, 2.61
List::MoreUtils => OK, 0.33
List::Util => OK, 1.27
Mojo::Base => OK, loaded (just version unknown)
Mojolicious::Commands => OK, loaded (just version unknown)
Moose => OK, 2.1210
Moose::Role => OK, 2.1210
Moose::Util::TypeConstraints => OK, 2.1210
POSIX => OK, 1.32
Scalar::Util => OK, 1.27
Test::More => OK, 0.98
Time::Local => OK, 1.2300
The gather_check_dependencies script:
#!/bin/sh
egrep -rh '^[\s;]*(use|require) ' lib script t \
| sed -rne 's/ *(use|require) //; /^[A-Z]/p' \
| sort | uniq | perl -Ilib -ne "$(cat <<'PERL')"
BEGIN { %seen = () }
chomp;
$i++;
my ($mod,$name,$version) = /(([^\s;]+)(?: (\d[^\s;]+))?)/;
warn("Not parsed: $_\n") && next if !$mod;
next if $seen{$mod}++;
print $name, " => ", eval(qq{
package TestLoad$i;
use $mod ();
"OK, ".(\$${name}::VERSION // "loaded (just version unknown)")
}) // $@, "\n";
PERL
Any advice welcome, thank you!
--flowdy