2017-01-25 11:46:52 +00:00
|
|
|
#
|
|
|
|
# spec file for package perl-Code-DRY
|
|
|
|
#
|
2018-02-20 06:05:44 +00:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2017-01-25 11:46:52 +00:00
|
|
|
#
|
|
|
|
# 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-Code-DRY
|
|
|
|
Version: 0.03
|
|
|
|
Release: 0
|
|
|
|
%define cpan_name Code-DRY
|
|
|
|
Summary: Cut-and-Paste-Detector for Perl code
|
|
|
|
License: GPL-1.0+ or Artistic-1.0
|
|
|
|
Group: Development/Libraries/Perl
|
|
|
|
Url: http://search.cpan.org/dist/Code-DRY/
|
|
|
|
Source0: http://www.cpan.org/authors/id/H/HE/HEXCODER/%{cpan_name}-%{version}.tar.gz
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: perl-macros
|
|
|
|
%{perl_requires}
|
|
|
|
|
|
|
|
%description
|
2018-02-20 06:05:44 +00:00
|
|
|
The module reports repeated text fragments (typically Perl code) that
|
|
|
|
could be considered for isolation and/or abstraction in order to
|
|
|
|
reduce multiple copies of the same code (a.k.a. cut and paste code).
|
2017-01-25 11:46:52 +00:00
|
|
|
|
|
|
|
Code duplicates may occur in the same line, file or directory.
|
|
|
|
|
2018-02-20 06:05:44 +00:00
|
|
|
Rather than the exponential-time ad-hoc approach to compare every
|
|
|
|
item against every other item, this module can create the suffix
|
|
|
|
array and the longest common prefix array for a string of 8-bit
|
|
|
|
characters. These data structures can be used to search for
|
|
|
|
repetitions of substrings in O(n) time. The current strategy is to
|
|
|
|
concatenate code from all files into one string and then use the
|
|
|
|
suffix array and its companion, the longest-common-prefix (lcp) array
|
|
|
|
on this string.
|
2017-01-25 11:46:52 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n %{cpan_name}-%{version}
|
|
|
|
find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644
|
|
|
|
|
|
|
|
%build
|
|
|
|
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
|
|
|
|
%{__make} %{?_smp_mflags}
|
|
|
|
|
|
|
|
%check
|
|
|
|
%{__make} test
|
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
|
|
|
%perl_gen_filelist
|
|
|
|
|
|
|
|
%files -f %{name}.files
|
|
|
|
%defattr(-,root,root,755)
|
|
|
|
%doc Changes README
|
|
|
|
|
|
|
|
%changelog
|