]> git.pld-linux.org Git - packages/perl-Lexical-Persistence.git/blame - perl-Lexical-Persistence.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/perl-Lexical-Persistence.git] / perl-Lexical-Persistence.spec
CommitLineData
560582e4
JR
1#
2# Conditional build:
3%bcond_without tests # do not perform "make test"
4#
5%define pdir Lexical
6%define pnam Persistence
560582e4
JR
7Summary: Lexical::Persistence - Persistent lexical variable values for arbitrary calls.
8Name: perl-Lexical-Persistence
9Version: 1.020
10Release: 1
11License: GPL v1+ or Artistic
12Group: Development/Languages/Perl
13Source0: http://www.cpan.org/modules/by-module/Lexical/%{pdir}-%{pnam}-%{version}.tar.gz
14# Source0-md5: 22fc0a2486c6746bdd1a635f42889809
15URL: http://search.cpan.org/dist/Lexical-Persistence/
16BuildRequires: perl-devel >= 1:5.8.0
17BuildRequires: rpm-perlprov >= 4.1-13
18%if %{with tests}
19BuildRequires: perl-Devel-LexAlias >= 0.04
20BuildRequires: perl-PadWalker >= 1.1
21%endif
22BuildArch: noarch
23BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25%description
26Lexical::Persistence does a few things, all related. Note that all
27the behaviors listed here are the defaults. Subclasses can override
28nearly every aspect of Lexical::Persistence's behavior.
29
30Lexical::Persistence lets your code access persistent data through
31lexical variables. This example prints "some value" because the value
32of $x perists in the $lp object between setter() and getter().
33
34 use Lexical::Persistence;
35
36 my $lp = Lexical::Persistence->new();
37 $lp->call(\&setter);
38 $lp->call(\&getter);
39
40 sub setter { my $x = "some value" }
41 sub getter { print my $x, "\n" }
42
43Lexicals with leading underscores are not persistent.
44
45By default, Lexical::Persistence supports accessing data from multiple
46sources through the use of variable prefixes. The set_context()
47member sets each data source. It takes a prefix name and a hash of
48key/value pairs. By default, the keys must have sigils representing
49their variable types.
50
51%prep
52%setup -q -n %{pdir}-%{pnam}-%{version}
53
54%build
55%{__perl} Makefile.PL \
56 INSTALLDIRS=vendor
57%{__make}
58
59%{?with_tests:%{__make} test}
60
61%install
62rm -rf $RPM_BUILD_ROOT
63
64%{__make} pure_install \
65 DESTDIR=$RPM_BUILD_ROOT
66
67install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
68cp -a eg $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
69
70%clean
71rm -rf $RPM_BUILD_ROOT
72
73%files
74%defattr(644,root,root,755)
75%doc CHANGES README
76%dir %{perl_vendorlib}/Lexical
77%{perl_vendorlib}/Lexical/*.pm
78%{_mandir}/man3/*
79%{_examplesdir}/%{name}-%{version}
This page took 0.087942 seconds and 4 git commands to generate.