diff options
Diffstat (limited to 'perl-Alien-Build-Plugin-Download-GitLab.spec')
-rw-r--r-- | perl-Alien-Build-Plugin-Download-GitLab.spec | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/perl-Alien-Build-Plugin-Download-GitLab.spec b/perl-Alien-Build-Plugin-Download-GitLab.spec new file mode 100644 index 0000000..40e4d66 --- /dev/null +++ b/perl-Alien-Build-Plugin-Download-GitLab.spec @@ -0,0 +1,84 @@ +Name: perl-Alien-Build-Plugin-Download-GitLab +Version: 0.01 +Release: 1 +Summary: Alien::Build plugin to download from GitLab +License: GPL-1.0-or-later OR Artistic-1.0-Perl +URL: https://metacpan.org/release/Alien-Build-Plugin-Download-GitLab +Source0: https://cpan.metacpan.org/authors/id/P/PL/PLICEASE/Alien-Build-Plugin-Download-GitLab-%{version}.tar.gz +BuildArch: noarch +# Build +BuildRequires: coreutils +BuildRequires: make +BuildRequires: perl-generators +BuildRequires: perl-interpreter +BuildRequires: perl(:VERSION) >= 5.8.4 +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +# Run-time +BuildRequires: perl(Alien::Build::Plugin) +BuildRequires: perl(Carp) +BuildRequires: perl(File::Basename) +BuildRequires: perl(JSON::PP) +BuildRequires: perl(Path::Tiny) +BuildRequires: perl(URI) +BuildRequires: perl(URI::Escape) +# Tests +BuildRequires: perl(Config) +BuildRequires: perl(Test::More) +BuildRequires: perl(Test2::V0) >= 0.000121 + +%description +This plugin is designed for downloading assets from a GitLab instance. + +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: perl-Test-Harness +Requires: perl(Test::More) + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + +%prep +%setup -q -n Alien-Build-Plugin-Download-GitLab-%{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 NO_PERLLOCAL=1 +%{make_build} + +%install +%{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 +make test + +%files +%license LICENSE +%doc Changes README +%{perl_vendorlib}/* +%{_mandir}/man3/* + +%files tests +%{_libexecdir}/%{name} + +%changelog +* Wed Dec 25 2024 Funda Wang <fundawang@yeah.net> - 0.01-1 +- Import package |