|
1 | | -Vendor: Microsoft Corporation |
2 | | -Distribution: Azure Linux |
| 1 | +# Perform optional tests |
| 2 | +%bcond_without perl_Locale_Maketext_Gettext_enables_optional_test |
| 3 | + |
3 | 4 | Name: perl-Locale-Maketext-Gettext |
4 | | -Version: 1.30 |
5 | | -Release: 3%{?dist} |
| 5 | +Version: 1.32 |
| 6 | +Release: 1%{?dist} |
6 | 7 | Summary: Joins the gettext and Maketext frameworks |
7 | | -License: GPL+ or Artistic |
| 8 | +# README.md: GPL+ or Artistic |
| 9 | +# t/02-big-endian.t: "the same terms as Perl" and "the same license as the commonlib package" |
| 10 | +# (The "commonlib" text is a few-line excerpt.) |
| 11 | +# Automatically converted from old format: GPL+ or Artistic - review is highly recommended. |
| 12 | +License: GPL-1.0-or-later OR Artistic-1.0-Perl |
| 13 | +Vendor: Microsoft Corporation |
| 14 | +Distribution: Azure Linux |
8 | 15 | URL: https://metacpan.org/release/Locale-Maketext-Gettext |
9 | 16 | Source0: https://cpan.metacpan.org/authors/id/I/IM/IMACAT/Locale-Maketext-Gettext-%{version}.tar.gz#/perl-Locale-Maketext-Gettext-%{version}.tar.gz |
10 | 17 | BuildArch: noarch |
11 | 18 | BuildRequires: coreutils |
12 | | -BuildRequires: perl-interpreter |
| 19 | +# diffutils for cmp |
| 20 | +BuildRequires: diffutils |
| 21 | +BuildRequires: make |
13 | 22 | BuildRequires: perl-generators |
| 23 | +BuildRequires: perl-interpreter |
| 24 | +BuildRequires: perl(:VERSION) >= 5.8 |
| 25 | +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 |
| 26 | +BuildRequires: perl(strict) |
| 27 | +BuildRequires: perl(warnings) |
| 28 | +# Run-time: |
14 | 29 | BuildRequires: perl(base) |
15 | 30 | BuildRequires: perl(Encode) |
16 | 31 | BuildRequires: perl(Exporter) |
17 | | -BuildRequires: perl(ExtUtils::MakeMaker) |
| 32 | +BuildRequires: perl(File::Spec::Functions) |
| 33 | +BuildRequires: perl(Getopt::Long) |
| 34 | +BuildRequires: perl(Locale::Maketext) |
| 35 | +# Tests: |
18 | 36 | BuildRequires: perl(File::Basename) |
19 | 37 | BuildRequires: perl(File::Copy) |
20 | | -BuildRequires: perl(File::Spec::Functions) |
21 | 38 | BuildRequires: perl(FindBin) |
22 | 39 | BuildRequires: perl(lib) |
23 | | -BuildRequires: perl(Locale::Maketext) |
24 | | -BuildRequires: perl(Module::Build) |
25 | | -# Module::Signature not used |
26 | | -BuildRequires: perl(Socket) |
27 | | -BuildRequires: perl(strict) |
28 | 40 | BuildRequires: perl(Test) |
29 | 41 | BuildRequires: perl(Test::More) |
30 | 42 | BuildRequires: perl(vars) |
31 | | -BuildRequires: perl(warnings) |
32 | | -BuildRequires: sed |
33 | | -Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) |
34 | | -# Convert getext parameters to maketext parameters (CPAN RT#97771) |
35 | | -Patch0: gettexttomakettext.patch |
36 | | - |
| 43 | +%if %{with perl_Locale_Maketext_Gettext_enables_optional_test} |
| 44 | +# Optional tests: |
| 45 | +# Module::Signature not used |
| 46 | +# Socket not used |
| 47 | +BuildRequires: perl(Test::Pod) >= 1.00 |
| 48 | +%endif |
| 49 | + |
| 50 | +# Filter private modules |
| 51 | +%global __provides_exclude %{?__provides_exclude:%{__provides_exclude}|}^perl\\(T_L10N |
| 52 | + |
37 | 53 | %description |
38 | 54 | Locale::Maketext::Gettext joins the GNU gettext and Maketext frameworks. It |
39 | 55 | is a subclass of Locale::Maketext(3) that follows the way GNU gettext |
40 | 56 | works. It works seamlessly, both in the sense of GNU gettext and Maketext. |
41 | 57 | As a result, you enjoy both their advantages, and get rid of both their |
42 | 58 | problems, too. |
43 | | - |
| 59 | + |
| 60 | +%package tests |
| 61 | +Summary: Tests for %{name} |
| 62 | +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} |
| 63 | +Requires: coreutils |
| 64 | +Requires: perl-Test-Harness |
| 65 | + |
| 66 | +%description tests |
| 67 | +Tests from %{name}. Execute them |
| 68 | +with "%{_libexecdir}/%{name}/test". |
| 69 | + |
44 | 70 | %prep |
45 | | -%setup -q -n Locale-Maketext-Gettext-%{version} |
46 | | -%patch 0 -p 1 |
47 | | - |
| 71 | +%autosetup -p1 -n Locale-Maketext-Gettext-%{version} |
| 72 | +# Remove unsed tests |
| 73 | +for F in t/00-signature.t \ |
| 74 | +%if !%{with perl_Locale_Maketext_Gettext_enables_optional_test} |
| 75 | + t/99-pod.t \ |
| 76 | +%endif |
| 77 | +; do |
| 78 | + rm "$F" |
| 79 | + perl -i -ne 'print $_ unless m{^\Q'"$F"'\E}' MANIFEST |
| 80 | +done |
| 81 | +# Sym-link identical files |
| 82 | +if cmp t/locale/C/LC_MESSAGES/test.mo t/locale/en/LC_MESSAGES/test.mo; then |
| 83 | + rm t/locale/en/LC_MESSAGES/test.mo |
| 84 | + ln -s ../../C/LC_MESSAGES/test.mo t/locale/en/LC_MESSAGES/test.mo |
| 85 | +fi |
| 86 | + |
48 | 87 | %build |
49 | | -%{__perl} Build.PL installdirs=vendor |
50 | | -./Build |
51 | | - |
| 88 | +perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 |
| 89 | +%{make_build} |
| 90 | + |
52 | 91 | %install |
53 | | -./Build install destdir=$RPM_BUILD_ROOT create_packlist=0 |
54 | | -%{_fixperms} $RPM_BUILD_ROOT/* |
55 | | - |
| 92 | +%{make_install} |
| 93 | +%{_fixperms} %{buildroot}/* |
| 94 | +# Install tests |
| 95 | +mkdir -p %{buildroot}%{_libexecdir}/%{name} |
| 96 | +cp -a t %{buildroot}%{_libexecdir}/%{name} |
| 97 | +%if %{with perl_Locale_Maketext_Gettext_enables_optional_test} |
| 98 | + rm %{buildroot}%{_libexecdir}/%{name}/t/99-pod.t |
| 99 | +%endif |
| 100 | +mkdir -p %{buildroot}%{_libexecdir}/%{name}/blib/script |
| 101 | +ln -s \ |
| 102 | + $(realpath --relative-to %{buildroot}%{_libexecdir}/%{name}/blib/script \ |
| 103 | + %{buildroot}%{_bindir}/maketext) \ |
| 104 | + %{buildroot}%{_libexecdir}/%{name}/blib/script/maketext |
| 105 | +cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' |
| 106 | +#!/bin/bash |
| 107 | +set -e |
| 108 | +# t/12-cache.t and others write into CWD. |
| 109 | +DIR=$(mktemp -d) |
| 110 | +pushd "$DIR" |
| 111 | +cp -a %{_libexecdir}/%{name}/* ./ |
| 112 | +prove -I . -j "$(getconf _NPROCESSORS_ONLN)" |
| 113 | +popd |
| 114 | +rm -rf "$DIR" |
| 115 | +EOF |
| 116 | +chmod +x %{buildroot}%{_libexecdir}/%{name}/test |
| 117 | + |
56 | 118 | %check |
57 | | -rm -f debugsources.list debugfiles.list debuglinks.list |
58 | | -./Build test |
59 | | - |
| 119 | +export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}') |
| 120 | +make test |
| 121 | + |
60 | 122 | %files |
61 | | -%license Artistic COPYING |
62 | | -%doc BUGS Changes README THANKS TODO |
| 123 | +%license Artistic |
| 124 | +%doc Changes README.md |
63 | 125 | %{perl_vendorlib}/* |
64 | 126 | %{_mandir}/man3/* |
65 | 127 | %{_bindir}/maketext |
66 | 128 | %{_mandir}/man1/* |
| 129 | + |
| 130 | +%files tests |
| 131 | +%{_libexecdir}/%{name} |
67 | 132 |
|
68 | 133 | %changelog |
| 134 | +* Mon Mar 17 2025 Sumit Jena <[email protected]> - 1.32-1 |
| 135 | +- Update to version 1.32 |
| 136 | +- License verified |
| 137 | + |
69 | 138 | * Fri Oct 15 2021 Pawel Winogrodzki <[email protected]> - 1.30-3 |
70 | 139 | - Initial CBL-Mariner import from Fedora 32 (license: MIT). |
71 | 140 |
|
|
0 commit comments