Files
perl-Class-ErrorHandler/perl-Class-ErrorHandler.spec

76 lines
2.7 KiB
RPMSpec

%define perl_major_ver %(eval `perl -V:version`; echo ${version%*.[0-9]*}.0)
Name: perl-Class-ErrorHandler
Version: 0.04
Release: 2mamba
Summary: Class::ErrorHandler - Base class for error handling
Group: System/Libraries/Perl
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan@openmamba.org>
URL: https://www.cpan.org/
Source: https://cpan.metacpan.org/modules/by-module/Class/Class-ErrorHandler-%{version}.tar.gz
License: Artistic, GPL
BuildArch: noarch
## AUTOBUILDREQ-BEGIN
BuildRequires: perl-devel
## AUTOBUILDREQ-END
BuildRequires: perl-Module-Build
Requires: perl >= %perl_major_ver
%description
Class::ErrorHandler provides an error-handling mechanism that's generic enough to be used as the base class for a variety of OO classes.
Subclasses inherit its two error-handling methods, error and errstr, to communicate error messages back to the calling program.
On failure (for whatever reason), a subclass should call error and return to the caller; error itself sets the error message internally, then returns undef.
This has the effect of the method that failed returning undef to the caller.
The caller should check for errors by checking for a return value of undef, and calling errstr to get the value of the error message on an error.
%prep
%setup -q -n Class-ErrorHandler-%{version}
%build
%{__perl} Makefile.PL PREFIX=%{_prefix} INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
%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 -f $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)
%changelog
* Sat Mar 21 2026 Automatic Build System <autodist@openmamba.org> 0.04-2mamba
- automatic rebuild by autodist
* Sun May 16 2021 Automatic Build System <autodist@mambasoft.it> 0.04-1mamba
- automatic version update by autodist
* Sun Dec 15 2013 Automatic Build System <autodist@mambasoft.it> 0.03-1mamba
- automatic update by autodist
* Tue Apr 30 2013 Automatic Build System <autodist@mambasoft.it> 0.02-1mamba
- automatic version update by autodist
* Tue Nov 04 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 0.01-2mamba
- automatic rebuild by autodist
* Wed Aug 29 2007 Stefano Cotta Ramusino <stefano.cotta@openmamba.org> 0.01-1mamba
- package created by autospec