2bb1497
Name:           perl-MaxMind-DB-Common
2bb1497
Version:        0.040001
eb8feec
Release:        9%{?dist}
2bb1497
Summary:        Code shared by the MaxMind database reader and writer
2bb1497
License:        Artistic 2.0
2bb1497
URL:            https://metacpan.org/release/MaxMind-DB-Common
2bb1497
Source0:        https://cpan.metacpan.org/authors/id/M/MA/MAXMIND/MaxMind-DB-Common-%{version}.tar.gz
2bb1497
BuildArch:      noarch
2bb1497
BuildRequires:  coreutils
b308a94
BuildRequires:  findutils
2bb1497
BuildRequires:  make
2bb1497
BuildRequires:  perl-generators
2bb1497
BuildRequires:  perl-interpreter
2bb1497
BuildRequires:  perl(:VERSION) >= 5.8
b308a94
BuildRequires:  perl(Config)
2bb1497
BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.76
2bb1497
BuildRequires:  perl(strict)
2bb1497
BuildRequires:  perl(warnings)
2bb1497
# Run-time:
2bb1497
BuildRequires:  perl(autodie)
2bb1497
BuildRequires:  perl(Carp)
2bb1497
BuildRequires:  perl(constant)
2bb1497
# Data::Dumper::Concise not used at tests
2bb1497
# DateTime not used at tests
2bb1497
BuildRequires:  perl(Exporter)
2bb1497
BuildRequires:  perl(List::AllUtils)
9cb7abf
BuildRequires:  perl(Math::BigInt)
2bb1497
BuildRequires:  perl(Moo)
2bb1497
BuildRequires:  perl(Moo::Role)
2bb1497
BuildRequires:  perl(MooX::StrictConstructor)
2bb1497
BuildRequires:  perl(namespace::autoclean)
2bb1497
BuildRequires:  perl(overload)
2bb1497
BuildRequires:  perl(Scalar::Util)
2bb1497
BuildRequires:  perl(Sub::Quote)
2bb1497
# Tests:
2bb1497
BuildRequires:  perl(File::Spec)
2bb1497
BuildRequires:  perl(Test::More) >= 0.96
2bb1497
Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
2bb1497
Requires:       perl(Data::Dumper::Concise)
2bb1497
Requires:       perl(DateTime)
2bb1497
b308a94
# Remove underspecified dependencies
b308a94
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Test::More\\)
b308a94
2bb1497
%description
2bb1497
This distribution provides some shared code for use by both the MaxMind
2bb1497
database reader and writer Perl modules.
2bb1497
b308a94
%package tests
b308a94
Summary:        Tests for %{name}
b308a94
Requires:       %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
b308a94
Requires:       perl-Test-Harness
b308a94
Requires:       perl(Test::More) >= 0.96
b308a94
b308a94
%description tests
b308a94
Tests from %{name}. Execute them
b308a94
with "%{_libexecdir}/%{name}/test".
b308a94
2bb1497
%prep
2bb1497
%setup -q -n MaxMind-DB-Common-%{version}
b308a94
# Remove tests which are always skipped
b308a94
for F in t/author-* t/release-*; do
b308a94
    rm "$F"
b308a94
    perl -i -ne 'print $_ unless m{\A\Q'"$F"'\E}' MANIFEST
b308a94
done
b308a94
# Help generators to recognize Perl scripts
b308a94
for F in $(find t -type f -name '*.t'); do
b308a94
    perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!\s*perl}{$Config{startperl}}' "$F"
b308a94
    chmod +x "$F"
b308a94
done
2bb1497
2bb1497
%build
2bb1497
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
2bb1497
%{make_build}
2bb1497
2bb1497
%install
2bb1497
%{make_install}
b308a94
%{_fixperms} %{buildroot}/*
b308a94
# Install tests
b308a94
mkdir -p %{buildroot}%{_libexecdir}/%{name}
b308a94
cp -a t %{buildroot}%{_libexecdir}/%{name}
b308a94
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
b308a94
#!/bin/sh
b308a94
unset AUTHOR_TESTING
b308a94
cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)" -r
b308a94
EOF
b308a94
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
2bb1497
2bb1497
%check
b308a94
unset AUTHOR_TESTING
b308a94
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
2bb1497
make test
2bb1497
2bb1497
%files
2bb1497
%license LICENSE
2bb1497
%doc Changes README.md
2bb1497
%{perl_vendorlib}/*
2bb1497
%{_mandir}/man3/*
2bb1497
b308a94
%files tests
b308a94
%{_libexecdir}/%{name}
b308a94
2bb1497
%changelog
eb8feec
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.040001-9
eb8feec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
eb8feec
961ce42
* Wed Jun 01 2022 Jitka Plesnikova <jplesnik@redhat.com> - 0.040001-8
961ce42
- Perl 5.36 rebuild
961ce42
b308a94
* Tue May 03 2022 Petr Pisar <ppisar@redhat.com> - 0.040001-7
b308a94
- Package tests
b308a94
b08ea88
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.040001-6
b08ea88
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
b08ea88
ba76e58
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.040001-5
ba76e58
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
ba76e58
a580ab1
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 0.040001-4
a580ab1
- Perl 5.34 rebuild
a580ab1
9cb7abf
* Thu Apr 29 2021 Jitka Plesnikova <jplesnik@redhat.com> - 0.040001-3
9cb7abf
- Add BR: perl(Math::BigInt)
9cb7abf
4eaa835
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.040001-2
4eaa835
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
4eaa835
2bb1497
* Mon Aug 10 2020 Petr Pisar <ppisar@redhat.com> 0.040001-1
2bb1497
- Specfile autogenerated by cpanspec 1.78.