File perl-SQL-Statement.spec of Package perl-SQL-Statement

#
# spec file for package perl-SQL-Statement (Version 1.31)
#
# 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/
#

# norootforbuild

%bcond_with opt

Name:           perl-SQL-Statement
%define cpan_name SQL-Statement
Summary:        SQL parsing and processing engine
Version:        1.31
Release:        2
License:        GPL+ or Artistic
Group:          Development/Libraries/Perl
Url:            http://search.cpan.org/dist/SQL-Statement/
#Source:         http://www.cpan.org/modules/by-module/SQL/SQL-Statement-%{version}.tar.gz
Source:         %{cpan_name}-%{version}.tar.bz2
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%{perl_requires}
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(Carp)
BuildRequires:  perl(Clone) >= 0.30
BuildRequires:  perl(Data::Dumper)
# means perl-DBI >= 1.612
BuildRequires:  perl(DBD::File) >= 0.39
BuildRequires:  perl(DBI::DBD::SqlEngine) >= 0.01
BuildRequires:  perl(Params::Util) >= 1.00
BuildRequires:  perl(Scalar::Util) >= 1.0
BuildRequires:  perl(Test::Simple) >= 0.90
# optional for build
%if %{with opt}
BuildRequires:  perl(Test::Pod) >= 1.00
BuildRequires:  perl(Test::Pod::Coverage) >= 1.00
BuildRequires:  perl(DBD::CSV)
%endif
#
Requires:       perl(Carp)
Requires:       perl(Clone) >= 0.30
Requires:       perl(Data::Dumper)
Requires:       perl(Params::Util) >= 1.00
Requires:       perl(Scalar::Util) >= 1.0
#
Recommends:     perl(DBD::CSV)
# means perl-DBI >= 1.612
Recommends:     perl(DBD::File) >= 0.39
Recommends:     perl(DBI::DBD::SqlEngine) >= 0.01

%description
The SQL::Statement module implements a pure Perl SQL parsing and execution
engine. While it by no means implements full ANSI standard, it does support
many features including column and table aliases, built-in and user-defined
functions, implicit and explicit joins, complex nested search conditions,
and other features.

Authors:
--------
    Jochen Wiedmann (original module as an XS (C) extension in 1998)
    Jeff Zucker (since 2001)
    Jens Rehsack (since 2008) <rehsackATcpan.org>

%prep
%setup -q -n %{cpan_name}-%{version}
# rpmlint wrong-file-end-of-line-encoding
%{__perl} -p -i -e "s|\r\n|\n|" README
# rpmlint: spurious-executable-perm
%{__chmod} a-x Changes README
# rpmlint: script-without-shebang
find -name "*.pm" -exec %{__chmod} 0644 {} \;

%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} %{?_smp_mflags}

%check
%{__make} test

%install
%perl_make_install
# do not perl_process_packlist (noarch)
# remove .packlist file
%{__rm} -rf $RPM_BUILD_ROOT%perl_vendorarch
# remove perllocal.pod file
%{__rm} -rf $RPM_BUILD_ROOT%perl_archlib
%perl_gen_filelist

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files -f %{name}.files
%defattr(-,root,root,-)
%doc Changes README

%changelog
openSUSE Build Service is sponsored by