SPECS: perl-UNIVERSAL-can.spec (NEW), perl-UNIVERSAL-isa.spec (NEW...

migo migo at pld-linux.org
Mon Nov 7 15:19:43 CET 2005


Author: migo                         Date: Mon Nov  7 14:19:43 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- initial revision

---- Files affected:
SPECS:
   perl-UNIVERSAL-can.spec (NONE -> 1.1)  (NEW), perl-UNIVERSAL-isa.spec (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SPECS/perl-UNIVERSAL-can.spec
diff -u /dev/null SPECS/perl-UNIVERSAL-can.spec:1.1
--- /dev/null	Mon Nov  7 15:19:43 2005
+++ SPECS/perl-UNIVERSAL-can.spec	Mon Nov  7 15:19:38 2005
@@ -0,0 +1,86 @@
+# $Revision$, $Date$
+#
+# Conditional build:
+%bcond_without	tests		# do not perform "make test"
+#
+%include	/usr/lib/rpm/macros.perl
+%define	pdir	UNIVERSAL
+%define	pnam	can
+Summary:	UNIVERSAL::can - Hack around people calling UNIVERSAL::can() as a function
+#Summary(pl):	
+Name:		perl-UNIVERSAL-can
+Version:	1.00
+Release:	1
+# same as perl
+License:	GPL v1+ or Artistic
+Group:		Development/Languages/Perl
+Source0:	http://www.cpan.org/modules/by-module/%{pdir}/%{pdir}-%{pnam}-%{version}.tar.gz
+# Source0-md5:	40cea820351a759f293af68115452ef7
+BuildRequires:	perl-devel >= 1:5.8.0
+BuildRequires:	rpm-perlprov >= 4.1-13
+%if %{with tests}
+BuildRequires:	perl-Test-Simple >= 0.60
+BuildRequires:	perl-Test-Warn >= 0.08
+BuildRequires:	perl-Tree-DAG_Node
+%endif
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+The UNIVERSAL class provides a few default methods so that all objects can use
+them.  Object orientation allows programmers to override these methods in
+subclasses to provide more specific and appropriate behavior.
+
+Some authors call methods in the UNIVERSAL class on potential invocants as
+functions, bypassing any possible overriding.  This is wrong and you should not
+do it.  Unfortunately, not everyone heeds this warning and their bad code can
+break your good code.
+
+Fortunately, this module replaces UNIVERSAL::can() with a method that checks
+to see if the first argument is a valid invocant (whether an object -- a
+blessed referent -- or the name of a class).  If so, and if the invocant's
+class has its own can() method, it calls that as a method.  Otherwise,
+everything works as you might expect.
+
+If someone attempts to call UNIVERSAL::can() as a function, this module will
+emit a lexical warning (see perllexwarn) to that effect.  You can disable it
+with no warnings; or no warnings 'UNIVERSAL::isa';, but don't do that;
+fix the code instead.
+
+# %description -l pl
+# TODO
+
+%prep
+%setup -q -n %{pdir}-%{pnam}-%{version}
+
+%build
+%{__perl} Build.PL \
+	destdir=$RPM_BUILD_ROOT \
+	installdirs=vendor
+./Build
+
+%{?with_tests:./Build test}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+./Build install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc Changes README
+%{perl_vendorlib}/UNIVERSAL/*.pm
+%{_mandir}/man3/*
+
+%define	date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1  2005/11/07 14:19:38  migo
+- initial revision
+

================================================================
Index: SPECS/perl-UNIVERSAL-isa.spec
diff -u /dev/null SPECS/perl-UNIVERSAL-isa.spec:1.1
--- /dev/null	Mon Nov  7 15:19:43 2005
+++ SPECS/perl-UNIVERSAL-isa.spec	Mon Nov  7 15:19:38 2005
@@ -0,0 +1,71 @@
+# $Revision$, $Date$
+#
+# Conditional build:
+%bcond_without	tests		# do not perform "make test"
+#
+%include	/usr/lib/rpm/macros.perl
+%define	pdir	UNIVERSAL
+%define	pnam	isa
+Summary:	UNIVERSAL::isa - Hack around module authors using UNIVERSAL::isa as a function
+#Summary(pl):	
+Name:		perl-UNIVERSAL-isa
+Version:	0.05
+Release:	1
+# same as perl
+License:	GPL v1+ or Artistic
+Group:		Development/Languages/Perl
+Source0:	http://www.cpan.org/modules/by-module/%{pdir}/%{pdir}-%{pnam}-%{version}.tar.gz
+# Source0-md5:	3c259166aceda31d2ab93ad20271562e
+BuildRequires:	perl-devel >= 1:5.8.0
+BuildRequires:	rpm-perlprov >= 4.1-13
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Whenever you use UNIVERSAL/isa as a function, a kitten using
+Test::MockObject dies. Normally, the kittens would be helpless, but if they
+use UNIVERSAL::isa (the module whose docs you are reading), the kittens can
+live long and prosper.
+
+This module replaces UNIVERSAL::isa with a version that makes sure that if
+it's called as a function on objects which override isa, isa will be
+called on those objects as a method.
+
+In all other cases the real UNIVERSAL::isa is just called directly.
+
+# %description -l pl
+# TODO
+
+%prep
+%setup -q -n %{pdir}-%{pnam}-%{version}
+
+%build
+%{__perl} Build.PL \
+	destdir=$RPM_BUILD_ROOT \
+	installdirs=vendor
+./Build
+
+%{?with_tests:./Build test}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+./Build install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%{perl_vendorlib}/UNIVERSAL/*.pm
+%{_mandir}/man3/*
+
+%define	date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1  2005/11/07 14:19:38  migo
+- initial revision
+
================================================================



More information about the pld-cvs-commit mailing list