perl-File-pushd/perl-File-pushd.spec

82 lines
3.0 KiB
RPMSpec

%define perl_major_ver %(eval `perl -V:version`; echo ${version%*.[0-9]*}.0)
Name: perl-File-pushd
Version: 1.009
Release: 1mamba
Summary: File::pushd - change directory temporarily for a limited scope
Group: System/Libraries/Perl
Vendor: openmamba
Distribution: openmamba
Packager: Automatic Build System <autodist@mambasoft.it>
URL: http://www.cpan.org
Source: http://search.cpan.org/CPAN/authors/id/D/DA/DAGOLDEN/File-pushd-%{version}.tar.gz
License: GPL, Artistic
BuildRequires: perl(Module::Build)
BuildRequires: perl(Test::More)
BuildRequires: perl-devel
Requires: perl >= %perl_major_ver
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%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.
This is very handy when working with temporary directories for tasks like testing; a function is provided to streamline getting a temporary directory from File::Temp.
For convenience, the object stringifies as the canonical form of the absolute pathname of the directory entered.
%prep
%setup -q -n File-pushd-%{version}
%build
perl Makefile.PL PREFIX=%{_prefix} INSTALLDIRS=vendor
%make
%make test
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall_perl
packlist=`find %{buildroot} -name .packlist`
[ -z "$packlist" ] && exit 1 || cat $packlist | \
sed "s,%buildroot,,g;s,.*/man/.*,&.gz,g" | \
sort -u > .packlist && rm $packlist
strid=`echo $packlist | sed 's,.*auto\(.*\)/.packlist,\1,'`
for dir in `find %{buildroot} -type d | grep $strid`; do
echo "%dir ${dir#%buildroot}" >> .packlist
done
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files -f .packlist
%defattr(-,root,root)
%doc LICENSE
#Changes README Todo
%changelog
* Fri Jul 18 2014 Automatic Build System <autodist@mambasoft.it> 1.009-1mamba
- automatic update by autodist
* Wed Jun 25 2014 Automatic Build System <autodist@mambasoft.it> 1.007-1mamba
- automatic update by autodist
* Wed Apr 02 2014 Automatic Build System <autodist@mambasoft.it> 1.006-1mamba
- automatic update by autodist
* Mon Apr 01 2013 Automatic Build System <autodist@mambasoft.it> 1.005-1mamba
- automatic version update by autodist
* Mon Mar 11 2013 Automatic Build System <autodist@mambasoft.it> 1.004-1mamba
- automatic version update by autodist
* Wed Nov 28 2012 Automatic Build System <autodist@mambasoft.it> 1.003-1mamba
- automatic version update by autodist
* Mon Nov 12 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 1.002-2mamba
- perl 5.16 mass rebuild
* Sat Jun 16 2012 Automatic Build System <autodist@mambasoft.it> 1.002-1mamba
- automatic version update by autodist
* Sun Feb 20 2011 gil <puntogil@libero.it> 1.00-1mamba
- package created by autospec