diff --git a/perl-LDAP.spec b/perl-LDAP.spec index f0d89bf..8b9e623 100644 --- a/perl-LDAP.spec +++ b/perl-LDAP.spec @@ -9,7 +9,7 @@ Name: perl-LDAP Version: 0.66 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 1 Summary: LDAP Perl module License: GPL+ or Artistic @@ -108,6 +108,55 @@ writes DSML entry and schema entities. Reading DSML entities is a future project. %endif +%package tests +Summary: Tests for %{name} +Requires: coreutils +Requires: perl-LDAP = %{?epoch:%{epoch}:}%{version}-%{release} +# perl-Test-Harness for "prove" command +Requires: perl-Test-Harness +Requires: perl(Convert::ASN1) >= 0.2 +Requires: perl(File::Basename) +Requires: perl(File::Compare) +Requires: perl(File::Path) +Requires: perl(File::Spec) +Requires: perl(IO::File) +Requires: perl(Net::LDAP) +Requires: perl(Net::LDAP::ASN) +Requires: perl(Net::LDAP::Constant) +Requires: perl(Net::LDAP::Control::Assertion) +Requires: perl(Net::LDAP::Control::ManageDsaIT) +Requires: perl(Net::LDAP::Control::MatchedValues) +Requires: perl(Net::LDAP::Control::PostRead) +Requires: perl(Net::LDAP::Control::PreRead) +Requires: perl(Net::LDAP::Control::ProxyAuth) +Requires: perl(Net::LDAP::Control::Sort) +Requires: perl(Net::LDAP::Entry) +Requires: perl(Net::LDAP::Extension::Cancel) +Requires: perl(Net::LDAP::Filter) +Requires: perl(Net::LDAP::FilterMatch) +Requires: perl(Net::LDAP::LDIF) +Requires: perl(Net::LDAP::Schema) +Requires: perl(Net::LDAP::Util) +Requires: perl(Net::LDAPI) +Requires: perl(Test::More) +# Prefer core Text::Soundex +Requires: perl(Text::Soundex) +%if %{with perl_LDAP_enables_xml} +Requires: perl(Net::LDAP::DSML) +Requires: perl(XML::SAX::Base) +Requires: perl(XML::SAX::Writer) +%endif +%if %{with perl_LDAP_enables_optional_test} +# Optional tests: +Requires: openldap-servers +Requires: perl(IO::Socket::SSL) >= 1.26 +Requires: perl(Net::LDAPS) +Requires: perl(LWP::UserAgent) +%endif + +%description tests +Tests from %{name}-%{version}. Execute them with "%{_libexecdir}/%{name}/test". + %prep %setup -q -n perl-ldap-%{version} @@ -118,6 +167,11 @@ perl -pi -e 's|^#!/usr/local/bin/perl\b|#!%{__perl}|' contrib/* # Remove bundled libraries rm -rf inc sed -i -e '/^inc\// d' MANIFEST +# Remove tests specific for XML support if the support is disabled +%if !%{with perl_LDAP_enables_xml} +rm t/05dsml.t +sed -i -e '/^t\/05dsml\.t/ d' MANIFEST +%endif find -type f -exec chmod -x {} + %build @@ -127,6 +181,22 @@ make %{?_smp_mflags} %install make pure_install DESTDIR=%{buildroot} find %{buildroot} -type f -name .packlist -delete +mkdir -p %{buildroot}/%{_libexecdir}/%{name} +# FIXME: Generators should scan these non-executable files +cp -a data t test.cfg %{buildroot}/%{_libexecdir}/%{name} +cat > %{buildroot}/%{_libexecdir}/%{name}/test < - 1:0.66-5 +- Package tests + * Fri Jul 26 2019 Fedora Release Engineering - 1:0.66-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild