perl-Devel-EnforceEncapsulation-vl.spec 3.4 KB

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