perl-Devel-EnforceEncapsulation-vl.spec 3.3 KB

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