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 662d305..2c7fb65 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /Perl-Tidy-Sweetened-1.16.tar.gz /Perl-Tidy-Sweetened-1.17.tar.gz /Perl-Tidy-Sweetened-1.18.tar.gz +/Perl-Tidy-Sweetened-1.19.tar.gz diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..282e16b --- /dev/null +++ b/gating.yaml @@ -0,0 +1,7 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} diff --git a/perl-Perl-Tidy-Sweetened.spec b/perl-Perl-Tidy-Sweetened.spec index 96d773d..b679f89 100644 --- a/perl-Perl-Tidy-Sweetened.spec +++ b/perl-Perl-Tidy-Sweetened.spec @@ -1,6 +1,6 @@ Name: perl-Perl-Tidy-Sweetened -Version: 1.18 -Release: 7%{?dist} +Version: 1.19 +Release: 1%{?dist} Summary: Tweaks to Perl::Tidy to support some syntactic sugar License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/Perl-Tidy-Sweetened @@ -9,11 +9,12 @@ BuildArch: noarch BuildRequires: coreutils BuildRequires: perl-generators BuildRequires: perl-interpreter +BuildRequires: perl(Config) BuildRequires: perl(Module::Build::Tiny) >= 0.034 # Run-time BuildRequires: perl(base) BuildRequires: perl(Carp) -BuildRequires: perl(Perl::Tidy) +BuildRequires: perl(Perl::Tidy) >= 20221112 BuildRequires: perl(strict) BuildRequires: perl(warnings) # Tests @@ -21,6 +22,12 @@ BuildRequires: perl(Exporter) BuildRequires: perl(lib) BuildRequires: perl(Test::More) BuildRequires: perl(Test::Most) +Requires: perl(Perl::Tidy) >= 20221112 + +%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(Perl::Tidy\\) +# Filter modules bundled for tests +%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir} +%global __requires_exclude %{__requires_exclude}|^perl\\(TidierTests\\) %description There are a number of modules on CPAN that allow users to write their @@ -29,16 +36,40 @@ shift off $self, can support type checking and offer other improvements. Unfortunately, they can break the support tools that the Perl community has come to rely on. This module attempts to work around those issues. +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: perl-Test-Harness + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + %prep %setup -q -n Perl-Tidy-Sweetened-%{version} +# Help generators to recognize Perl scripts +for F in `find t -name *.t`; do + perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F" + chmod +x "$F" +done + %build perl Build.PL --installdirs=vendor ./Build %install -./Build install --destdir=$RPM_BUILD_ROOT --create_packlist=0 -%{_fixperms} $RPM_BUILD_ROOT/* +./Build install --destdir=%{buildroot} --create_packlist=0 +%{_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 ./Build test @@ -46,12 +77,19 @@ perl Build.PL --installdirs=vendor %files %license LICENSE %doc Changes README TODO -%{_bindir}/* -%{perl_vendorlib}/* -%{_mandir}/man1/* -%{_mandir}/man3/* +%{_bindir}/perltid* +%{perl_vendorlib}/Perl* +%{_mandir}/man1/perltid* +%{_mandir}/man3/Perl::Tidy::Sweet* + +%files tests +%{_libexecdir}/%{name} %changelog +* Tue Apr 18 2023 Jitka Plesnikova - 1.19-1 +- 1.19 bump +- Package tests + * Fri Jan 20 2023 Fedora Release Engineering - 1.18-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild 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 dbbbb19..2ee500f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Perl-Tidy-Sweetened-1.18.tar.gz) = db288c08b9569f7a4f785eb88bf78046e1f9c61698e3871bb79388c8c5536e7dc87fed8b5a82212922b4d035ca1c00eaf090e7c16b4fb09adcc4a1f152875393 +SHA512 (Perl-Tidy-Sweetened-1.19.tar.gz) = e4774c74898db2235fd938b7071bd50370093db2ce9d5e2c178c019875ef576e717f540b8ff94e277c9e5f0dfb101a0b047f9269a346115b2e124a24f83e42c9 diff --git a/tests/upstream-tests.fmf b/tests/upstream-tests.fmf new file mode 100644 index 0000000..f411c6f --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,4 @@ +summary: Upstream tests +component: perl-Perl-Tidy-Sweetened +require: perl-Perl-Tidy-Sweetened-tests +test: /usr/libexec/perl-Perl-Tidy-Sweetened/test