%bcond_with test

%define pkgname FCGI

Name:           perl-FCGI
Summary:        FCGI - Perl module
Version:        0.82
Release:        1%{_dist_release}
Group:          programming
Vendor:         Project Vine
Distribution:   Vine Linux

License:        Artistic
URL:            https://metacpan.org/pod/FCGI
Source:         https://cpan.metacpan.org/authors/id/E/ET/ETHER/FCGI-%{version}.tar.gz
# Fix CVE-2012-6687 in the bundled fcgi library, bug #1190294, CPAN RT#118405,
# patch copied from Debian's libfcgi-perl.
Patch0:         FCGI-0.78-CVE-2012-6687.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}

Requires:       perl >= 2:5.34.0
%if %{with test}
BuildRequires:  perl(FCGI::Client)
%endif

%{?perl_default_filter}

%description
This is a FastCGI module for perl.


%debug_package


%prep
%setup -q -n %{pkgname}-%{version} 
%patch0 -p1
find . -type f -exec chmod -c -x {} +


%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" NO_PACKLIST=1 \
                 NO_PERLLOCAL=1
%make_build


%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
%make_install
%{_fixperms} %{buildroot}/*


%check
%if %{with test}
make test
%endif


%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}


%files
%license LICENSE
%doc ChangeLog README
%{perl_vendorarch}/*
%exclude %dir %{perl_vendorarch}/auto
%{_mandir}/man3/*.3*


%changelog
* Sat Nov 20 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.82-1
- new upstream release.
- built with perl-5.34.0.

* Sun May 19 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.78-1
- new upstream release.
- rebuilt with perl-5.26.

* Tue Jul 1 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.74-2
- rebuilt with perl-5.16.3.

* Sat Nov 23 2013 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.74-1
- new upstream release.

* Sat Apr 30 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.67-4
- rebuild with perl-5.12.3

* Sat Jan 17 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.67-3
- changed Group to Development/Libraries

* Wed Apr 30 2008 Tomohiro 'Tomo-p' KATO <tomop@teamgedoh.net> 0.67-2
- rebuilt with perl-5.10.0.

* Sun Apr 27 2008 Tomohiro 'Tomo-p' KATO <tomop@teamgedoh.net> 0.67-1
- initial build.
