Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:languages:perl:CPAN-P
perl-Perinci-Declare
perl-Perinci-Declare.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File perl-Perinci-Declare.spec of Package perl-Perinci-Declare
# # spec file for package perl-Perinci-Declare # # 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-Perinci-Declare Version: 0.01 Release: 0 %define cpan_name Perinci-Declare Summary: Some easy shortcuts for Perinci License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Perinci-Declare/ Source0: http://www.cpan.org/authors/id/P/PE/PERLANCAR/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros %{perl_requires} %description NOT YET IMPLEMENTED. EXPERIMENTAL, SYNTAX *WILL* CHANGE. This module is an experiment to provide some syntactic sugar for declaring the Rinci manpage metadata to your code entities. As we know, Rinci metadata is put in '%SPEC' package variables: package YourPackage; our %SPEC: $SPEC{':package'} = { summary => 'THis package is for doing blah', description => 'Blah blah ...', }; $SPEC{sub1} = { v => 1.1, summary => "This function is for doing blah", description => 'blah blah ...', args => { arg1 => { schema => 'int*', req => 1, pos => 0 }, arg2 => { schema => [array => of => 'str'] }, }, args_as => "array", result_naked => 1, }; sub sub1 { my ($arg1, $arg2) = @_; ... } $SPEC{sub2} = { ... }: sub sub2 { ... } ... 1; This module tries to provide some syntactic sugar. How does it work? Using the Devel::Declare manpage, it will change the meta(): sub sub1 { meta { ... }; } to run in BEGIN block (much like how the Begin::Declare manpage works). meta() will check its caller, if it is inside a sub, it will set subroutine metadata. Otherwise, it will set package metadata. The other types of metadata will be supported in the future. This will not add overhead during runtime, as the BEGIN block will no longer be evaluated. %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 Changes LICENSE README %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor