# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify CentOS Linux and Scientific Linux as rhel %if "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "sl" || "%{__distinit}" == "sls" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif # We need to patch the test suite if we have an old version of Test::More %global teenage_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION < 0.96) ? 1 : 0);' 2>/dev/null || echo 0) %global old_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION < 0.88) ? 1 : 0);' 2>/dev/null || echo 0) Name: perl-File-ShareDir-ProjectDistDir Version: 0.4.4 Release: 2.%{__distinit}%{__distvers} Summary: Simple set-and-forget using of a '/share' directory in your project's root License: GPL+ or Artistic Group: Development/Libraries URL: https://metacpan.org/release/File-ShareDir-ProjectDistDir Source0: http://cpan.metacpan.org/authors/id/K/KE/KENTNL/File-ShareDir-ProjectDistDir-%{version}.tar.gz Patch0: File-ShareDir-ProjectDistDir-0.4.4-TM088.patch Patch1: File-ShareDir-ProjectDistDir-0.4.4-TM047.patch Patch2: File-ShareDir-ProjectDistDir-0.4.4-usr-is-prod.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) BuildArch: noarch # Module Build BuildRequires: perl(Module::Build) >= 0.36.01 # Module Runtime BuildRequires: perl(Carp) BuildRequires: perl(File::ShareDir) BuildRequires: perl(Path::Class::File) BuildRequires: perl(Sub::Exporter) BuildRequires: perl(strict) BuildRequires: perl(warnings) # Test Suite BuildRequires: perl(File::Find) BuildRequires: perl(File::Temp) BuildRequires: perl(FindBin) BuildRequires: perl(lib) #BuildRequires: perl(Test::More) >= 0.98 BuildRequires: perl(Test::More) >= 0.47 # Runtime Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) Requires: perl(Carp) %description Simple set-and-forget using of a '/share' directory in your project's root. %prep %setup -q -n File-ShareDir-ProjectDistDir-%{version} # Don't really need Test::More ≥ 0.96 %if %{teenage_test_more} %patch0 %endif # Don't really need Test::More ≥ 0.88 either %if %{old_test_more} %patch1 %endif # Add heuristic: any path under /usr is a production path %patch2 %build perl Build.PL installdirs=vendor ./Build %install rm -rf %{buildroot} ./Build install destdir=%{buildroot} create_packlist=0 %{_fixperms} %{buildroot} %check ./Build test %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc Changes LICENSE README %{perl_vendorlib}/File/ %{_mandir}/man3/File::ShareDir::ProjectDistDir.3pm* %changelog * Fri Sep 20 2013 Paul Howarth - 0.4.4-2 - Add heuristic: any path under /usr is a production path * Sun Sep 15 2013 Paul Howarth - 0.4.4-1 - Initial RPM version