]> git.pld-linux.org Git - packages/perl-Readonly-XS.git/blame - perl-Readonly-XS.spec
rebuild with perl 5.32
[packages/perl-Readonly-XS.git] / perl-Readonly-XS.spec
CommitLineData
88332fad
AG
1#
2# Conditional build:
3%bcond_without tests # do not perform "make test"
4#
5%define pdir Readonly
6%define pnam XS
88332fad
AG
7Summary: Readonly::XS - Companion module for Readonly.pm, to speed up read-only scalar variables
8Name: perl-Readonly-XS
9Version: 1.05
4738f59d 10Release: 13
88332fad
AG
11# same as perl
12License: GPL v1+ or Artistic
13Group: Development/Languages/Perl
14Source0: http://www.cpan.org/modules/by-module/Readonly/%{pdir}-%{pnam}-%{version}.tar.gz
15# Source0-md5: df71f29abfcbd14c963f912d6d6ded6b
16URL: http://search.cpan.org/dist/Readonly-XS/
17BuildRequires: perl-devel >= 1:5.8.0
18BuildRequires: rpm-perlprov >= 4.1-13
19%if %{with tests}
20BuildRequires: perl-Readonly >= 1.02
21%endif
22BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24%description
25The Readonly module (q.v.) is an effective way to create
26non-modifiable variables. However, it's relatively slow.
27
28The reason it's slow is that is implements the read-only-ness of
29variables via tied objects. This mechanism is inherently slow. Perl
30simply has to do a lot of work under the hood to make tied variables
31work.
32
33This module corrects the speed problem, at least with respect to
34scalar variables. When Readonly::XS is installed, Readonly uses it to
35access the internals of scalar variables. Instead of creating a scalar
36variable object and tying it, Readonly simply flips the SvREADONLY bit
37in the scalar's FLAGS structure.
38
39Readonly arrays and hashes are not sped up by this, since the
40SvREADONLY flag only works for scalars. Arrays and hashes always use
41the tie interface.
42
43Why implement this as a separate module? Because not everyone can use
44XS. Not everyone has a C compiler. Also, installations with a
45statically-linked perl may not want to recompile their perl binary
46just for this module. Rather than render Readonly.pm useless for these
47people, the XS portion was put into a separate module.
48
49%prep
50%setup -q -n %{pdir}-%{pnam}-%{version}
51
52%build
53%{__perl} Makefile.PL \
54 INSTALLDIRS=vendor
55%{__make} \
56 CC="%{__cc}" \
57 OPTIMIZE="%{rpmcflags}"
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
67%clean
68rm -rf $RPM_BUILD_ROOT
69
70%files
71%defattr(644,root,root,755)
72%doc Changes README
c3e64a53 73%dir %{perl_vendorarch}/Readonly/
88332fad 74%{perl_vendorarch}/Readonly/*.pm
c3e64a53 75%dir %{perl_vendorarch}/auto/Readonly
88332fad 76%dir %{perl_vendorarch}/auto/Readonly/XS
88332fad
AG
77%attr(755,root,root) %{perl_vendorarch}/auto/Readonly/XS/*.so
78%{_mandir}/man3/*
This page took 0.094352 seconds and 4 git commands to generate.