diff --git a/perl-RPC-XML.spec b/perl-RPC-XML.spec index b64bc81..c4b5374 100644 --- a/perl-RPC-XML.spec +++ b/perl-RPC-XML.spec @@ -1,3 +1,8 @@ +# Support for mod_perl +%bcond_without perl_RPC_XML_enables_mod_perl +# Run optional tests +%bcond_without perl_RPC_XML_enables_optional_test + %global cpan_name RPC-XML Name: perl-%{cpan_name} @@ -44,12 +49,13 @@ BuildRequires: perl(vars) BuildRequires: perl(warnings) BuildRequires: perl(XML::LibXML) >= 1.85 BuildRequires: perl(XML::Parser) >= 2.31 +%if %{with perl_RPC_XML_enables_mod_perl} # Run-time for Apache stuff: BuildRequires: perl(Apache) BuildRequires: perl(Apache::Constants) BuildRequires: perl(Apache::File) BuildRequires: perl(CGI) -BuildRequires: perl(Socket) +%endif # Recommended run-time: # Keep Compress::Zlib optional BuildRequires: perl(DateTime) >= 0.70 @@ -62,11 +68,14 @@ BuildRequires: perl(IO::Socket) BuildRequires: perl(IO::Socket::IP) BuildRequires: perl(List::Util) BuildRequires: perl(LWP) >= 5.834 +BuildRequires: perl(Socket) BuildRequires: perl(Symbol) BuildRequires: perl(Test::More) >= 0.94 +%if %{with perl_RPC_XML_enables_optional_test} # Optional tests: BuildRequires: perl(Compress::Zlib) BuildRequires: perl(Net::Server) +%endif Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) Requires: perl(constant) >= 1.03 Requires: perl(File::Spec) >= 0.8 @@ -92,6 +101,7 @@ Apache location-handler, and a suite of data-manipulation classes that are used by them. +%if %{with perl_RPC_XML_enables_mod_perl} %package -n perl-Apache-RPC Summary: Companion packages for RPC::XML tuned for mod_perl environments Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) @@ -100,6 +110,7 @@ Requires: perl(File::Spec) >= 0.8 %description -n perl-Apache-RPC This package contains Apache::RPC::Server and Apache::RPC::Status, useful for running RPC::XML under mod_perl. +%endif %prep @@ -107,6 +118,10 @@ running RPC::XML under mod_perl. %patch0 -p1 %patch1 -p1 cp -p %{SOURCE1} . +%if !%{with perl_RPC_XML_enables_mod_perl} +rm -rf lib/Apache +perl -i -ln -e 'print unless qr{^lib/Apache/}' MANIFEST +%endif %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 @@ -127,11 +142,13 @@ make test %{_bindir}/make_method %{perl_vendorlib}/RPC +%if %{with perl_RPC_XML_enables_mod_perl} %files -n perl-Apache-RPC %license README.license %doc README.apache2 %{_mandir}/man3/Apache* %{perl_vendorlib}/Apache +%endif %changelog * Mon Mar 04 2019 Petr Pisar - 0.80-12