| |
@@ -1,7 +1,7 @@
|
| |
Name: perl-Git-CPAN-Patch
|
| |
Summary: Patch CPAN modules using Git
|
| |
- Version: 2.4.0
|
| |
- Release: 2%{?dist}
|
| |
+ Version: 2.5.0
|
| |
+ Release: 1%{?dist}
|
| |
License: GPL+ or Artistic
|
| |
Source0: https://cpan.metacpan.org/authors/id/Y/YA/YANICK/Git-CPAN-Patch-%{version}.tar.gz
|
| |
URL: https://metacpan.org/release/Git-CPAN-Patch
|
| |
@@ -21,7 +21,6 @@
|
| |
BuildRequires: perl(Archive::Extract)
|
| |
BuildRequires: perl(autodie)
|
| |
BuildRequires: perl(BackPAN::Index)
|
| |
- BuildRequires: perl(CLASS)
|
| |
BuildRequires: perl(CPAN::Meta)
|
| |
BuildRequires: perl(CPAN::ParseDistribution)
|
| |
BuildRequires: perl(CPANPLUS)
|
| |
@@ -96,10 +95,26 @@
|
| |
local git repository and, once gleeful hacking has been perpetrated,
|
| |
sending back patches to its maintainer.
|
| |
|
| |
+ %package tests
|
| |
+ Summary: Tests for %{name}
|
| |
+ Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
|
| |
+ Requires: git
|
| |
+ Requires: perl(Git::Repository::Plugin::AUTOLOAD)
|
| |
+ Requires: perl-Test-Harness
|
| |
+
|
| |
+ %description tests
|
| |
+ Tests from %{name}. Execute them
|
| |
+ with "%{_libexecdir}/%{name}/test".
|
| |
+
|
| |
%prep
|
| |
%setup -q -n Git-CPAN-Patch-%{version}
|
| |
# Fix shellbang
|
| |
perl -MConfig -pi -e 's|^#!/usr/bin/env perl|$Config{startperl} |' bin/git-cpan
|
| |
+ # 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 NO_PERLLOCAL=1
|
| |
@@ -112,9 +127,32 @@
|
| |
install -d -m 0755 %{buildroot}%{_libexecdir}/git-core
|
| |
mv %{buildroot}/%{_bindir}/* %{buildroot}%{_libexecdir}/git-core/
|
| |
|
| |
+ # Install tests
|
| |
+ mkdir -p %{buildroot}%{_libexecdir}/%{name}
|
| |
+ cp -a t %{buildroot}%{_libexecdir}/%{name}
|
| |
+ mkdir -p %{buildroot}%{_libexecdir}/%{name}/bin
|
| |
+ ln -s %{_libexecdir}/git-core/git-cpan %{buildroot}%{_libexecdir}/%{name}/bin
|
| |
+ cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
|
| |
+ #!/bin/sh
|
| |
+ git config --global user.email "perl-Git-CPAN-Patch-owner@fedoraproject.org"
|
| |
+ git config --global user.name "perl-Git-CPAN-Patch Owner"
|
| |
+ git config --global init.defaultBranch "development"
|
| |
+ set -e
|
| |
+ # Some tests write into temporary files/directories. The easiest solution
|
| |
+ # is to copy the tests into a writable directory and execute them from there.
|
| |
+ 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
|
| |
git config --global user.email "perl-Git-CPAN-Patch-owner@fedoraproject.org"
|
| |
git config --global user.name "perl-Git-CPAN-Patch Owner"
|
| |
+ git config --global init.defaultBranch "development"
|
| |
make test
|
| |
|
| |
%files
|
| |
@@ -126,10 +164,17 @@
|
| |
%files -n git-cpan-patch
|
| |
%license LICENSE
|
| |
%doc AUTHOR_PLEDGE Changes README.mkdn
|
| |
- %{_libexecdir}/*
|
| |
+ %{_libexecdir}/git-core
|
| |
%{_mandir}/man1/*
|
| |
|
| |
+ %files tests
|
| |
+ %{_libexecdir}/%{name}
|
| |
+
|
| |
%changelog
|
| |
+ * Wed Mar 23 2022 Jitka Plesnikova <jplesnik@redhat.com> - 2.5.0-1
|
| |
+ - 2.5.0 bump
|
| |
+ - Package tests
|
| |
+
|
| |
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-2
|
| |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
| |
|
| |