@ -1,22 +1,28 @@
# Build --with debug_valgrind for multi-arch build and additional valgrind debugging
%bcond_with debug_valgrind
# A noarch-turned-arch package should not have debuginfo
%global debug_package %{nil}
Name: perl-Test-Valgrind
Name: perl-Test-Valgrind
Summary: Generate suppressions, analyze and test any command with valgrind
Summary: Generate suppressions, analyze and test any command with valgrind
Version: 1.19
Version: 1.19
Release: 5%{?dist}
Release: 6%{?dist}
Group: Development/Libraries
License: GPL+ or Artistic
License: GPL+ or Artistic
URL: http://search.cpan.org/dist/Test-Valgrind/
URL: http://search.cpan.org/dist/Test-Valgrind/
Source0: http://search.cpan.org/CPAN/authors/id/V/VP/VPIT/Test-Valgrind-%{version}.tar.gz
Source0: http://search.cpan.org/CPAN/authors/id/V/VP/VPIT/Test-Valgrind-%{version}.tar.gz
%if !%{with debug_valgrind}
BuildArch: noarch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
%endif
# Module Build
# Module Build
BuildRequires: coreutils
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: findutils
BuildRequires: gcc
BuildRequires: gcc
BuildRequires: make
BuildRequires: make
BuildRequires: perl-interpreter
BuildRequires: perl-devel
BuildRequires: perl-devel
BuildRequires: perl-generators
BuildRequires: perl-generators
BuildRequires: perl(ExtUtils::Install)
BuildRequires: perl-interpreter
BuildRequires: perl(ExtUtils::Install) >= 1.38
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(ExtUtils::MakeMaker)
# Module Runtime
# Module Runtime
BuildRequires: perl(base)
BuildRequires: perl(base)
@ -30,7 +36,7 @@ BuildRequires: perl(Fcntl)
BuildRequires: perl(File::HomeDir) >= 0.86
BuildRequires: perl(File::HomeDir) >= 0.86
BuildRequires: perl(File::Path)
BuildRequires: perl(File::Path)
BuildRequires: perl(File::Spec)
BuildRequires: perl(File::Spec)
BuildRequires: perl(File::Temp) >= 0.14
BuildRequires: perl(File::Temp) >= 0.19
BuildRequires: perl(Filter::Util::Call)
BuildRequires: perl(Filter::Util::Call)
BuildRequires: perl(IO::Select)
BuildRequires: perl(IO::Select)
BuildRequires: perl(List::Util)
BuildRequires: perl(List::Util)
@ -45,7 +51,6 @@ BuildRequires: perl(XML::Twig)
BuildRequires: perl(XML::Twig::Elt)
BuildRequires: perl(XML::Twig::Elt)
BuildRequires: valgrind >= 3.1.0
BuildRequires: valgrind >= 3.1.0
# Test Suite
# Test Suite
BuildRequires: perl(File::Temp) >= 0.19
BuildRequires: perl(lib)
BuildRequires: perl(lib)
BuildRequires: perl(Test::More)
BuildRequires: perl(Test::More)
BuildRequires: perl(Time::HiRes)
BuildRequires: perl(Time::HiRes)
@ -86,19 +91,26 @@ example HTML pages) by defining your own Test::Valgrind::Action class.
%prep
%prep
%setup -q -n Test-Valgrind-%{version}
%setup -q -n Test-Valgrind-%{version}
# Avoid doc-file deps
# Avoid doc-file deps and fix shellbangs
sed -i -e 's|^#!/usr/bin/env perl|#!/usr/bin/perl|' samples/map.pl
chmod -c -x samples/map.pl
chmod -c -x samples/map.pl
%if %{with debug_valgrind}
# Create a local valgrind with --track-origins=yes
mkdir bin
echo '/usr/bin/valgrind --track-origins=yes "$@"' > bin/valgrind
chmod 755 bin/valgrind
%endif
%build
%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
make %{?_smp_mflags}
make %{?_smp_mflags}
%install
%install
rm -rf %{buildroot}
make pure_install DESTDIR=%{buildroot}
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -delete
find %{buildroot} -type f -name .packlist -delete
find %{buildroot} -type f -name '*.bs' -empty -delete
find %{buildroot} -type f -name '*.bs' -empty -delete
%{_fixperms} %{buildroot}
%{_fixperms} -c %{buildroot}
# The package is noarch; the XS code included is for testing purposes and is
# The package is noarch; the XS code included is for testing purposes and is
# not part of the module itself
# not part of the module itself
@ -107,18 +119,13 @@ if [ "%{perl_vendorarch}" != "%{perl_vendorlib}" ]; then
mv %{buildroot}%{perl_vendorarch}/* %{buildroot}%{perl_vendorlib}/
mv %{buildroot}%{perl_vendorarch}/* %{buildroot}%{perl_vendorlib}/
fi
fi
# If we have ExtUtils::Install < 1.3702, INSTALL.SKIP will be ignored
# and valgrind.so will have been installed, so remove it
if perl -MExtUtils::Install -e 'exit (($ExtUtils::Install::VERSION < 1.3702) ? 0 : 1);'; then
rm %{buildroot}%{perl_vendorlib}/auto/Test/Valgrind/Valgrind.so
fi
%check
%check
%if %{with debug_valgrind}
# Pick up our local valgrind script
PATH=$(pwd)/bin:$PATH
%endif
make test
make test
%clean
rm -rf %{buildroot}
%files
%files
%doc Changes README samples/
%doc Changes README samples/
%{perl_vendorlib}/Test/
%{perl_vendorlib}/Test/
@ -147,6 +154,16 @@ rm -rf %{buildroot}
%{_mandir}/man3/Test::Valgrind::Version.3*
%{_mandir}/man3/Test::Valgrind::Version.3*
%changelog
%changelog
* Tue Feb 13 2018 Paul Howarth <paul@city-fan.org> - 1.19-6
- Add build option --with debug_valgrind
- Fix shellbang in samples/map.pl
- Drop EL-5 support
- Drop legacy BuildRoot: and Group: tags
- Drop explicit buildroot cleaning in %%install section
- Drop explicit %%clean section
- Drop support for building with File::Temp < 0.19 and
ExtUtils::Install < 1.3702
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.19-5
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.19-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild