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/gating.yaml b/gating.yaml new file mode 100644 index 0000000..1608530 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,7 @@ +# RHEL +--- !Policy +product_versions: + - rhel-* +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/perl-File-DesktopEntry.spec b/perl-File-DesktopEntry.spec index 974585b..aafbd82 100644 --- a/perl-File-DesktopEntry.spec +++ b/perl-File-DesktopEntry.spec @@ -7,15 +7,17 @@ Name: perl-File-DesktopEntry Version: 0.22 -Release: 26%{?dist} +Release: 27%{?dist} Summary: Object to handle .desktop files License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/File-DesktopEntry Source0: https://cpan.metacpan.org/authors/id/M/MI/MICHIELB/File-DesktopEntry-%{version}.tar.gz BuildArch: noarch +BuildRequires: coreutils BuildRequires: make -BuildRequires: perl-interpreter BuildRequires: perl-generators +BuildRequires: perl-interpreter +BuildRequires: perl(Config) BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 BuildRequires: perl(strict) BuildRequires: perl(warnings) @@ -47,26 +49,64 @@ is specified by the freedesktop "Desktop Entry" specification. This module can parse these files but also knows how to run the applications defined by these files. For this module version 1.0 of the specification was used. +%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 File-DesktopEntry-%{version} +# Help generators to recognize Perl scripts +for F in t/*.t; do + perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F" + chmod +x "$F" +done %build -perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 -make %{?_smp_mflags} +perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 +%{make_build} %install -make pure_install DESTDIR=$RPM_BUILD_ROOT -%{_fixperms} $RPM_BUILD_ROOT/* +%{make_install} +%{_fixperms} %{buildroot}/* + +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a MANIFEST t %{buildroot}%{_libexecdir}/%{name} +rm %{buildroot}%{_libexecdir}/%{name}/t/*_pod* +rm %{buildroot}%{_libexecdir}/%{name}/t/06_changes.t +cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' +#!/bin/bash +set -e +DIR=$(mktemp -d) +pushd "$DIR" +cp -a %{_libexecdir}/%{name}/* ./ +prove -I . -j "$(getconf _NPROCESSORS_ONLN)" +popd +rm -rf "$DIR" +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 %doc Changes -%{perl_vendorlib}/* -%{_mandir}/man3/* +%{perl_vendorlib}/File* +%{_mandir}/man3/File::DesktopEntry* + +%files tests +%{_libexecdir}/%{name} %changelog +* Tue Jul 23 2024 Jitka Plesnikova - 0.22-27 +- Package tests + * Mon Jun 24 2024 Troy Dawson - 0.22-26 - Bump release for June 2024 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/tests/upstream-tests.fmf b/tests/upstream-tests.fmf new file mode 100644 index 0000000..88f5e9f --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,12 @@ +summary: Upstream tests +contact: Jitka Plesnikova +component: perl-File-DesktopEntry +require: perl-File-DesktopEntry-tests +test: /usr/libexec/perl-File-DesktopEntry/test +enabled: true +tag: + - rhel-buildroot +adjust: + - enabled: false + when: distro < rhel-10 or distro < centos-stream-10 + continue: false