# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify Alma, CentOS, CentOS Stream and Rocky Linux as rhel %if "%{__distinit}" == "a" || "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "cs" || "%{__distinit}" == "rl" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif # RPM version needs 4 digits after the decimal to preserve upgrade path %global module_version 0.71 %global RPM_version %(LANG=C printf "%.4f" %{module_version}) # TODO: BR: optional test dependency Unknown::Values if it becomes available Name: perl-Test-Differences Version: %{RPM_version} Release: 5.%{__distinit}%{__distvers} Summary: Test strings and data structures and show differences if not OK License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/Test-Differences Source0: https://cpan.metacpan.org/modules/by-module/Test/Test-Differences-%{module_version}.tar.gz BuildArch: noarch # Module Build BuildRequires: coreutils BuildRequires: findutils BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(ExtUtils::MakeMaker) # Module Runtime BuildRequires: perl(B::Deparse) BuildRequires: perl(Carp) BuildRequires: perl(Data::Dumper) >= 2.126 BuildRequires: perl(Exporter) BuildRequires: perl(strict) BuildRequires: perl(Text::Diff) >= 1.43 BuildRequires: perl(warnings) # Test Suite BuildRequires: perl(Capture::Tiny) >= 0.24 BuildRequires: perl(lib) BuildRequires: perl(Test::Builder) BuildRequires: perl(Test::More) >= 0.88 # Optional Tests BuildRequires: perl(Pod::Coverage) >= 0.18 BuildRequires: perl(Test::Pod) >= 1.22 BuildRequires: perl(Test::Pod::Coverage) >= 1.08 # Dependencies %if 0%{?fedora} < 38 && 0%{?rhel} < 10 Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %endif Requires: perl(B::Deparse) Requires: perl(Text::Diff) >= 1.43 %description When the code you're testing returns multiple lines, records or data structures and they're just plain wrong, an equivalent to the Unix diff utility may be just what's needed. %prep %setup -q -n Test-Differences-%{module_version} %build perl Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install make pure_install DESTDIR=%{buildroot} find %{buildroot} -type f -name .packlist -delete %{_fixperms} -c %{buildroot} %check make test %files %doc Changes README %{perl_vendorlib}/Test/ %{_mandir}/man3/Test::Differences.3* %changelog * Tue Aug 20 2024 Paul Howarth - 0.7100-5 - Fix version handling for build with different locales set * Fri Oct 13 2023 Paul Howarth - 0.7100-1 - Update to 0.71 - Stop pointless use of taint mode in tests, so tests pass when perl is built without taint support - Document and test different behaviour regarding Booleans in perl 5.38.0 compared to earlier versions (GH#21) * Mon May 15 2023 Paul Howarth - 0.6900-5 - Use SPDX-format license tag - Bump Data::Dumper version requirement to 2.126 as per upstream * Sat Jan 8 2022 Paul Howarth - 0.6900-1 - Update to 0.69 - Special-case Unknown::Values objects in comparisons, as it's better to spit out a diagnostic failure than to just die - Correct misleading Unicode doco * Wed May 19 2021 Paul Howarth - 0.6800-1 - Update to 0.68 - Revert undocumented change that was causing unreasonably verbose output (GH#5) - Improve documentation about text vs. data mode and eq_or_diff_{text,data} (GH#8) - Drop workaround for dependency generator in old versions of rpm * Thu Mar 7 2019 Paul Howarth - 0.6700-1 - Update to 0.67 - Correctly compare subroutine references * Thu Feb 28 2019 Paul Howarth - 0.6600-1 - Update to 0.66 - Fix tests on Windows * Wed Feb 20 2019 Paul Howarth - 0.6500-1 - Update to 0.65 - Canonical repo is now https://github.com/DrHyde/perl-modules-Test-Differences - Fix discrepancies in copyright notices - Make the tests more consistent - Add unicode tests - Fix whitespace issue in tests when using recent Test::More in verbose mode - Get rid of Build.PL, just use Makefile.PL - Switch upstream from search.cpan.org to metacpan.org * Tue Apr 10 2018 Paul Howarth - 0.6400-8 - BR: perl-generators unconditionally - BR: perl-interpreter rather than perl - Drop support for EOL distributions prior to F-13 - Drop BuildRoot: and Group: tags - Drop explicit buildroot cleaning in %%install section - Drop explicit %%clean section - Drop workarounds for building with old versions of Test::Builder and Test::More * Fri Sep 30 2016 Paul Howarth - 0.6400-4 - Fix FTBFS when perl is not in the minimal buildroot - BR: perl-generators where available - Simplify find command using -delete * Tue Nov 24 2015 Paul Howarth - 0.6400-1 - Update to 0.64 - Bump dependency version for Text::Diff to avoid a buggy release - Make tests pass with relocatable perl (CPAN RT#103133) - Update patches as needed * Tue Dec 9 2014 Paul Howarth - 0.6300-2 - Make sure dependencies are picked up on old distributions * Fri Nov 21 2014 Paul Howarth - 0.6300-1 - Update to 0.63 - Minor doco-fixes - Remove use of flatten, always use Data::Dumper for saner, more readable output (CPAN RT#95446) - Classify buildreqs by usage - Update patches as needed * Thu Jun 26 2014 Paul Howarth - 0.6200-1 - Update to 0.62 - Document the Text::Diff unicode fix - Add ability to customize 'Got' and 'Expected' column headers - This release by DCANTRELL → update source URL - Add patch to support building with Test::More < 0.88 - Add patch to support building with Test::Builder < 0.33 - Drop %%defattr, redundant since rpm 4.4 * Wed Jul 4 2012 Paul Howarth - 0.6100-3 - BR:/R: perl(Data::Dumper) - BR: perl(Carp), perl(constant) and perl(Exporter) - Don't need to remove empty directories from the buildroot - Drop support for old distributions prior to FC-3: - Don't need to define %%{perl_vendorlib} - Use DESTDIR rather than PERL_INSTALL_ROOT * Thu Jul 7 2011 Paul Howarth - 0.6100-2 - Rebuild for perl 5.14.1 in Rawhide - Fix dist tag for CentOS 6 and Scientific Linux * Mon Apr 18 2011 Paul Howarth - 0.6100-1 - Update to 0.61 - Make '' and undef not equal - Made Data::Dumper minimum version 2.126 to resolve CPAN RT#60798 - Allow an option to override Sortkeys in C - Unnumbered tests; there's no point to them - Nobody else likes macros for commands * Thu Jul 8 2010 Paul Howarth - 0.5000-2 - Add manual dependency on perl(Text::Diff) >= 0.35, not automatically detected * Tue Jun 29 2010 Paul Howarth - 0.5000-1 - Update to 0.500 - Add support for all diff styles supplied by Text::Diff (CPAN RT#23579) - Add Build.PL - Convert to universally use Test::More instead of Test - Convert to modern Perl distribution. - Applied doc suggestion from CPAN RT#24297 - Fix the { a => 1 } versus { a => '1' } bug (CPAN RT#3029) - Upstream dropped eg/ docs - Bump perl(Text::Diff) requirement to 0.35 - BR: perl(Test::Pod) and perl(Test::Pod::Coverage) for extra test cover * Mon Jun 28 2010 Paul Howarth - 0.4801-6 - Import from Fedora * Thu May 6 2010 Marcela Maslanova - 0.4801-5 - Mass rebuild with perl-5.12.0 * Fri Dec 4 2009 Stepan Kasal - 0.4801-4 - Rebuild against perl 5.10.1 * Wed Aug 19 2009 Tom "spot" Callaway - 0.4801-3 - Fix source url * Sun Jul 26 2009 Fedora Release Engineering - 0.4801-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Fri Mar 13 2009 Tom "spot" Callaway - 0.4801-1 - Update to 0.4801 * Thu Feb 26 2009 Fedora Release Engineering - 0.47-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Wed Feb 27 2008 Tom "spot" Callaway - 0.47-4 - Rebuild for perl 5.10 (again) * Thu Jan 24 2008 Tom "spot" Callaway - 0.47-3 - Rebuild for new perl * Tue Oct 16 2007 Tom "spot" Callaway - 0.47-2.2 - Add BR: perl(Test::More) * Tue Oct 16 2007 Tom "spot" Callaway - 0.47-2.1 - Correct license tag - Add BR: perl(ExtUtils::MakeMaker) * Sun May 14 2006 Jose Pedro Oliveira - 0.47-2 - Bumping release (repodata checksum inconsistency for previous release) * Mon May 1 2006 Jose Pedro Oliveira - 0.47-1 - First build