File perl-Spreadsheet-Read.spec of Package perl-Spreadsheet-Read

#
# spec file for package perl-Spreadsheet-Read
#
# Copyright (c) 2013 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/
#


%bcond_with opt

Name:           perl-Spreadsheet-Read
Version:        0.49
Release:        0
%define cpan_name Spreadsheet-Read
Summary:        Read the data from a spreadsheet
License:        GPL-1.0+ or Artistic-1.0
Group:          Development/Libraries/Perl
Url:            http://search.cpan.org/dist/Spreadsheet-Read/
Source:         http://www.cpan.org/authors/id/H/HM/HMBRAND/%{cpan_name}-%{version}.tgz
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Obsoletes:      xls2csv < 1.07
Provides:       xls2csv = 1.07
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(Test::Harness)
%if 0%{?suse_version} >= 1120
BuildRequires:  perl(Test::More) >= 0.88
%endif
BuildRequires:  perl(Test::NoWarnings)
#
BuildRequires:  perl(File::Temp)
%if %{with opt}
BuildRequires:  perl(Spreadsheet::ParseExcel) >= 0.26
BuildRequires:  perl(Spreadsheet::ParseExcel::FmtDefault)
BuildRequires:  perl(Spreadsheet::ReadSXC) >= 0.2
BuildRequires:  perl(Text::CSV) >= 1.15
BuildRequires:  perl(Text::CSV_PP) >= 1.23
BuildRequires:  perl(Text::CSV_XS) >= 0.69
%endif
%{perl_requires}
%if 0%{?suse_version} > 1010
Recommends:     perl(Spreadsheet::ParseExcel) >= 0.26
Recommends:     perl(Spreadsheet::ParseExcel::FmtDefault)
Recommends:     perl(Spreadsheet::ReadSXC) >= 0.2
Recommends:     perl(Text::CSV) >= 1.15
Recommends:     perl(Text::CSV_PP) >= 1.23
Recommends:     perl(Text::CSV_XS) >= 0.69
%endif

%description
Spreadsheet::Read tries to transparently read *any* spreadsheet and return
its content in a universal manner independent of the parsing module that
does the actual spreadsheet scanning.

For OpenOffice this module uses Spreadsheet::ReadSXC

For Microsoft Excel this module uses Spreadsheet::ParseExcel or
Spreadsheet::XLSX

For CSV this module uses Text::CSV_XS (0.29 or up required, 0.73 or up
preferred) or Text::CSV_PP (1.05 or up required).

For SquirrelCalc there is a very simplistic built-in parser

%prep
%setup -q -n %{cpan_name}-%{version}
find . -type f -print0 | xargs -0 chmod 644
%if 0%{?suse_version} < 1120 || 0%{?rhel_version} || 0%{?centos_version}
%if %{with opt}
#for tfile in $(%{__grep} -lr "done_testing" t/*); do
for tfile in 20_csv 21_csv 22_csv 23_csv 24_csv 31_clr 32_fmt 33_misc 34_dates 35_perc 40_sxc 45_ods 50_sc 51_sc; do
  %{__perl} -p -i\
   -e 's|(use).*(Test::More);|\1 \2 qw(no_plan);|,s|(done_testing.*)|#\1|' t/${tfile}.t
done
%else
for tfile in 50_sc 51_sc; do
  %{__perl} -p -i\
   -e 's|(use).*(Test::More);|\1 \2 qw(no_plan);|,s|(done_testing.*)|#\1|' t/${tfile}.t
done
%endif
%endif

%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 Changes examples README

%changelog
openSUSE Build Service is sponsored by