forked from pool/perl-asa
Compare commits
10 Commits
81f9fc5357
...
4a8c40d9c6
Author | SHA256 | Date | |
---|---|---|---|
4a8c40d9c6 | |||
1d8f9f5eb5 | |||
f3a1e78000 | |||
0bbaaab63a | |||
a301787a44 | |||
|
fb22306a0d | ||
|
b358e88907 | ||
|
1ce05e0fd3 | ||
|
ccb39c4a65 | ||
|
c4c2a3bf70 |
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c8af36d2238c636ba987766ab3cf0303d45779d66f9f59c614eed20f0f9751c1
|
||||
size 21482
|
3
asa-1.04.tar.gz
Normal file
3
asa-1.04.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e5833b74e733baee19d1ef5e04b1263c1cff9c1746995ad72fc40918f440675e
|
||||
size 27573
|
28
cpanspec.yml
Normal file
28
cpanspec.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
#description_paragraphs: 3
|
||||
#description: |-
|
||||
# override description from CPAN
|
||||
#summary: override summary from CPAN
|
||||
#no_testing: broken upstream
|
||||
#sources:
|
||||
# - source1
|
||||
# - source2
|
||||
#patches:
|
||||
# foo.patch: -p1
|
||||
# bar.patch:
|
||||
#preamble: |-
|
||||
# BuildRequires: gcc-c++
|
||||
#post_prep: |-
|
||||
# hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'`
|
||||
# sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL
|
||||
#post_build: |-
|
||||
# rm unused.files
|
||||
#post_install: |-
|
||||
# sed on %{name}.files
|
||||
#license: SUSE-NonFree
|
||||
#skip_noarch: 1
|
||||
#custom_build: |-
|
||||
#./Build build flags=%{?_smp_mflags} --myflag
|
||||
#custom_test: |-
|
||||
#startserver && make test
|
||||
#ignore_requires: Bizarre::Module
|
@@ -1,3 +1,37 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 31 05:35:13 UTC 2019 - Stephan Kulow <coolo@suse.com>
|
||||
|
||||
- updated to 1.04
|
||||
see /usr/share/doc/packages/perl-asa/Changes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 16 11:39:28 UTC 2017 - ncutler@suse.com
|
||||
|
||||
- spec file
|
||||
+ add "BuildRequires: perl-Module-Install" to fix perl 5.26 build
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 13 18:35:42 UTC 2015 - coolo@suse.com
|
||||
|
||||
- updated to 1.03
|
||||
see /usr/share/doc/packages/perl-asa/Changes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 13 18:35:41 UTC 2015 - coolo@suse.com
|
||||
|
||||
- updated to 1.03
|
||||
see /usr/share/doc/packages/perl-asa/Changes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 30 19:19:50 UTC 2010 - coolo@novell.com
|
||||
|
||||
- switch to perl_requires macro
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 29 18:29:21 UTC 2010 - coolo@novell.com
|
||||
|
||||
- remove /var/adm/perl-modules
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 5 09:36:04 UTC 2010 - pascal.bleser@opensuse.org
|
||||
|
||||
|
122
perl-asa.spec
122
perl-asa.spec
@@ -1,60 +1,104 @@
|
||||
# vim: set sw=4 ts=4 et nu:
|
||||
# norootforbuild
|
||||
#
|
||||
# spec file for package perl-asa
|
||||
#
|
||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: perl-asa
|
||||
Version: 0.02
|
||||
Version: 1.04
|
||||
Release: 0
|
||||
%define cpan_name asa
|
||||
Summary: Lets your class/object say it works like something else
|
||||
Source: http://search.cpan.org/CPAN/authors/id/A/AD/ADAMK/asa-%{version}.tar.gz
|
||||
URL: http://search.cpan.org/dist/asa
|
||||
License: Artistic-1.0 OR GPL-1.0-or-later
|
||||
Group: Development/Libraries/Perl
|
||||
License: Perl License
|
||||
BuildRoot: %{_tmppath}/build-%{name}-%{version}
|
||||
Requires: perl = %{perl_version}
|
||||
Url: https://metacpan.org/release/%{cpan_name}
|
||||
Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/%{cpan_name}-%{version}.tar.gz
|
||||
Source1: cpanspec.yml
|
||||
BuildArch: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: perl
|
||||
BuildRequires: make
|
||||
BuildRequires: perl(Test::More) >= 0.47
|
||||
BuildRequires: perl(File::Spec) >= 0.80
|
||||
BuildRequires: perl(ExtUtils::MakeMaker)
|
||||
BuildRequires: perl(base)
|
||||
BuildRequires: perl(Carp)
|
||||
Requires: perl(base)
|
||||
Requires: perl(Carp)
|
||||
BuildRequires: perl-macros
|
||||
%{perl_requires}
|
||||
|
||||
%description
|
||||
Perl 5 doesn't natively support Java-style interfaces, and it doesn't
|
||||
support Perl 6 style roles either.
|
||||
You can get both of these things in half a dozen different ways via
|
||||
various CPAN modules, but they usually require that you buy into "their
|
||||
way" of implementing your code.
|
||||
|
||||
You can get both of these things in half a dozen different ways via various
|
||||
CPAN modules, but they usually require that you buy into "their way" of
|
||||
implementing your code.
|
||||
|
||||
Other have turned to "duck typing".
|
||||
This is, for the most part, a fairly naive check that says "can you do
|
||||
this method", under the "if it looks like a duck, and quacks like a duck,
|
||||
then it must be a duck".
|
||||
|
||||
This is, for the most part, a fairly naive check that says "can you do this
|
||||
method", under the "if it looks like a duck, and quacks like a duck, then
|
||||
it must be a duck".
|
||||
|
||||
It assumes that if you have a '->quack' method, then they will treat you as
|
||||
a duck, because doing things like adding 'Duck' to your '@ISA' array means
|
||||
you are also forced to take their implementation.
|
||||
|
||||
There is, of course, a better way.
|
||||
|
||||
For better or worse, Perl's '->isa' functionality to determine if something
|
||||
is or is not a particular class/object is defined as a *method*, not a
|
||||
function, and so that means that as well as adding something to you '@ISA'
|
||||
array, so that Perl's 'UNIVERSAL::isa' method can work with it, you are
|
||||
also allowed to simply overload your own 'isa' method and answer directly
|
||||
whether or not you are something.
|
||||
|
||||
The simplest form of the idiom looks like this.
|
||||
|
||||
sub isa {
|
||||
return 1 if $_[1] eq 'Duck';
|
||||
shift->SUPER::isa(@_);
|
||||
}
|
||||
|
||||
This reads "Check my type as normal, but if anyone wants to know if I'm a
|
||||
duck, then tell them yes".
|
||||
|
||||
Now, there are a few people that have argued that this is "lying" about
|
||||
your class, but this argument is based on the idea that '@ISA' is somehow
|
||||
more "real" than using the method directly.
|
||||
|
||||
It also assumes that what you advertise you implement needs to be in sync
|
||||
with the method resolution for any given function. But in the best and
|
||||
cleanest implementation of code, the API is orthogonal (although most often
|
||||
related) to the implementation.
|
||||
|
||||
And although '@ISA' is about implementation *and* API, overloading 'isa' to
|
||||
let you change your API is not at all bad when seen in this light.
|
||||
|
||||
%prep
|
||||
%setup -q -n "asa-%{version}"
|
||||
%__sed -i '/^auto_install/d' Makefile.PL
|
||||
%setup -q -n %{cpan_name}-%{version}
|
||||
|
||||
%build
|
||||
%__perl Makefile.PL PREFIX="%{_prefix}"
|
||||
%__make %{?jobs:-j%{jobs}}
|
||||
perl Makefile.PL INSTALLDIRS=vendor
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%check
|
||||
make test
|
||||
|
||||
%install
|
||||
%perl_make_install
|
||||
%perl_process_packlist
|
||||
%perl_gen_filelist
|
||||
|
||||
%check
|
||||
%__make test
|
||||
|
||||
%clean
|
||||
%{?buildroot:%__rm -rf "%{buildroot}"}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc Changes README
|
||||
%{perl_vendorlib}/asa.pm
|
||||
%{perl_vendorarch}/auto/asa
|
||||
%doc %{perl_man3dir}/asa.%{perl_man3ext}%{ext_man}
|
||||
/var/adm/perl-modules/%{name}
|
||||
%files -f %{name}.files
|
||||
%defattr(-,root,root,755)
|
||||
%doc Changes CONTRIBUTING README
|
||||
%license LICENSE
|
||||
|
||||
%changelog
|
||||
|
Reference in New Issue
Block a user