File perl-Net-LibAsyncNS.spec of Package perl-Net-LibAsyncNS

#
# spec file for package perl-Net-LibAsyncNS
#
# Copyright (c) 2020 SUSE LLC
#
# 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-Net-LibAsyncNS
Version:        0.04
Release:        0
%define cpan_name Net-LibAsyncNS
Summary:        Perl wrapper around F<libasyncns>
License:        Artistic-1.0 OR GPL-1.0-or-later
Group:          Development/Libraries/Perl
URL:            https://metacpan.org/release/%{cpan_name}
Source0:        https://cpan.metacpan.org/authors/id/P/PE/PEVANS/%{cpan_name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(ExtUtils::CBuilder)
BuildRequires:  perl(ExtUtils::CChecker) >= 0.05
BuildRequires:  perl(ExtUtils::PkgConfig)
BuildRequires:  perl(Module::Build) >= 0.400400
BuildRequires:  perl(Module::Build::Using::PkgConfig)
BuildRequires:  perl(Test::Identity)
BuildRequires:  perl(Test::More) >= 0.88
BuildRequires:  perl(Test::Refcount)
%{perl_requires}

%description
The name resolver functions 'getaddrinfo' and 'getnameinfo' as provided by
most C libraries are blocking functions; they will perform their work and
return an answer when it is ready. This makes it hard to use these name
resolvers in asynchronous or non-blocking code.

The _libasyncns_ library provides a way to invoke these library functions
from within an asynchronous or non-blocking program. Individual resolver
queries are made by calling a function which returns an object representing
an outstanding query (a kind of future). A filehandle is provided by the
resolver to watch for readability; when it is readable, a function should
be called to collect completed queries. The example in the SYNOPSIS above
does not demonstrate this; see the EXAMPLES section below for one that
does.

%prep
%setup -q -n %{cpan_name}-%{version}

%build
perl Build.PL installdirs=vendor optimize="%{optflags}"
./Build build flags=%{?_smp_mflags}

%check
./Build test

%install
./Build install destdir=%{buildroot} create_packlist=0
%perl_gen_filelist

%files -f %{name}.files
%defattr(-,root,root,755)
%doc Changes examples README
%license LICENSE

%changelog
openSUSE Build Service is sponsored by