LFS-RPM/SPECS/perl-Try-Tiny.spec

84 lines
2.4 KiB
RPMSpec
Raw Permalink Normal View History

2023-04-21 03:40:38 +08:00
%global cpanname Try-Tiny
Name: perl-%{cpanname}
Version: 0.31
2023-04-24 02:00:47 +08:00
Release: %{?repo}0.rc2%{?dist}
2023-04-21 03:40:38 +08:00
Summary: Minimal try/catch module
Group: Development/Libraries
License: MIT
URL: https://metacpan.org/pod/Try::Tiny
Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/%{cpanname}-%{version}.tar.gz
BuildArch: noarch
2023-04-24 02:00:47 +08:00
BuildRequires: perl-devel
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
2023-04-21 03:40:38 +08:00
# for test
2023-04-24 02:00:47 +08:00
%if 0%{?runtests:1} == 1
BuildRequires: perl(Test::More)
BuildRequires: perl(warnings)
2023-04-21 03:40:38 +08:00
BuildRequires: perl(Capture::Tiny)
BuildRequires: perl(File::Spec)
BuildRequires: perl(CPAN::Meta)
#BuildRequires: perl(CPAN::Meta::Check)
BuildRequires: perl(CPAN::Meta::Requirements)
2023-04-24 02:00:47 +08:00
%endif
%if 0%{?perl5_API:1} == 1
Requires: %{perl5_API}
%endif
2023-04-21 03:40:38 +08:00
%description
This module provides bare bones try/catch/finally statements that are
designed to minimize common mistakes with eval blocks, and NOTHING else.
This is unlike TryCatch which provides a nice syntax and avoids adding
another call stack layer, and supports calling return from the try block
to return from the parent subroutine. These extra features come at a
cost of a few dependencies, namely Devel::Declare and Scope::Upper which
are occasionally problematic, and the additional catch filtering uses
Moose type constraints which may not be desirable either.
The main focus of this module is to provide simple and reliable error
handling for those having a hard time installing TryCatch, but who still
want to write correct eval blocks without 5 lines of boilerplate each
time.
%prep
%setup -n %{cpanname}-%{version}
%build
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_OPT_FLAGS"
make %{?_smp_mflags}
%check
2023-04-24 02:00:47 +08:00
%if 0%{?runtests:1} == 1
2023-04-21 03:40:38 +08:00
make test > %{name}-make.test.log 2>&1
2023-04-24 02:00:47 +08:00
%else
echo "make test not run during package build." > %{name}-make.test.log
%endif
2023-04-21 03:40:38 +08:00
%install
make install DESTDIR=%{buildroot}
%files
%defattr(-,root,root,-)
%dir %{perl5_vendorlib}/Try
%attr(0444,root,root) %{perl5_vendorlib}/Try/Tiny.pm
%attr(0644,root,root) %{_mandir}/man3/Try::Tiny.3*
%license LICENCE
%doc LICENCE Changes
%doc %{name}-make.test.log
%changelog
2023-04-24 02:00:47 +08:00
* Sun Apr 23 2023 Michael A. Peters <anymouseprophet@gmail.com> - 0.31-0.rc2
- BuildRequire perl-devel
- Conditionally run tests
- Require %%perl5_API
2023-04-21 03:40:38 +08:00
* Thu Apr 20 2023 Michael A. Peters <anymouseprophet@gmail.com> - 0.31-0.rc1
- Initial spec file for YJL (RPM bootstrapping LFS/BLFS 11.3)