117 lines
3.7 KiB
RPMSpec
117 lines
3.7 KiB
RPMSpec
#
|
|
# spec file for package perl-Test-Nginx
|
|
#
|
|
# Copyright (c) 2024 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/
|
|
#
|
|
|
|
|
|
%define cpan_name Test-Nginx
|
|
Name: perl-Test-Nginx
|
|
Version: 0.300.0
|
|
Release: 0
|
|
# 0.30 -> normalize -> 0.300.0
|
|
%define cpan_version 0.30
|
|
License: BSD-3-Clause
|
|
Summary: Data-driven test scaffold for Nginx C module and Nginx/OpenResty-based l[cut]
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
|
Source0: https://cpan.metacpan.org/authors/id/A/AG/AGENT/%{cpan_name}-%{cpan_version}.tar.gz
|
|
Source1: cpanspec.yml
|
|
Source100: README.md
|
|
BuildArch: noarch
|
|
BuildRequires: perl
|
|
BuildRequires: perl-macros
|
|
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.59
|
|
BuildRequires: perl(HTTP::Response)
|
|
BuildRequires: perl(IPC::Run)
|
|
BuildRequires: perl(LWP::UserAgent)
|
|
BuildRequires: perl(List::MoreUtils)
|
|
BuildRequires: perl(Test::Base)
|
|
BuildRequires: perl(Test::LongString)
|
|
BuildRequires: perl(Text::Diff)
|
|
BuildRequires: perl(URI::Escape)
|
|
Requires: perl(HTTP::Response)
|
|
Requires: perl(IPC::Run)
|
|
Requires: perl(LWP::UserAgent)
|
|
Requires: perl(List::MoreUtils)
|
|
Requires: perl(Test::Base)
|
|
Requires: perl(Test::LongString)
|
|
Requires: perl(Text::Diff)
|
|
Requires: perl(URI::Escape)
|
|
Provides: perl(Test::Nginx) = %{version}
|
|
Provides: perl(Test::Nginx::LWP) = %{version}
|
|
Provides: perl(Test::Nginx::Socket) = %{version}
|
|
Provides: perl(Test::Nginx::Socket::Lua) = %{version}
|
|
Provides: perl(Test::Nginx::Socket::Lua::Dgram) = %{version}
|
|
Provides: perl(Test::Nginx::Socket::Lua::Stream) = %{version}
|
|
Provides: perl(Test::Nginx::Util) = %{version}
|
|
%undefine __perllib_provides
|
|
%{perl_requires}
|
|
# MANUAL BEGIN
|
|
BuildRequires: perl(Test2) > 1.302118
|
|
# MANUAL END
|
|
|
|
%description
|
|
This distribution provides two testing modules for Nginx C module
|
|
development:
|
|
|
|
* Test::Nginx::Socket (This is highly recommended.)
|
|
|
|
This library also has the following subclasses:
|
|
|
|
* Test::Nginx::Socket::Lua
|
|
|
|
* Test::Nginx::Socket::Lua::Stream
|
|
|
|
* Test::Nginx::Socket::Lua::Dgram
|
|
|
|
* Test::Nginx::LWP (This is obsolete.)
|
|
|
|
All of them are based on Test::Base.
|
|
|
|
Usually, Test::Nginx::Socket is preferred because it works on a much lower
|
|
level and not that fault tolerant like Test::Nginx::LWP.
|
|
|
|
Also, a lot of connection hang issues (like wrong 'r->main->count' value in
|
|
nginx 0.8.x) can only be captured by Test::Nginx::Socket because Perl's
|
|
LWP::UserAgent client will close the connection itself which will conceal
|
|
such issues from the testers.
|
|
|
|
Test::Nginx automatically starts an nginx instance (from the 'PATH' env)
|
|
rooted at t/servroot/ and the default config template makes this nginx
|
|
instance listen on the port '1984' by default. One can specify a different
|
|
port number by setting his port number to the 'TEST_NGINX_PORT'
|
|
environment, as in
|
|
|
|
export TEST_NGINX_PORT=1989
|
|
|
|
%prep
|
|
%autosetup -n %{cpan_name}-%{cpan_version}
|
|
|
|
%build
|
|
PERL_USE_UNSAFE_INC=1 perl Makefile.PL INSTALLDIRS=vendor
|
|
%make_build
|
|
|
|
%check
|
|
make test
|
|
|
|
%install
|
|
%perl_make_install
|
|
%perl_process_packlist
|
|
%perl_gen_filelist
|
|
|
|
%files -f %{name}.files
|
|
%doc Changes README.md
|
|
|
|
%changelog
|