1636e6f
# Run optional tests
1636e6f
%{bcond_without perl_Graphics_TIFF_enables_optional_test}
1636e6f
1636e6f
Name:           perl-Graphics-TIFF
63723e4
Version:        16
4e12fe7
Release:        2%{?dist}
1636e6f
Summary:        Perl extension for the LibTIFF library
1636e6f
License:        GPL+ or Artistic
7537cf2
URL:            https://metacpan.org/release/Graphics-TIFF
7537cf2
Source0:        https://cpan.metacpan.org/authors/id/R/RA/RATCLIFFE/Graphics-TIFF-%{version}.tar.gz
2b7ee92
BuildRequires:  coreutils
1636e6f
BuildRequires:  findutils
1636e6f
BuildRequires:  gcc
1636e6f
BuildRequires:  make
1636e6f
BuildRequires:  perl-devel
1636e6f
BuildRequires:  perl-generators
1636e6f
BuildRequires:  perl-interpreter
1636e6f
BuildRequires:  perl(:VERSION) >= 5.8.5
09f36fc
BuildRequires:  perl(Config)
1636e6f
BuildRequires:  perl(English)
1636e6f
BuildRequires:  perl(ExtUtils::Depends)
1636e6f
BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.76
1636e6f
BuildRequires:  perl(ExtUtils::PkgConfig)
1636e6f
BuildRequires:  perl(strict)
1636e6f
BuildRequires:  perl(warnings)
1636e6f
BuildRequires:  pkgconfig(libtiff-4) >= 4.0.3
1636e6f
# Run-time:
1636e6f
BuildRequires:  perl(base)
1636e6f
BuildRequires:  perl(Exporter)
1636e6f
BuildRequires:  perl(Readonly)
1636e6f
BuildRequires:  perl(XSLoader)
1636e6f
# Tests:
9ab4c1c
# ImageMagick for convert executed by t/1.t
9ab4c1c
BuildRequires:  ImageMagick
1636e6f
BuildRequires:  perl(File::Spec)
d69dc85
BuildRequires:  perl(File::Temp) >= 0.19
6b640c7
BuildRequires:  perl(IPC::Cmd)
1636e6f
BuildRequires:  perl(Test::Deep)
1636e6f
BuildRequires:  perl(Test::More)
1636e6f
BuildRequires:  perl(Test::Requires)
1636e6f
%if %{with perl_Graphics_TIFF_enables_optional_test}
1636e6f
# Optional tests:
299174f
BuildRequires:  grep
299174f
# libtiff-tools for tiffcp, tiff2pdf, tiffinfo
1636e6f
BuildRequires:  libtiff-tools
299174f
BuildRequires:  perl(:VERSION) >= 5.10
299174f
BuildRequires:  perl(feature)
299174f
BuildRequires:  perl(if)
299174f
BuildRequires:  perl(Image::Magick)
1636e6f
# Test::Perl::Critic not used
6b640c7
# for hexdump
299174f
BuildRequires:  util-linux
1636e6f
%endif
1636e6f
Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
1636e6f
1636e6f
%description
1636e6f
The Graphics::TIFF module allows a Perl developer to access TIFF images using
1636e6f
LibTIFF library in a Perlish and object-oriented way.
1636e6f
09f36fc
%package tests
09f36fc
Summary:        Tests for %{name}
159a430
BuildArch:      noarch
159a430
Requires:       %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
9ab4c1c
# ImageMagick for convert executed by t/1.t
9ab4c1c
Requires:       ImageMagick
09f36fc
Requires:       perl-Test-Harness
09f36fc
%if %{with perl_Graphics_TIFF_enables_optional_test}
09f36fc
# Optional tests:
09f36fc
Requires:       grep
09f36fc
# libtiff-tools for tiffcp, tiff2pdf, tiffinfo
09f36fc
Requires:       libtiff-tools
09f36fc
Requires:       perl(:VERSION) >= 5.10
09f36fc
Requires:       perl(if)
09f36fc
Requires:       perl(Image::Magick)
09f36fc
# for hexdump
09f36fc
Requires:       util-linux
09f36fc
%endif
09f36fc
09f36fc
%description tests
d69dc85
Tests from %{name}. Execute them
09f36fc
with "%{_libexecdir}/%{name}/test".
09f36fc
1636e6f
%prep
3c060ef
%autosetup -p 1 -n Graphics-TIFF-%{version}
9ab4c1c
# Delete author tests skipped by default
9ab4c1c
for F in t/91_critic.t; do
9ab4c1c
    rm "$F"
9ab4c1c
    perl -i -ne 'print $_ unless m{\Q'"$F"'\E}' MANIFEST
9ab4c1c
done
6b640c7
%if !%{with perl_Graphics_TIFF_enables_optional_test}
6b640c7
for F in t/1.t t/92_tiffinfo.t t/93_tiff2pdf.t; do
6b640c7
    rm "$F"
6b640c7
    perl -i -ne 'print $_ unless m{\Q'"$F"'\E}' MANIFEST
6b640c7
done
6b640c7
%endif
09f36fc
for F in t/*.t; do
09f36fc
    perl -i -MConfig -ple 'print $Config{startperl} if $. == 1' "$F"
09f36fc
    chmod +x "$F"
09f36fc
done
1636e6f
1636e6f
%build
2b7ee92
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_OPT_FLAGS"
2b7ee92
%{make_build}
1636e6f
1636e6f
%install
2b7ee92
%{make_install}
b0a9301
find %{buildroot} -type f -name '*.bs' -size 0 -delete
159a430
%{_fixperms} %{buildroot}/*
09f36fc
# Install tests
09f36fc
mkdir -p %{buildroot}/%{_libexecdir}/%{name}
09f36fc
cp -a t %{buildroot}/%{_libexecdir}/%{name}
09f36fc
%if %{with perl_Graphics_TIFF_enables_optional_test}
09f36fc
cp -a examples %{buildroot}/%{_libexecdir}/%{name}
09f36fc
chmod +x %{buildroot}/%{_libexecdir}/%{name}/examples/*
09f36fc
%endif
09f36fc
cat > %{buildroot}/%{_libexecdir}/%{name}/test << 'EOF'
09f36fc
#!/bin/sh
09f36fc
cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
09f36fc
EOF
09f36fc
chmod +x %{buildroot}/%{_libexecdir}/%{name}/test
1636e6f
1636e6f
%check
09f36fc
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
1636e6f
make test
1636e6f
1636e6f
%files
299174f
%doc Changes examples README
1636e6f
%{perl_vendorarch}/auto/*
1636e6f
%{perl_vendorarch}/Graphics*
1636e6f
%{_mandir}/man3/*
1636e6f
09f36fc
%files tests
09f36fc
%{_libexecdir}/%{name}
09f36fc
1636e6f
%changelog
4e12fe7
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 16-2
4e12fe7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
4e12fe7
63723e4
* Wed Jun 23 2021 Petr Pisar <ppisar@redhat.com> - 16-1
63723e4
- 16 version bump
63723e4
ab981a9
* Thu Jun 03 2021 Petr Pisar <ppisar@redhat.com> - 15-1
ab981a9
- 15 version bump
159a430
- Make tests subpackage noarch
ab981a9
3f95995
* Tue Jun 01 2021 Petr Pisar <ppisar@redhat.com> - 14-1
3f95995
- 14 version bump
3f95995
b0a9301
* Thu May 27 2021 Petr Pisar <ppisar@redhat.com> - 13-1
b0a9301
- 13 version bump
b0a9301
c23efa2
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 12-2
c23efa2
- Perl 5.34 rebuild
c23efa2
95b2a72
* Fri Apr 30 2021 Petr Pisar <ppisar@redhat.com> - 12-1
95b2a72
- 12 version bump
95b2a72
0e49790
* Tue Apr 27 2021 Petr Pisar <ppisar@redhat.com> - 11-1
0e49790
- 11 version bump
0e49790
3c060ef
* Tue Apr 27 2021 Petr Pisar <ppisar@redhat.com> - 10-2
3c060ef
- Adjust tests to libtiff-4.3.0 (CPAN RT#135330)
3c060ef
9ab4c1c
* Mon Apr 12 2021 Petr Pisar <ppisar@redhat.com> - 10-1
9ab4c1c
- 10 version bump
9ab4c1c
d69dc85
* Thu Feb 11 2021 Petr Pisar <ppisar@redhat.com> - 9-1
d69dc85
- Version 9 bump
d69dc85
e658901
* Wed Feb 10 2021 Petr Pisar <ppisar@redhat.com> - 8-2
e658901
- Make tests subpackage architecture specific
e658901
6b640c7
* Tue Feb 09 2021 Petr Pisar <ppisar@redhat.com> - 8-1
6b640c7
- Version 8 bump
09f36fc
- Package tests and make them parallel-safe
6b640c7
6413fbf
* Mon Feb 08 2021 Petr Pisar <ppisar@redhat.com> - 7-3
6413fbf
- Adapt tests to libtiff-4.2.0 (CPAN RT#134344)
6413fbf
4158b0a
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 7-2
4158b0a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
4158b0a
2b7ee92
* Thu Oct 29 2020 Petr Pisar <ppisar@redhat.com> - 7-1
2b7ee92
- Version 7 bump
2b7ee92
4d49047
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6-10
4d49047
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
4d49047
39bcb74
* Tue Jun 23 2020 Jitka Plesnikova <jplesnik@redhat.com> - 6-9
39bcb74
- Perl 5.32 rebuild
39bcb74
7e4692e
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6-8
7e4692e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
7e4692e
2878dfe
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6-7
2878dfe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
2878dfe
eeb2508
* Fri May 31 2019 Jitka Plesnikova <jplesnik@redhat.com> - 6-6
eeb2508
- Perl 5.30 rebuild
eeb2508
520a256
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6-5
520a256
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
520a256
e61f249
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6-4
e61f249
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
e61f249
14c574c
* Fri Jun 29 2018 Jitka Plesnikova <jplesnik@redhat.com> - 6-3
14c574c
- Perl 5.28 rebuild
14c574c
86ca34e
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6-2
86ca34e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
86ca34e
1276882
* Thu Aug 10 2017 Petr Pisar <ppisar@redhat.com> - 6-1
1276882
- Version 6 bump
1276882
299174f
* Tue Aug 01 2017 Petr Pisar <ppisar@redhat.com> - 5-1
299174f
- Version 5 bump
299174f
1636e6f
* Fri Jul 28 2017 Petr Pisar <ppisar@redhat.com> 4-1
1636e6f
- Specfile autogenerated by cpanspec 1.78.