initial package
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Object-Import?expand=0&rev=1
This commit is contained in:
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
## Default LFS
|
||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.osc
|
3
Object-Import-1.004.tar.gz
Normal file
3
Object-Import-1.004.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:5601d802521a092d536456dd77eda6afce261a3930f5ccb841dd362ffc64f35b
|
||||||
|
size 33251
|
6
perl-Object-Import.changes
Normal file
6
perl-Object-Import.changes
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Feb 13 20:03:47 UTC 2015 - coolo@suse.com
|
||||||
|
|
||||||
|
- initial package 1.004
|
||||||
|
* created by cpanspec 1.78.08
|
||||||
|
|
105
perl-Object-Import.spec
Normal file
105
perl-Object-Import.spec
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
#
|
||||||
|
# spec file for package perl-Object-Import
|
||||||
|
#
|
||||||
|
# Copyright (c) 2015 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 http://bugs.opensuse.org/
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
Name: perl-Object-Import
|
||||||
|
Version: 1.004
|
||||||
|
Release: 0
|
||||||
|
%define cpan_name Object-Import
|
||||||
|
Summary: import methods of an object as functions to a package
|
||||||
|
License: CHECK(GPL-1.0+ or Artistic-1.0)
|
||||||
|
Group: Development/Libraries/Perl
|
||||||
|
Url: http://search.cpan.org/dist/Object-Import/
|
||||||
|
Source: http://www.cpan.org/authors/id/A/AM/AMBRUS/%{cpan_name}-%{version}.tar.gz
|
||||||
|
BuildArch: noarch
|
||||||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
BuildRequires: perl
|
||||||
|
BuildRequires: perl-macros
|
||||||
|
BuildRequires: perl(MRO::Compat)
|
||||||
|
Requires: perl(MRO::Compat)
|
||||||
|
%{perl_requires}
|
||||||
|
|
||||||
|
%description
|
||||||
|
This module lets you call methods of a certain object more easily by
|
||||||
|
exporting them as functions to a package. The exported functions are not
|
||||||
|
called as methods and do not receive an object argument, but instead the
|
||||||
|
object is fixed at the time you import them with this module.
|
||||||
|
|
||||||
|
You use the module with the following syntax:
|
||||||
|
|
||||||
|
use Object::Import $object, %options;
|
||||||
|
|
||||||
|
Here, '$object' is the object from which you want to import the methods.
|
||||||
|
This can be a perl object (blessed reference), or the name of a package
|
||||||
|
that has class methods.
|
||||||
|
|
||||||
|
As usual, a 'use' statement is executed in compile time, so you should take
|
||||||
|
care not to use values that you compute only in run-time, eg.
|
||||||
|
|
||||||
|
my $object = Foo::Bar->new();
|
||||||
|
use Object::Import $object; # WRONG: $object is not yet initialized
|
||||||
|
|
||||||
|
Instead, you have to create the object before you import, such as
|
||||||
|
|
||||||
|
use Object::Import Foo::Bar->new();
|
||||||
|
|
||||||
|
You can also call import in run-time, eg.
|
||||||
|
|
||||||
|
use Object::Import ();
|
||||||
|
my $object = Foo::Bar->new();
|
||||||
|
import Object::Import $object;
|
||||||
|
|
||||||
|
but in that case, you can't call the imported functions without
|
||||||
|
parenthesis.
|
||||||
|
|
||||||
|
If you don't give an explicit list of methods to export, Object::Import
|
||||||
|
tries to find out what callable methods the object has and import all of
|
||||||
|
them. Some methods are excluded from exporting in this case, namely any
|
||||||
|
methods where exporting would overwrite a function existing in the target
|
||||||
|
package or would override a builtin function, also any methods with names
|
||||||
|
that are special to perl, such as 'DESTROY', and any methods whose name
|
||||||
|
starts with an underscore. This automatic search for methods is quite
|
||||||
|
fragile because of the way perl OO works, so it can find subroutines that
|
||||||
|
shouldn't actually be called as methods, or not find methods that can
|
||||||
|
actually be called. In particular, even if you import an object from a
|
||||||
|
purely object oriented module, it can find non-method subs imported from
|
||||||
|
other (non-OO) modules.
|
||||||
|
|
||||||
|
If you do give a list of methods to export, Object::Import trusts you know
|
||||||
|
what you mean, so it exports all those subs even if it has to replace
|
||||||
|
existing subs or break something else.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n %{cpan_name}-%{version}
|
||||||
|
|
||||||
|
%build
|
||||||
|
%{__perl} Makefile.PL INSTALLDIRS=vendor
|
||||||
|
%{__make} %{?_smp_mflags}
|
||||||
|
|
||||||
|
%check
|
||||||
|
%{__make} test
|
||||||
|
|
||||||
|
%install
|
||||||
|
%perl_make_install
|
||||||
|
%perl_process_packlist
|
||||||
|
%perl_gen_filelist
|
||||||
|
|
||||||
|
%files -f %{name}.files
|
||||||
|
%defattr(-,root,root,755)
|
||||||
|
%doc ARTISTIC CHANGES GPL README TODO
|
||||||
|
|
||||||
|
%changelog
|
Reference in New Issue
Block a user