%global _empty_manifest_terminate_build 0
Name:           perl-Event
Version:        1.28
Release:        2
Summary:        Event loop processing
License:        GPL-1.0-only or Artistic-1.0-Perl
Group:          Development/Libraries
URL:            http://search.cpan.org/dist/Event/
Source0:        http://www.cpan.org/authors/id/E/ET/ETJ/Event-%{version}.tar.gz
BuildRequires:  perl >= 0:5.008000
BuildRequires:  perl-devel
BuildRequires:  perl-generators
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl(Test) >= 1
%description
This extension aims to provide an simple and optimized event loop for a
broad class of application.
%package help
Summary : Event loop processing
Provides: perl-Event-doc
%description help
This extension aims to provide an simple and optimized event loop for a
broad class of application.This package provides help docs for perl-Event.
%prep
%setup -q -n Event-%{version}
%build
export PERL_MM_OPT=""
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
%{__perl} -pi -e 's/^\tLD_RUN_PATH=[^\s]+\s*/\t/' Makefile
make %{?_smp_mflags}

%install
export PERL_MM_OPT=""
rm -rf $RPM_BUILD_ROOT

make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT

find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -exec rm -f {} \;
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;

%{_fixperms} $RPM_BUILD_ROOT/*

pushd %{buildroot}
touch filelist.lst
if [ -d usr/bin ];then
    find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ];then
    find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ];then
    find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib ];then
    find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
popd
mv %{buildroot}/filelist.lst .
%check || :
make test

%clean
rm -rf $RPM_BUILD_ROOT

%files -f filelist.lst
%defattr(-,root,root,-)
%doc ANNOUNCE Changes META.json README README.EV TODO Tutorial.pdf Tutorial.pdf-errata.txt
%{perl_vendorarch}/auto/*
%{perl_vendorarch}/Event*
%files help
%{_mandir}/*

%changelog
* Wed Feb 15 2023 lichaoran <pkwarcraft@hotmail.com> 1.28-2
- add perl-devel as BuildRequires

* Sun May 23 2021 Perl_Bot <Perl_Bot@openeuler.org> 1.28-1
- Specfile autogenerated by Perl_Bot