Blame SPECS/perl-DBD-MariaDB.spec

81dc9f
# Disable leak tests
81dc9f
%bcond_with perl_DBD_MariaDB_enables_leak_test
81dc9f
# Perform optional net_ssleay tests
81dc9f
%if 0%{?rhel}
81dc9f
%bcond_with perl_DBD_MariaDB_enables_net_ssleay_test
81dc9f
%else
81dc9f
%bcond_without perl_DBD_MariaDB_enables_net_ssleay_test
81dc9f
%endif
81dc9f
81dc9f
Name:           perl-DBD-MariaDB
81dc9f
Version:        1.21
81dc9f
Release:        15%{?dist}
81dc9f
Summary:        MariaDB and MySQL driver for the Perl5 Database Interface (DBI)
81dc9f
License:        GPL+ or Artistic
81dc9f
URL:            https://metacpan.org/release/DBD-MariaDB/
81dc9f
Source0:        https://cpan.metacpan.org/authors/id/P/PA/PALI/DBD-MariaDB-%{version}.tar.gz
81dc9f
Source1:        test-setup.t
81dc9f
Source2:        test-clean.t
81dc9f
Source3:        test-env.sh
81dc9f
Patch0:         DBD-MariaDB-1.21-Run-test-setup-and-clean.patch
81dc9f
BuildRequires:  findutils
81dc9f
BuildRequires:  gcc
81dc9f
BuildRequires:  make
81dc9f
BuildRequires:  mariadb-connector-c
81dc9f
BuildRequires:  mariadb-connector-c-devel
81dc9f
BuildRequires:  openssl-devel
81dc9f
BuildRequires:  perl-devel
81dc9f
BuildRequires:  perl-generators
81dc9f
BuildRequires:  perl-interpreter
81dc9f
BuildRequires:  perl(:VERSION) >= 5.8.1
81dc9f
BuildRequires:  perl(Config)
81dc9f
BuildRequires:  perl(Data::Dumper)
81dc9f
BuildRequires:  perl(DBI) >= 1.608
81dc9f
BuildRequires:  perl(DBI::DBD)
81dc9f
BuildRequires:  perl(Devel::CheckLib) >= 1.12
81dc9f
BuildRequires:  perl(DynaLoader)
81dc9f
BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.76
81dc9f
BuildRequires:  perl(File::Spec)
81dc9f
BuildRequires:  perl(Getopt::Long)
81dc9f
BuildRequires:  perl(strict)
81dc9f
BuildRequires:  perl(utf8)
81dc9f
BuildRequires:  perl(warnings)
81dc9f
# Tests
81dc9f
BuildRequires:  hostname
81dc9f
BuildRequires:  mariadb
81dc9f
BuildRequires:  mariadb-server
81dc9f
BuildRequires:  perl(B)
81dc9f
BuildRequires:  perl(bigint)
81dc9f
BuildRequires:  perl(constant)
81dc9f
# Required to process t/testrules.yml
81dc9f
BuildRequires:  perl(CPAN::Meta::YAML)
81dc9f
BuildRequires:  perl(DBI::Const::GetInfoType)
81dc9f
BuildRequires:  perl(Encode)
81dc9f
BuildRequires:  perl(File::Path)
81dc9f
BuildRequires:  perl(File::Temp)
81dc9f
BuildRequires:  perl(FindBin)
81dc9f
BuildRequires:  perl(lib)
81dc9f
BuildRequires:  perl(Test::Deep)
81dc9f
BuildRequires:  perl(Test::More) >= 0.90
81dc9f
BuildRequires:  perl(Time::HiRes)
81dc9f
BuildRequires:  perl(vars)
81dc9f
# Optional tests
81dc9f
%if %{with perl_DBD_MariaDB_enables_net_ssleay_test}
81dc9f
BuildRequires:  perl(Net::SSLeay)
81dc9f
%endif
81dc9f
%if %{with perl_DBD_MariaDB_enables_leak_test}
81dc9f
BuildRequires:  perl(Proc::ProcessTable)
81dc9f
BuildRequires:  perl(Storable)
81dc9f
%endif
81dc9f
81dc9f
Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
81dc9f
81dc9f
# Filter private modules for tests
81dc9f
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}perl\\(lib.pl\\)
81dc9f
81dc9f
%description
81dc9f
DBD::MariaDB is the Perl5 Database Interface driver for MariaDB and MySQL
81dc9f
databases. In other words: DBD::MariaDB is an interface between the Perl
81dc9f
programming language and the MariaDB/MySQL programming API that comes with
81dc9f
the MariaDB/MySQL relational database management system. Most functions
81dc9f
provided by this programming API are supported. Some rarely used functions
81dc9f
are missing, mainly because no-one ever requested them.
81dc9f
81dc9f
%package tests
81dc9f
Summary:        Tests for %{name}
81dc9f
Requires:       %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
81dc9f
Requires:       perl-Test-Harness
81dc9f
Requires:       hostname
81dc9f
Requires:       mariadb
81dc9f
Requires:       mariadb-server
81dc9f
# Required to process t/testrules.yml
81dc9f
Requires:       perl(CPAN::Meta::YAML)
81dc9f
# Optional tests
81dc9f
%if %{with perl_DBD_MariaDB_enables_net_ssleay_test}
81dc9f
Requires:       perl(Net::SSLeay)
81dc9f
%endif
81dc9f
%if %{with perl_DBD_MariaDB_enables_leak_test}
81dc9f
Requires:       perl(Proc::ProcessTable)
81dc9f
Requires:       perl(Storable)
81dc9f
%endif
81dc9f
81dc9f
%description tests
81dc9f
Tests from %{name}. Execute them
81dc9f
with "%{_libexecdir}/%{name}/test".
81dc9f
81dc9f
%prep
81dc9f
%setup -q -n DBD-MariaDB-%{version}
81dc9f
%patch0 -p1
81dc9f
cp %{SOURCE1} %{SOURCE2} t/
81dc9f
81dc9f
# Help file to recognise the Perl scripts and normalize shebangs
81dc9f
for F in t/*.t t/*.pl; do
81dc9f
    perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
81dc9f
    chmod +x "$F"
81dc9f
done
81dc9f
81dc9f
# Remove release tests
81dc9f
for F in t/pod.t t/manifest.t; do
81dc9f
    rm "$F"
81dc9f
    perl -i -ne 'print $_ unless m{^\Q'"$F"'\E}' MANIFEST
81dc9f
    perl -i -ne 'print $_ unless m{\Q'"$F"'\E}' t/testrules.yml
81dc9f
done
81dc9f
81dc9f
%if %{without perl_DBD_MariaDB_enables_leak_test}
81dc9f
# Remove unused tests
81dc9f
for F in t/60leaks.t t/rt86153-reconnect-fail-memory.t; do
81dc9f
    rm "$F"
81dc9f
    perl -i -ne 'print $_ unless m{^\Q'"$F"'\E}' MANIFEST
81dc9f
    perl -i -ne 'print $_ unless m{\Q'"$F"'\E}' t/testrules.yml
81dc9f
done
81dc9f
%endif
81dc9f
81dc9f
%build
81dc9f
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS" NO_PACKLIST=1 NO_PERLLOCAL=1
81dc9f
%{make_build}
81dc9f
81dc9f
%install
81dc9f
%{make_install}
81dc9f
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete
81dc9f
81dc9f
# Install tests
81dc9f
mkdir -p %{buildroot}%{_libexecdir}/%{name}
81dc9f
cp -a t %{buildroot}%{_libexecdir}/%{name}
81dc9f
cp %{SOURCE3} %{buildroot}%{_libexecdir}/%{name}
81dc9f
cat > %{buildroot}%{_libexecdir}/%{name}/test << EOF
81dc9f
#!/bin/sh
81dc9f
unset RELEASE_TESTING
81dc9f
. %{_libexecdir}/%{name}/$(basename %{SOURCE3})
81dc9f
cd %{_libexecdir}/%{name} && exec prove -I .
81dc9f
EOF
81dc9f
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
81dc9f
81dc9f
%{_fixperms} $RPM_BUILD_ROOT/*
81dc9f
81dc9f
%check
81dc9f
# Set MariaDB and DBD::MariaDB test environment
81dc9f
. %{SOURCE3}
81dc9f
81dc9f
unset RELEASE_TESTING
81dc9f
make test %{?with_perl_DBD_MariaDB_enables_leak_test:EXTENDED_TESTING=1}
81dc9f
81dc9f
%files
81dc9f
%license LICENSE
81dc9f
%doc Changes Changes.historic
81dc9f
%{perl_vendorarch}/auto/*
81dc9f
%{perl_vendorarch}/DBD*
81dc9f
%{_mandir}/man3/*
81dc9f
81dc9f
%files tests
81dc9f
%{_libexecdir}/%{name}
81dc9f
81dc9f
%changelog
81dc9f
* Tue Aug 17 2021 Jitka Plesnikova <jplesnik@redhat.com> - 1.21-15
81dc9f
- Related: rhbz#1960259 - Enable gating
81dc9f
81dc9f
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.21-14
81dc9f
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
81dc9f
  Related: rhbz#1991688
81dc9f
81dc9f
* Tue Jun 22 2021 Mohan Boddu <mboddu@redhat.com> - 1.21-13
81dc9f
- Rebuilt for RHEL 9 BETA for openssl 3.0
81dc9f
  Related: rhbz#1971065
81dc9f
81dc9f
* Tue May 04 2021 Jitka Plesnikova <jplesnik@redhat.com> - 1.21-12
81dc9f
- Update tests
81dc9f
81dc9f
* Fri Mar 12 2021 Jitka Plesnikova <jplesnik@redhat.com> - 1.21-11
81dc9f
- Package tests
81dc9f
81dc9f
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.21-10
81dc9f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
81dc9f
81dc9f
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.21-9
81dc9f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
81dc9f
81dc9f
* Tue Jun 23 2020 Jitka Plesnikova <jplesnik@redhat.com> - 1.21-8
81dc9f
- Perl 5.32 rebuild
81dc9f
81dc9f
* Fri Apr 17 2020 Jitka Plesnikova <jplesnik@redhat.com> - 1.21-7
81dc9f
- Update setup script due to Pali's comments
81dc9f
81dc9f
* Tue Feb 04 2020 Jitka Plesnikova <jplesnik@redhat.com> - 1.21-6
81dc9f
- Update setup script to work with MariaDB 10.4
81dc9f
81dc9f
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.21-5
81dc9f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
81dc9f
81dc9f
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.21-4
81dc9f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
81dc9f
81dc9f
* Wed Jul 10 2019 Jitka Plesnikova <jplesnik@redhat.com> - 1.21-3
81dc9f
- Run setup as part of tests
81dc9f
81dc9f
* Wed Jun 26 2019 Jitka Plesnikova <jplesnik@redhat.com> - 1.21-2
81dc9f
- Enable tests
81dc9f
81dc9f
* Thu Jun 13 2019 Jitka Plesnikova <jplesnik@redhat.com> - 1.21-1
81dc9f
- Specfile autogenerated by cpanspec 1.78.