%global _empty_manifest_terminate_build 0

Name:           perl-DBIx-RunSQL
Version:        0.28
Release:        1
Summary:        DBIx::RunSQL Perl module
License:        GPL+ or Artistic-1.0-Perl
Group:          Development/Libraries
URL:            http://search.cpan.org/dist/DBIx-RunSQL/
Source0:        http://www.cpan.org/authors/id/C/CO/CORION/DBIx-RunSQL-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  perl >= 0:5.020
BuildRequires:  perl-generators
BuildRequires:  perl(Data::Dumper)
BuildRequires:  perl(DBI)
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl(Getopt::Long) >= 2.36
BuildRequires:  perl(Module::Load)
BuildRequires:  perl(strict)
BuildRequires:  perl(Test::More)
BuildRequires:  perl(warnings)
Requires:       perl(DBI)
Requires:       perl(Getopt::Long) >= 2.36
Requires:       perl(Module::Load)
Requires:       perl(strict)
Requires:       perl(warnings)

%description
cpanm . cpan  . cpanp -i .

%package help
Summary : DBIx::RunSQL Perl module
Provides: perl-DBIx-RunSQL-doc

%description help
cpanm . cpan  . cpanp -i .

%prep
%setup -q -n DBIx-RunSQL-%{version}

%build
export PERL_MM_OPT=""
%{__perl} Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}

%install
export PERL_MM_OPT=""
rm -rf $RPM_BUILD_ROOT

make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT

find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;

%{_fixperms} $RPM_BUILD_ROOT/*


%check
make test

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc Changes LICENSE META.json README README.mkdn
%{perl_vendorlib}/*
%{_bindir}/run-sql.pl

%files help
%{_mandir}/*

%changelog
* Thu Jul 30 2026 guojunding01 <guojunding@kylinos.cn> - 0.28-1
- Properly handle triggers with immediately preceding comments
- These would have been stuffed together with the next statement(s).
- Better detect where a trigger ends

* Thu Jun 25 2026 guoshengsheng <guoshengsheng@kylinos.cn> - 0.27-1
- Fix GitHub repository URL metadata. (version:0.27)
- Switch split_sql() to an iterator API for large SQL files. (version:0.26)
- Require Perl 5.020 as minimum supported version. (version:0.26)

* Wed Jan 22 2025 sqfu <dev01203@linx-info.com> - 0.25-1
- update version to 0.25
- Don't use Test::More::isn't() anymore, in favour of Test::More::isnt()
- drop useless perl(:MODULE_COMPAT) requirement

* Mon Jul 17 2023 leeffo <liweiganga@uniontech.com> - 0.24-1
- upgrade to version 0.24

* Mon Jul 18 2022 wangshuo <wangshuo@kylinos.cn> - 0.22-1
- Specfile autogenerated by Perl_Bot