File perl-B-LintSubs.spec of Package perl-B-LintSubs
#
# spec file for package perl-B-LintSubs
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: perl-B-LintSubs
Version: 0.06
Release: 0
%define cpan_name B-LintSubs
Summary: Perl compiler backend to check sub linkage
License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/B-LintSubs/
Source0: http://www.cpan.org/authors/id/P/PE/PEVANS/%{cpan_name}-%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(IPC::Run)
BuildRequires: perl(Module::Build)
%{perl_requires}
%description
When using 'use strict', subroutine names are not checked at the callsite;
this makes the following a perfectly valid program at compiletime, that
only blows up at runtime
use strict;
foobar();
When using the 'B::LintSubs' checker instead, this is detected:
$ perl -MO=LintSubs -e 'use strict;
foobar();'
Undefined subroutine foobar called at -e line 2
Imported functions from other modules are of course detected:
$ perl -MO=LintSubs -e 'use strict;
use List::Util qw( max );
$_ = max( 1, 2, 3 )'
-e syntax OK
In order to handle situations where external code is conditionally
referenced at runtime, any fully-qualified references to other functions
are printed with a warning, but not considered fatal. The programmer is
assumed to Know What He Is Doing in this case:
$ perl -MO=LintSubs -e 'if( 1 ) { require Data::Dumper;
Data::Dumper::Dump( "Hello" ) }'
Unable to check call to Data::Dumper::Dump in foreign package at -e line 1
-e syntax OK
%prep
%setup -q -n %{cpan_name}-%{version}
%build
%{__perl} Build.PL installdirs=vendor
./Build build flags=%{?_smp_mflags}
%check
./Build test
%install
./Build install destdir=%{buildroot} create_packlist=0
%perl_gen_filelist
%files -f %{name}.files
%defattr(-,root,root,755)
%doc Changes LICENSE README
%changelog