diff --git a/.rpmlint b/.rpmlint new file mode 100644 index 0000000..9572e48 --- /dev/null +++ b/.rpmlint @@ -0,0 +1,6 @@ +from Config import * + +addFilter("spelling-error Summary\(en_US\) suppressions -> ") +addFilter("spelling-error %description -l en_US memcheck -> ") +addFilter("spelling-error %description -l en_US suppressions -> ") + diff --git a/perl-Test-Valgrind.spec b/perl-Test-Valgrind.spec index bf4c840..13479e5 100644 --- a/perl-Test-Valgrind.spec +++ b/perl-Test-Valgrind.spec @@ -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 Summary: Generate suppressions, analyze and test any command with valgrind Version: 1.19 -Release: 5%{?dist} -Group: Development/Libraries +Release: 6%{?dist} License: GPL+ or Artistic URL: http://search.cpan.org/dist/Test-Valgrind/ Source0: http://search.cpan.org/CPAN/authors/id/V/VP/VPIT/Test-Valgrind-%{version}.tar.gz +%if !%{with debug_valgrind} BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) +%endif # Module Build BuildRequires: coreutils BuildRequires: findutils BuildRequires: gcc BuildRequires: make -BuildRequires: perl-interpreter BuildRequires: perl-devel BuildRequires: perl-generators -BuildRequires: perl(ExtUtils::Install) +BuildRequires: perl-interpreter +BuildRequires: perl(ExtUtils::Install) >= 1.38 BuildRequires: perl(ExtUtils::MakeMaker) # Module Runtime BuildRequires: perl(base) @@ -30,7 +36,7 @@ BuildRequires: perl(Fcntl) BuildRequires: perl(File::HomeDir) >= 0.86 BuildRequires: perl(File::Path) BuildRequires: perl(File::Spec) -BuildRequires: perl(File::Temp) >= 0.14 +BuildRequires: perl(File::Temp) >= 0.19 BuildRequires: perl(Filter::Util::Call) BuildRequires: perl(IO::Select) BuildRequires: perl(List::Util) @@ -45,7 +51,6 @@ BuildRequires: perl(XML::Twig) BuildRequires: perl(XML::Twig::Elt) BuildRequires: valgrind >= 3.1.0 # Test Suite -BuildRequires: perl(File::Temp) >= 0.19 BuildRequires: perl(lib) BuildRequires: perl(Test::More) BuildRequires: perl(Time::HiRes) @@ -86,19 +91,26 @@ example HTML pages) by defining your own Test::Valgrind::Action class. %prep %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 +%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 perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" make %{?_smp_mflags} %install -rm -rf %{buildroot} make pure_install DESTDIR=%{buildroot} find %{buildroot} -type f -name .packlist -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 # not part of the module itself @@ -107,18 +119,13 @@ if [ "%{perl_vendorarch}" != "%{perl_vendorlib}" ]; then mv %{buildroot}%{perl_vendorarch}/* %{buildroot}%{perl_vendorlib}/ 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 +%if %{with debug_valgrind} +# Pick up our local valgrind script +PATH=$(pwd)/bin:$PATH +%endif make test -%clean -rm -rf %{buildroot} - %files %doc Changes README samples/ %{perl_vendorlib}/Test/ @@ -147,6 +154,16 @@ rm -rf %{buildroot} %{_mandir}/man3/Test::Valgrind::Version.3* %changelog +* Tue Feb 13 2018 Paul Howarth - 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 - 1.19-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild