# 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 Alma, CentOS, CentOS Stream and Rocky Linux as rhel %if "%{__distinit}" == "a" || "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "cs" || "%{__distinit}" == "rl" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif Name: perl-File-pushd Version: 1.016 Release: 17.%{__distinit}%{__distvers} Summary: Change directory temporarily for a limited scope License: Apache-2.0 URL: https://metacpan.org/release/File-pushd Source0: https://cpan.metacpan.org/modules/by-module/File/File-pushd-%{version}.tar.gz BuildArch: noarch # Module Build BuildRequires: coreutils BuildRequires: findutils BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(ExtUtils::MakeMaker) >= 6.17 # Module Runtime BuildRequires: perl(Carp) BuildRequires: perl(Cwd) BuildRequires: perl(Exporter) BuildRequires: perl(File::Path) BuildRequires: perl(File::Spec) BuildRequires: perl(File::Temp) BuildRequires: perl(overload) BuildRequires: perl(strict) BuildRequires: perl(warnings) # Test Suite BuildRequires: perl(Config) BuildRequires: perl(lib) BuildRequires: perl(File::Basename) BuildRequires: perl(File::Spec::Functions) BuildRequires: perl(Test::More) >= 0.96 # Optional Tests BuildRequires: perl(CPAN::Meta) >= 2.120900 BuildRequires: perl(CPAN::Meta::Prereqs) # Release Tests # perl-Perl-Critic → perl-Config-Tiny → perl-Path-Tiny → perl-File-pushd %if 0%{!?perl_bootstrap:1} BuildRequires: perl(blib) BuildRequires: perl(Perl::Critic::Policy::Lax::ProhibitStringyEval::ExceptForRequire) BuildRequires: perl(Pod::Coverage::TrustPod) BuildRequires: perl(Pod::Wordlist) BuildRequires: perl(Test::CPAN::Meta) BuildRequires: perl(Test::MinimumVersion) BuildRequires: perl(Test::Perl::Critic) BuildRequires: perl(Test::Pod) >= 1.41 BuildRequires: perl(Test::Pod::Coverage) >= 1.08 BuildRequires: perl(Test::Portability::Files) BuildRequires: perl(Test::Spelling), aspell-en BuildRequires: perl(Test::Version) %endif # Dependencies %if 0%{?fedora} < 38 && 0%{?rhel} < 10 Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %endif %description File::pushd does a temporary chdir that is easily and automatically reverted, similar to pushd in some Unix command shells. It works by creating an object that caches the original working directory. When the object is destroyed, the destructor calls chdir to revert to the original working directory. By storing the object in a lexical variable with a limited scope, this happens automatically at the end of the scope. %prep %setup -q -n File-pushd-%{version} %build perl Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install make pure_install DESTDIR=%{buildroot} find %{buildroot} -type f -name .packlist -delete %{_fixperms} -c %{buildroot} %check make test %if 0%{!?perl_bootstrap:1} make test TEST_FILES="$(echo $(find xt/ -name '*.t'))" %endif %files %license LICENSE %doc Changes CONTRIBUTING.mkdn README Todo %{perl_vendorlib}/File/ %{_mandir}/man3/File::pushd.3* %changelog * Tue Apr 18 2023 Paul Howarth - 1.016-17 - Use SPDX-format license tag * Tue Apr 6 2021 Paul Howarth - 1.016-6 - BR: perl(Pod::Wordlist) rather than perl(Pod::Wordlist::hanekomu) - Use %%license unconditionally * Fri May 31 2019 Paul Howarth - 1.016-5 - Perl 5.30 rebuild * Mon May 21 2018 Paul Howarth - 1.016-1 - Update to 1.016 - Directories created with tempd will only be cleaned up by the PID that created them, not by forked children - BR: perl-generators unconditionally - BR: perl-interpreter rather than perl - Drop support for EOL distributions prior to F-13 - Drop BuildRoot: and Group: tags - Drop explicit buildroot cleaning in %%install section - Drop explicit %%clean section - Drop workaround for building with Test::More < 0.96 * Mon Oct 10 2016 Paul Howarth - 1.014-1 - Update to 1.014 - pushd/tempd warn if called in void context (GH#9) - Fixed test failures on some 5.8 perls - Update patch for building with old Test::More versions * Wed Aug 24 2016 Paul Howarth - 1.009-6 - BR: perl-generators where available - Simplify find command using -delete * Tue Sep 2 2014 Paul Howarth - 1.009-2 - Use %%license where possible * Fri Jul 4 2014 Paul Howarth - 1.009-1 - Update to 1.009 - Require a newer version of Test::More - Update patch for building with old Test::More versions * Tue Jun 10 2014 Paul Howarth - 1.007-1 - Update to 1.007 - Fixed a testing edge case on Windows * Thu Mar 27 2014 Paul Howarth - 1.006-1 - Update to 1.006 - Noted that multiple pushd objects in a lexical scope are not destroyed in a predictable order - Modernized Dist::Zilla configuration and repo support files - Drop support for old distributions prior to FC-5: - Drop %%defattr, redundant since rpm 4.4 - Drop patch for building with ExtUtils::MakeMaker < 6.30 * Wed Sep 4 2013 Paul Howarth - 1.005-4 - Don't run the release tests when bootstrapping * Wed Jul 24 2013 Paul Howarth - 1.005-3 - Perl 5.18 rebuild * Mon Apr 1 2013 Paul Howarth - 1.005-2 - Import from Fedora * Mon Mar 25 2013 Petr Šabata - 1.005-1 - 1.005 bump * Wed Mar 06 2013 Petr Pisar - 1.004-1 - 1.004 bump * Thu Feb 14 2013 Fedora Release Engineering - 1.003-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Thu Nov 29 2012 Petr Šabata - 1.003-1 - 1.003 bump * Fri Jul 20 2012 Fedora Release Engineering - 1.002-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Thu Jun 07 2012 Petr Pisar - 1.002-3 - Perl 5.16 rebuild * Fri Jan 13 2012 Fedora Release Engineering - 1.002-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Mon Dec 12 2011 Petr Šabata - 1.002-1 - 1.002 bump * Thu Sep 15 2011 Petr Sabata - 1.001-1 - 1.001 bump - Remove now obsolete BuildRoot and defattr - Migrate to EU::MM - Correct BR * Fri Jun 17 2011 Marcela Mašláňová - 1.00-9 - Perl mass rebuild * Thu Jun 09 2011 Marcela Mašláňová - 1.00-8 - Perl 5.14 mass rebuild * Tue Feb 08 2011 Fedora Release Engineering - 1.00-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Thu Dec 16 2010 Marcela Maslanova - 1.00-6 - Rebuild to fix problems with vendorarch/lib (#661697) * Sat May 01 2010 Marcela Maslanova - 1.00-5 - Mass rebuild with perl-5.12.0 * Mon Dec 7 2009 Stepan Kasal - 1.00-4 - Rebuild against perl 5.10.1 * Sat Jul 25 2009 Fedora Release Engineering - 1.00-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Thu Feb 26 2009 Fedora Release Engineering - 1.00-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Mon Jan 12 2009 Marcela Mašláňová 1.00-1 - Specfile autogenerated by cpanspec 1.77