From 38694a59b16a65b1fd6f185529e419bec6b794ae Mon Sep 17 00:00:00 2001 From: Dennis Kaarsemaker Date: Fri, 19 Aug 2011 08:21:22 +0200 Subject: [PATCH] Detect scripts better cpanspec tries to detect when scripts will be installed, so it can add man1 and bindir entries to %files. This patch adds some more heuristics to detect more cases of scri[ts being installed. --- cpanspec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cpanspec b/cpanspec index 4ed8188..57058b9 100755 --- a/cpanspec +++ b/cpanspec @@ -818,8 +818,18 @@ for my $file (@args) { my $license=""; # TODO It's possible these need to be listed instead of just detected. - my $scripts=(grep /^(?:bin|scripts)\//, @files); my $uses_autoinstall = grep /Module\/AutoInstall.pm/, @files; + my $scripts=(grep /^(?:bin|scripts?|tools)\//, @files); + my $makecontent; + if (grep /^Makefile\.PL$/, @files + and $makecontent=extract($archive, $type, "$path/Makefile.PL")) { + $scripts ||= $makecontent =~ 'install_script'; + $scripts ||= ($makecontent =~ /EXE_FILES/ && $makecontent !~ /EXE_FILES.*\[\s*(qw\(\s*\)\s*)?\]/) ? 1 : 0; + } + if (grep /^Build\.PL$/, @files + and $makecontent=extract($archive, $type, "$path/Build.PL")) { + $scripts ||= $makecontent =~ 'script_files'; + } my (%build_requires,%requires); my ($yml,$meta); if (grep /^META\.yml$/, @files