source: projects/specs/trunk/p/perl-Devel-EnforceEncapsulation/perl-Devel-EnforceEncapsulation-vl.spec @ 5798

Revision 5798, 3.3 KB checked in by shaolin, 12 years ago (diff)
  • rebuild
Line 
1Name:           perl-Devel-EnforceEncapsulation
2Version:        0.50
3Release:        2%{?_dist_release}
4Summary:        Find access violations to blessed objects
5Group:          Development/Libraries
6License:        GPL+ or Artistic
7URL:            http://search.cpan.org/dist/Devel-EnforceEncapsulation/
8Source0:        http://search.cpan.org/CPAN/authors/id/C/CL/CLOTHO/Devel-EnforceEncapsulation-%{version}.tgz
9BuildArch:      noarch
10BuildRequires:  perl(Carp)
11BuildRequires:  perl(English)
12BuildRequires:  perl(ExtUtils::MakeMaker)
13BuildRequires:  perl(Test::More)
14BuildRequires:  perl(Test::Pod)
15BuildRequires:  perl(Test::Pod::Coverage)
16Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
17
18Vendor:         Project Vine
19Distribution:   Vine Linux
20Packager:       shaolin
21
22%description
23Encapsulation is the practice of creating subroutines to access the properties
24of a class instead of accessing those properties directly. The advantage of
25good encapsulation is that the author is permitted to change the internal
26implementation of a class without breaking its usage.
27
28Object-oriented programming in Perl is most commonly implemented via blessed
29hashes. This practice makes it easy for users of a class to violate
30encapsulation by simply accessing the hash values directly. Although less
31common, the same applies to classes implemented via blessed arrays, scalars,
32filehandles, etc.
33
34This module is a hack to block those direct accesses. If you try to access a
35hash value of an object from its own class, or a superclass or subclass, all
36goes well. If you try to access a hash value from any other package, an
37exception is thrown. The same applies to the scalar value of a blessed scalar,
38entry in a blessed array, etc.
39
40To be clear: this class is NOT intended for strict enforcement of
41encapsulation. If you want bullet-proof encapsulation, use inside-out objects
42or the like. Instead, this module is intended to be a development or debugging
43aid in catching places where direct access is used against classes implemented
44as blessed hashes.
45
46To repeat: the encapsulation enforced here is a hack and is easily
47circumvented. Please use this module for good (finding bugs), not evil (making
48life harder for downstream developers).
49
50%prep
51%setup -q -n Devel-EnforceEncapsulation-%{version}
52
53%build
54perl Makefile.PL INSTALLDIRS=vendor
55make %{?_smp_mflags}
56
57%install
58make pure_install DESTDIR=%{buildroot}
59find %{buildroot} -type f -name .packlist -exec rm -f {} \;
60find %{buildroot} -depth -type d -exec rmdir {} \; 2>/dev/null
61%{_fixperms} %{buildroot}
62
63%check
64make test AUTHOR_TEST=1 AUTHOR_TEST_CDOLAN=1
65
66%files
67%defattr(-,root,root,-)
68%doc CHANGES LICENSE README index.html
69%{perl_vendorlib}/Devel/
70%{_mandir}/man3/Devel::EnforceEncapsulation.3pm*
71
72%changelog
73* Thu Mar 02 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.50-2
74- rebuild
75
76* Fri Feb 24 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.50-1
77- initial build for Vine Linux
78
79* Wed Jan 11 2012 Paul Howarth <paul@city-fan.org> - 0.50-5
80- BR: perl(Carp) and perl(English)
81
82* Mon Jun 20 2011 Marcela Mašláňová <mmaslano@redhat.com> - 0.50-4
83- Perl mass rebuild
84
85* Mon Apr 11 2011 Paul Howarth <paul@city-fan.org> - 0.50-3
86- Clean up for modern rpmbuild
87
88* Mon Apr 11 2011 Paul Howarth <paul@city-fan.org> - 0.50-2
89- Nobody else likes macros for commands
90
91* Fri Mar 18 2011 Paul Howarth <paul@city-fan.org> - 0.50-1
92- Initial RPM version
Note: See TracBrowser for help on using the repository browser.