%global _empty_manifest_terminate_build 0
Name:           perl-Proc-ProcessTable
Version:        0.637
Release:        1
Summary:        Perl extension to access the unix process table
License:        Artistic 2.0
Group:          Development/Libraries
URL:            http://search.cpan.org/dist/Proc-ProcessTable/
Source0:        http://www.cpan.org/authors/id/J/JW/JWB/Proc-ProcessTable-%{version}.tar.gz
BuildRequires:  perl >= 0:5.006
BuildRequires:  perl-generators
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl(File::Find)
BuildRequires:  perl(Storable)
BuildRequires:  perl(Test::More)
BuildRequires:  perl-devel

Requires:       perl(File::Find)
Requires:       perl(Storable)
%description
Perl interface to the unix process table.
%package help
Summary : Perl extension to access the unix process table
Provides: perl-Proc-ProcessTable-doc
%description help
Perl interface to the unix process table.
%prep
%setup -q -n Proc-ProcessTable-%{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 Changes META.json README README.aix README.bsdi README.cygwin README.darwin README.dec_osf README.freebsd-kvm README.freebsd-procfs README.hpux README.linux README.md README.MSWin32 README.netbsd README.openbsd README.solaris README.sunos README.unixware
%{perl_vendorarch}/auto/*
%{perl_vendorarch}/Proc*
%files help
%{_mandir}/*

%changelog
* Tue Aug 05 2025  openeuler_bot <infra@openeuler.sh> - 0.637-1
- Fixed failing build on illumos with GCC 14+ (version:0.637).

* Mon Apr 01 2024 wangshuo <wangshuo@kylinos.cn> - 0.636-1
- Upgrade to version 0.636

* Fri Dec 15 2023 ChenYanpan <chenyanpan@xfusion.com> - 0.59-2
- Add BuildRequires perl-devel, for fixing build failed

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