3a89e0
# We don't really need ExtUtils::MakeMaker ≥ 6.30
3a89e0
%global old_eumm %(perl -MExtUtils::MakeMaker -e 'print (($ExtUtils::MakeMaker::VERSION < 6.30) ? 1 : 0);' 2>/dev/null || echo 0)
3a89e0
3a89e0
# Test suite needs patching if we have Test::More < 0.88
3a89e0
%global old_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION < 0.88) ? 1 : 0);' 2>/dev/null || echo 0)
3a89e0
3a89e0
# Select the appropriate system speller
3a89e0
%if %(perl -e 'print (($] >= 5.010000) ? 1 : 0);')
3a89e0
%global speller hunspell
3a89e0
%else
3a89e0
%global speller aspell
3a89e0
%endif
3a89e0
3a89e0
Name:		perl-Perl-OSType
3a89e0
Version:	1.003
3a89e0
Release:	3%{?dist}
3a89e0
Summary:	Map Perl operating system names to generic types
3a89e0
License:	GPL+ or Artistic
3a89e0
Group:		Development/Libraries
3a89e0
URL:		http://search.cpan.org/dist/Perl-OSType/
3a89e0
Source0:	http://search.cpan.org/CPAN/authors/id/D/DA/DAGOLDEN/Perl-OSType-%{version}.tar.gz
3a89e0
Patch0:		Perl-OSType-1.003-old-EU::MM.patch
3a89e0
Patch1:		Perl-OSType-1.003-old-Test::More.patch
3a89e0
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
3a89e0
BuildArch:	noarch
3a89e0
# Build
3a89e0
BuildRequires:	perl(ExtUtils::MakeMaker)
3a89e0
# Module
3a89e0
BuildRequires:	perl(Exporter)
3a89e0
# Test Suite
3a89e0
BuildRequires:	perl(constant)
3a89e0
BuildRequires:	perl(File::Spec::Functions)
3a89e0
BuildRequires:	perl(File::Temp)
3a89e0
BuildRequires:	perl(List::Util)
3a89e0
BuildRequires:	perl(Test::More)
3a89e0
# Optional tests, not run for this dual-lived module when bootstrapping
3a89e0
# Also not run for EPEL-5/6 builds due to package unavailability
3a89e0
%if !%{defined perl_bootstrap} && 0%{?fedora}
3a89e0
BuildRequires:	perl(Perl::Critic::Policy::Lax::ProhibitStringyEval::ExceptForRequire)
3a89e0
BuildRequires:	perl(Pod::Coverage::TrustPod)
3a89e0
BuildRequires:	perl(Pod::Wordlist::hanekomu)
3a89e0
BuildRequires:	perl(Test::CPAN::Meta)
3a89e0
BuildRequires:	perl(Test::MinimumVersion)
3a89e0
BuildRequires:	perl(Test::Perl::Critic)
3a89e0
BuildRequires:	perl(Test::Pod)
3a89e0
BuildRequires:	perl(Test::Pod::Coverage)
3a89e0
BuildRequires:	perl(Test::Portability::Files)
3a89e0
BuildRequires:	perl(Test::Spelling), %{speller}-en
3a89e0
BuildRequires:	perl(Test::Version)
3a89e0
%endif
3a89e0
# Runtime
3a89e0
Requires:	perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
3a89e0
3a89e0
%description
3a89e0
Modules that provide OS-specific behaviors often need to know if the current
3a89e0
operating system matches a more generic type of operating systems. For example,
3a89e0
'linux' is a type of 'Unix' operating system and so is 'freebsd'.
3a89e0
3a89e0
This module provides a mapping between an operating system name as given by $^O
3a89e0
and a more generic type. The initial version is based on the OS type mappings
3a89e0
provided in Module::Build and ExtUtils::CBuilder (thus, Microsoft operating
3a89e0
systems are given the type 'Windows' rather than 'Win32').
3a89e0
3a89e0
%prep
3a89e0
%setup -q -n Perl-OSType-%{version}
3a89e0
3a89e0
# We don't really need ExtUtils::MakeMaker ≥ 6.30
3a89e0
%if %{old_eumm}
3a89e0
%patch0
3a89e0
%endif
3a89e0
3a89e0
# Fix test suite for Test::More < 0.88
3a89e0
%if %{old_test_more}
3a89e0
%patch1
3a89e0
%endif
3a89e0
3a89e0
%build
3a89e0
perl Makefile.PL INSTALLDIRS=vendor
3a89e0
make %{?_smp_mflags}
3a89e0
3a89e0
%install
3a89e0
rm -rf %{buildroot}
3a89e0
make pure_install DESTDIR=%{buildroot}
3a89e0
find %{buildroot} -type f -name .packlist -exec rm -f {} \;
3a89e0
%{_fixperms} %{buildroot}
3a89e0
3a89e0
%check
3a89e0
make test
3a89e0
%if !%{defined perl_bootstrap} && 0%{?fedora}
3a89e0
make test TEST_FILES="$(echo $(find xt/ -name '*.t'))"
3a89e0
%endif
3a89e0
3a89e0
%clean
3a89e0
rm -rf %{buildroot}
3a89e0
3a89e0
%files
3a89e0
%doc Changes CONTRIBUTING LICENSE README
3a89e0
%{perl_vendorlib}/Perl/
3a89e0
%{_mandir}/man3/Perl::OSType.3pm*
3a89e0
3a89e0
%changelog
3a89e0
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.003-3
3a89e0
- Mass rebuild 2013-12-27
3a89e0
3a89e0
* Thu Mar 21 2013 Petr Pisar <ppisar@redhat.com> - 1.003-2
3a89e0
- Disable optional tests on RHEL 7 too
3a89e0
3a89e0
* Thu Mar 21 2013 Paul Howarth <paul@city-fan.org> - 1.003-1
3a89e0
- Update to 1.003
3a89e0
  - Fixed detection of VOS; $^O reports 'vos', not 'VOS'
3a89e0
  - Additional release tests
3a89e0
- BR: perl(File::Spec::Functions), perl(List::Util),
3a89e0
  perl(Perl::Critic::Policy::Lax::ProhibitStringyEval::ExceptForRequire),
3a89e0
  perl(Pod::Wordlist::hanekomu), perl(Test::MinimumVersion),
3a89e0
  perl(Test::Perl::Critic), perl(Test::Spelling) and perl(Test::Version)
3a89e0
- Identify purpose of each build requirement
3a89e0
- Update patches for building on old distributions
3a89e0
- Don't run extra tests for EPEL-5/6 builds
3a89e0
3a89e0
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.002-242
3a89e0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
3a89e0
3a89e0
* Tue Aug 28 2012 Paul Howarth <paul@city-fan.org> - 1.002-241
3a89e0
- Drop %%defattr, redundant since rpm 4.4
3a89e0
- Don't need to remove empty directories from the buildroot
3a89e0
- Don't delete the extra tests when bootstrapping, but don't run them either
3a89e0
3a89e0
* Fri Aug 17 2012 Petr Pisar <ppisar@redhat.com> - 1.002-240
3a89e0
- Increase release to replace perl sub-package (bug #848961)
3a89e0
3a89e0
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.002-13
3a89e0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
3a89e0
3a89e0
* Tue Jul 10 2012 Petr Pisar <ppisar@redhat.com> - 1.002-12
3a89e0
- Perl 5.16 re-rebuild of bootstrapped packages
3a89e0
3a89e0
* Wed Jun 06 2012 Petr Pisar <ppisar@redhat.com> - 1.002-11
3a89e0
- Perl 5.16 rebuild
3a89e0
3a89e0
* Fri Jun 01 2012 Petr Pisar <ppisar@redhat.com> - 1.002-10
3a89e0
- Skip author tests on bootstrap
3a89e0
3a89e0
* Thu Jan 12 2012 Paul Howarth <paul@city-fan.org> - 1.002-9
3a89e0
- Fedora 17 mass rebuild
3a89e0
3a89e0
* Wed Aug 17 2011 Paul Howarth <paul@city-fan.org> - 1.002-8
3a89e0
- BR: perl(Pod::Coverage::TrustPod) unconditionally now that it's available in
3a89e0
  EPEL-4
3a89e0
3a89e0
* Tue Aug 16 2011 Marcela Maslanova <mmaslano@redhat.com> - 1.002-7
3a89e0
- Install to vendor perl directories to avoid potential debuginfo conflicts
3a89e0
  with the main perl package if this module ever becomes arch-specific
3a89e0
3a89e0
* Thu Jul 21 2011 Petr Sabata <contyk@redhat.com> - 1.002-6
3a89e0
- Perl mass rebuild
3a89e0
3a89e0
* Tue Jul 19 2011 Petr Sabata <contyk@redhat.com> - 1.002-5
3a89e0
- Perl mass rebuild
3a89e0
3a89e0
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.002-4
3a89e0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
3a89e0
3a89e0
* Wed Jan 26 2011 Paul Howarth <paul@city-fan.org> - 1.002-3
3a89e0
- BR: perl(constant), perl(Exporter), perl(File::Temp) in case they are
3a89e0
  dual-lived at some point (#672801)
3a89e0
3a89e0
* Wed Jan 26 2011 Paul Howarth <paul@city-fan.org> - 1.002-2
3a89e0
- Sanitize for Fedora submission
3a89e0
3a89e0
* Tue Jan 25 2011 Paul Howarth <paul@city-fan.org> - 1.002-1
3a89e0
- Initial RPM version