From 1b21c35da979b851488c64d63cae2b3b38342df5 Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Mon, 18 Dec 2023 13:08:41 +0100 Subject: [PATCH] Resolves: RHEL-19314 --- .fmf/version | 1 + .gitignore | 1 + gating.yaml | 7 +++++ perl-DateTime-TimeZone.spec | 52 ++++++++++++++++++++++++++++++++++--- plans/sanity.fmf | 5 ++++ sources | 4 +-- tests/upstream-tests.fmf | 8 ++++++ 7 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 .fmf/version create mode 100644 gating.yaml create mode 100644 plans/sanity.fmf create mode 100644 tests/upstream-tests.fmf diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index c3fa07e..d71d96f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /tzdata2020d.tar.gz /tzdata2020e.tar.gz /tzdata2021a.tar.gz +/tzdata2023c.tar.gz diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..b9d19a4 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,7 @@ +--- !Policy +product_versions: + - rhel-* +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} diff --git a/perl-DateTime-TimeZone.spec b/perl-DateTime-TimeZone.spec index 48c5ba9..a072c99 100644 --- a/perl-DateTime-TimeZone.spec +++ b/perl-DateTime-TimeZone.spec @@ -1,12 +1,16 @@ # Run optional test +%if ! (0%{?rhel}) %bcond_without perl_DateTime_TimeZone_enables_optional_test +%else +%bcond_with perl_DateTime_TimeZone_enables_optional_test +%endif # Regenerate Perl library code from upstream Olson database of this date -%global tzversion 2021a +%global tzversion 2023c Name: perl-DateTime-TimeZone -Version: 2.47 -Release: 3%{?dist} +Version: 2.60 +Release: 1%{?dist} Summary: Time zone object base class and factory # tzdata%%{tzversion}.tar.gz archive: Public Domain # other files: GPL+ or Artistic @@ -27,6 +31,7 @@ BuildRequires: coreutils BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter +BuildRequires: perl(Config) BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 BuildRequires: perl(strict) BuildRequires: perl(warnings) @@ -109,17 +114,40 @@ Provides: bundled(tzdata) %global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(DateTime::Duration\\) %endif +# Filter modules bundled for tests +%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir} +%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(T::RequireDateTime\\) + %description This class is the base class for all time zone objects. A time zone is represented internally as a set of observances, each of which describes the offset from GMT for a given time period. +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: perl-Test-Harness +%if %{with perl_DateTime_TimeZone_enables_optional_test} +Requires: perl(Test::Output) +Requires: perl(Test::Taint) +%endif + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + %prep %if !%{defined perl_bootstrap} && %{defined tzversion} %setup -q -T -a 1 -c -n tzdata-%{tzversion} %endif %setup -q -T -b 0 -n DateTime-TimeZone-%{version} -%patch0 -p1 +%patch -P0 -p1 + +# Help generators to recognize Perl scripts +for F in t/*.t t/*.pl; do + perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F" + chmod +x "$F" +done %build %if !%{defined perl_bootstrap} && %{defined tzversion} @@ -134,7 +162,17 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 %{make_install} %{_fixperms} %{buildroot}/* +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a t %{buildroot}%{_libexecdir}/%{name} +cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' +#!/bin/sh +cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)" +EOF +chmod +x %{buildroot}%{_libexecdir}/%{name}/test + %check +export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}') make test %files @@ -143,7 +181,13 @@ make test %{perl_vendorlib}/* %{_mandir}/man3/* +%files tests +%{_libexecdir}/%{name} + %changelog +* Wed Dec 13 2023 Jitka Plesnikova - 2.60-1 +- 2.60 bump (2023c Olson database) + * Mon Aug 09 2021 Mohan Boddu - 2.47-3 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags Related: rhbz#1991688 diff --git a/plans/sanity.fmf b/plans/sanity.fmf new file mode 100644 index 0000000..a72ded4 --- /dev/null +++ b/plans/sanity.fmf @@ -0,0 +1,5 @@ +summary: Sanity tests +discover: + how: fmf +execute: + how: tmt diff --git a/sources b/sources index b32e823..178cb0d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (DateTime-TimeZone-2.47.tar.gz) = 483c5314fa520c1597ad9c819b6785302cc77d719e4042babe6a35e72e7600e9b9d506950979d4051825588ad45efb0a2023bc08340e6fbb308f03706f3438bf -SHA512 (tzdata2021a.tar.gz) = 7cdd762ec90ce12a30fa36b1d66d1ea82d9fa21e514e2b9c7fcbe2541514ee0fadf30843ff352c65512fb270857b51d1517b45e1232b89c6f954ba9ff1833bb3 +SHA512 (DateTime-TimeZone-2.60.tar.gz) = c3fc0dbed3aaa8250f8031de4fc2e9201d1229c42d59dd6fcdbded0bcc51184bf126a090e371dd4997133a3c174b6324115ce78e7725917953b7236e4a0a8526 +SHA512 (tzdata2023c.tar.gz) = 608bd286ebcbd0004cfdc1da183273f08aff61f90c8867661154453d77a05d421e4c46ad6d066a1fe2e87d5c82ec0f1c0224667a3b35f3180a3eb7f6ff84cbf5 diff --git a/tests/upstream-tests.fmf b/tests/upstream-tests.fmf new file mode 100644 index 0000000..a4b060a --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,8 @@ +summary: Upstream tests +component: perl-DateTime-TimeZone +require: perl-DateTime-TimeZone-tests +test: /usr/libexec/perl-DateTime-TimeZone/test +tag: + - Tier1 + - rhel-buildroot +tier: '1'