Files
perl-File-DirCompare/perl-File-DirCompare.spec

94 lines
3.0 KiB
RPMSpec
Raw Normal View History

#
# spec file for package perl-File-DirCompare (Version 0.6)
#
# Copyright (c) 2010 SUSE LINUX Products 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-File-DirCompare
Version: 0.6
Release: 1
License: GPL+ or Artistic
%define cpan_name File-DirCompare
Summary: Perl module to compare two directories using
Url: http://search.cpan.org/dist/File-DirCompare/
Group: Development/Libraries/Perl
Source: http://www.cpan.org/authors/id/G/GA/GAVINC/%{cpan_name}-%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Carp)
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(File::Basename)
BuildRequires: perl(File::Compare)
BuildRequires: perl(File::Glob)
BuildRequires: perl(File::Spec)
%{perl_requires}
%description
File::DirCompare is a perl module to compare two directories using a
callback, invoked for all files that are 'different' between the two
directories, and for any files that exist only in one or other directory
('unique' files).
File::DirCompare has a single public compare() method, with the following
signature:
File::DirCompare->compare($dir1, $dir2, $sub, $opts);
The first three arguments are required - $dir1 and $dir2 are paths to the
two directories to be compared, and $sub is the subroutine reference called
for all unique or different files. $opts is an optional hashref of options
- see the OPTIONS manpage below.
The provided subroutine is called for all unique files, and for every pair
of 'different' files encountered, with the following signature:
$sub->($file1, $file2)
where $file1 and $file2 are the paths to the two files. For 'unique' files
i.e. where a file exists in only one directory, the subroutine is called
with the other argument 'undef' i.e. for:
$sub->($file1, undef)
$sub->(undef, $file2)
the first indicates $file1 exists only in the first directory given
($dir1), and the second indicates $file2 exists only in the second
directory given ($dir2).
%prep
%setup -q -n %{cpan_name}-%{version}
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} %{?_smp_mflags}
%check
%{__make} test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%clean
%{__rm} -rf %{buildroot}
%files -f %{name}.files
%defattr(-,root,root,755)
%doc README TODO
%changelog