]>
Commit | Line | Data |
---|---|---|
372afb6d | 1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
491ff6a9 | 4 | |
68327dcd | 5 | %define pdir Data |
6 | %define pnam Denter | |
491ff6a9 | 7 | %include /usr/lib/rpm/macros.perl |
8e5d6fb3 | 8 | Summary: Data::Denter - an (deprecated) alternative to Data::Dumper and Storable |
96067c2a | 9 | Summary(pl.UTF-8): Data::Denter - (porzucona) alternatywa dla Data::Dumper i Storable |
372afb6d | 10 | Name: perl-Data-Denter |
11 | Version: 0.15 | |
d61bcea4 | 12 | Release: 2 |
372afb6d | 13 | # same as perl |
14 | License: GPL v1+ or Artistic | |
15 | Group: Development/Languages/Perl | |
16 | Source0: http://www.cpan.org/modules/by-module/%{pdir}/%{pdir}-%{pnam}-%{version}.tar.gz | |
17 | # Source0-md5: 819e5c05fb61e90f4c1311286b080405 | |
491ff6a9 | 18 | URL: http://search.cpan.org/dist/Data-Denter/ |
1266bbb2 | 19 | BuildRequires: perl-devel >= 1:5.8.0 |
372afb6d | 20 | BuildRequires: rpm-perlprov >= 4.1-13 |
21 | %if %{with tests} | |
e2fde207 | 22 | # for perldiag.pod; should it be moved to perl-base? |
372afb6d | 23 | BuildRequires: perl-YAML |
491ff6a9 | 24 | BuildRequires: perl-perldoc |
372afb6d | 25 | %endif |
26 | BuildArch: noarch | |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %description | |
30 | The main problem with Data::Dumper (one of my all-time favorite | |
1266bbb2 JB |
31 | modules) is that you have to use eval() to deserialize the data you've |
32 | dumped. This is great if you can trust the data you're evaling, but | |
33 | horrible if you can't. A good alternative is Storable.pm. It can | |
372afb6d | 34 | safely thaw your frozen data. But if you want to read/edit the frozen |
35 | data, you're out of luck, because Storable uses a binary format. Even | |
1266bbb2 JB |
36 | Data::Dumper's output can be a little cumbersome for larger data |
37 | objects. | |
372afb6d | 38 | |
2cebab58 JR |
39 | %description -l pl.UTF-8 |
40 | Głównym problemem klasy Data::Dumper (jednego z ulubionych modułów | |
41 | autora) jest to, że trzeba używać eval() aby dokonać deserializacji | |
42 | zrzuconych danych. Jest to wspaniałe, jeśli można zaufać danym, ale | |
43 | przerażające, jeśli nie możemy. Dobrą alternatywą jest moduł | |
44 | Storable.pm. Może on bezpiecznie roztopić zamrożone dane. Ale kiedy | |
45 | chcemy odczytać/zmodyfikować zamrożone dane, nie mamy szczęścia, | |
46 | ponieważ Storable używa binarnego formatu. Nawet format wyjścia modułu | |
47 | Data::Dumper może by nieco niewygodny dla większych obiektów danych. | |
372afb6d | 48 | |
49 | %prep | |
50 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
51 | ||
52 | %build | |
53 | %{__perl} Makefile.PL \ | |
54 | INSTALLDIRS=vendor | |
55 | %{__make} | |
56 | ||
57 | %{?with_tests:%{__make} test} | |
58 | ||
59 | %install | |
60 | rm -rf $RPM_BUILD_ROOT | |
61 | ||
62 | %{__make} install \ | |
63 | DESTDIR=$RPM_BUILD_ROOT | |
64 | ||
65 | %clean | |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | ||
68 | %files | |
69 | %defattr(644,root,root,755) | |
70 | %doc Changes README | |
1266bbb2 | 71 | %{perl_vendorlib}/Data/*.pm |
372afb6d | 72 | %{_mandir}/man3/* |