]>
Commit | Line | Data |
---|---|---|
1b3c7fc1 | 1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | # | |
5 | %include /usr/lib/rpm/macros.perl | |
6 | %define pdir Try | |
7 | %define pnam Tiny | |
8 | Summary: Try::Tiny - minimal try/catch with proper localization of $@ | |
9 | Summary(pl.UTF-8): Try::Tiny - minimaly try/catch z odpowiednią lokalizacją $@ | |
10 | Name: perl-Try-Tiny | |
cde1e910 | 11 | Version: 0.30 |
f7e2ad20 | 12 | Release: 1 |
cde1e910 | 13 | License: MIT |
1b3c7fc1 | 14 | Group: Development/Languages/Perl |
734d46d9 | 15 | Source0: http://www.cpan.org/modules/by-authors/id/E/ET/ETHER/Try-Tiny-%{version}.tar.gz |
cde1e910 | 16 | # Source0-md5: eb362c3cb32c42f9f28de9ddb7f2ead6 |
1b3c7fc1 | 17 | URL: http://search.cpan.org/dist/Try-Tiny/ |
0aca0ac8 | 18 | BuildRequires: perl-ExtUtils-MakeMaker >= 6.30 |
1b3c7fc1 | 19 | BuildRequires: perl-devel >= 1:5.8.0 |
20 | BuildRequires: rpm-perlprov >= 4.1-13 | |
21 | BuildArch: noarch | |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
23 | ||
24 | %description | |
25 | This module provides bare bones try/catch statements that are designed | |
26 | to minimize common mistakes with eval blocks, and NOTHING else. | |
27 | ||
28 | This is unlike TryCatch which provides a nice syntax and avoids adding | |
29 | another call stack layer, and supports calling return from the try | |
30 | block to return from the parent subroutine. These extra features come | |
31 | at a cost of a few dependencies, namely Devel::Declare and | |
32 | Scope::Upper which are occasionally problematic, and the additional | |
33 | catch filtering uses Moose type constraints which may not be desirable | |
34 | either. | |
35 | ||
36 | The main focus of this module is to provide simple and reliable error | |
37 | handling for those having a hard time installing TryCatch, but who | |
38 | still want to write correct eval blocks without 5 lines of boilerplate | |
39 | each time. | |
40 | ||
01905611 JB |
41 | %description -l pl.UTF-8 |
42 | Ten moduł udostępnia proste instrukcje try/catch zaprojektowane w | |
43 | celu ograniczenia popularnych błędów w blokach eval - i NIC więcej, | |
44 | w przeciwieństwie do TryCatch, który udostępnia ładną składnię oraz | |
45 | zapobiega dodawaniu kolejnej warstwy stosu wywołań i obsługuje powrót | |
46 | z bloku try do procedury wywołującej. Te dodatkowe możliwości są | |
47 | okupione kilkoma zależnościami (Devel::Declare i Scope::Upper), które | |
48 | bywają problematyczne, a dodatkowe filtrowanie catch wykorzystuje | |
49 | ograniczenia typu Moose, które mogą być niepożądane. | |
1b3c7fc1 | 50 | |
01905611 JB |
51 | Głównym celem tego modułu jest udostępnienie prostej i wiarygodnej |
52 | obsługi błędów dla zmęczonych instalowaniem TryCatch, ale nadal | |
53 | chcących pisać proste bloki eval bez każdorazowych 5 nadmiarowych | |
54 | linii. | |
1b3c7fc1 | 55 | |
56 | %prep | |
57 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
58 | ||
59 | %build | |
60 | %{__perl} Makefile.PL \ | |
61 | INSTALLDIRS=vendor | |
62 | %{__make} | |
63 | ||
64 | %{?with_tests:%{__make} test} | |
65 | ||
66 | %install | |
67 | rm -rf $RPM_BUILD_ROOT | |
68 | ||
69 | %{__make} pure_install \ | |
70 | DESTDIR=$RPM_BUILD_ROOT | |
71 | ||
72 | %clean | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %files | |
76 | %defattr(644,root,root,755) | |
cde1e910 | 77 | %doc Changes LICENCE |
6df5e55d | 78 | %dir %{perl_vendorlib}/Try |
01905611 JB |
79 | %{perl_vendorlib}/Try/Tiny.pm |
80 | %{_mandir}/man3/Try::Tiny.3pm* |