Flatten build tree.

- Disable RELEASE_TESTING, remove corresponding BRs.
- Preps for upstream having renamed dist into HTML-Formatter.
- Add %license.
- Don't pretend to be supporting rhel < 7.
This commit is contained in:
Ralf Corsépius 2015-12-09 04:29:07 +01:00
parent 15ec7a765d
commit ce3de7bef6

View File

@ -1,12 +1,22 @@
# As of release 2.13, upstream renamed the package into HTML-Formatter
%global tarvers 2.12
%if "%{tarvers}" > "2.12"
# This package should be renamed into perl-HTML-Formatter
%global tarname HTML-Formatter
%else
%global tarname HTML-Format
%endif
Name: perl-HTML-Format
Version: 2.12
Release: 1%{?dist}
Version: %{tarvers}
Release: 2%{?dist}
Summary: HTML formatter modules
Group: Development/Libraries
License: GPL+ or Artistic
URL: http://search.cpan.org/dist/HTML-Format/
Source0: http://www.cpan.org/authors/id/N/NI/NIGELM/HTML-Format-%{version}.tar.gz
Source0: http://www.cpan.org/authors/id/N/NI/NIGELM/%{tarname}-%{version}.tar.gz
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
BuildArch: noarch
@ -22,7 +32,11 @@ BuildRequires: perl(HTML::Element) >= 3.15
BuildRequires: perl(HTML::TreeBuilder)
BuildRequires: perl(IO::File)
BuildRequires: perl(Module::Build)
BuildRequires: perl(Test::CPAN::Meta)
BuildRequires: perl(Test::EOL)
BuildRequires: perl(Test::More) >= 0.96
BuildRequires: perl(Test::NoTabs)
BuildRequires: perl(Font::Metrics::Courier)
BuildRequires: perl(Font::Metrics::CourierBold)
BuildRequires: perl(Font::Metrics::CourierBoldOblique)
@ -36,25 +50,6 @@ BuildRequires: perl(Font::Metrics::TimesBoldItalic)
BuildRequires: perl(Font::Metrics::TimesItalic)
BuildRequires: perl(Font::Metrics::TimesRoman)
# for release-testing tests
%if 0%{?rhel} < 7
BuildRequires: perl(Pod::Wordlist::hanekomu)
%endif
BuildRequires: perl(Test::CPAN::Meta)
BuildRequires: perl(Test::DistManifest)
BuildRequires: perl(Test::EOL)
BuildRequires: perl(Test::HasVersion)
BuildRequires: perl(Test::MinimumVersion)
BuildRequires: perl(Test::NoTabs)
BuildRequires: perl(Test::Pod) >= 1.41
BuildRequires: perl(Test::Portability::Files)
BuildRequires: perl(Test::Synopsis)
# Disable using of Test::Vars, because it failed with Perl 5.22.0
# There is not a properly fix for it yet
%if ! 0%(perl -e 'print $] >= 5.022')
BuildRequires: perl(Test::Vars)
%endif
# These must match
# %FontFamilies in lib/HTML/FormatPS.pm
Requires: perl(Font::Metrics::Courier)
@ -74,34 +69,46 @@ Requires: perl(Font::Metrics::TimesRoman)
%description
A collection of modules that formats HTML as plaintext, PostScript or RTF.
# Build in a subdirectory, otherwise the testsuites fail
%if "%{tarvers}" > "2.12"
%package -n perl-%{tarname}
Summary: %{summary}
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Obsoletes: perl-HTML-Format < %{version}-%{release}
Provides: perl-HTML-Format = %{version}-%{release}
%description -n perl-%{tarname}
A collection of modules that formats HTML as plaintext, PostScript or RTF.
%endif
%prep
%setup -q -c -T -n %{name}-%{version}
%setup -q -T -D -n %{name}-%{version} -a0
%setup -q -n %{tarname}-%{version}
%build
cd HTML-Format-%{version}
%{__perl} Build.PL installdirs=vendor
./Build
cd ..
%install
cd HTML-Format-%{version}
./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
%{_fixperms} $RPM_BUILD_ROOT/*
cd ..
%check
cd HTML-Format-%{version}
RELEASE_TESTING=1 ./Build test
cd ..
./Build test
%files
%doc HTML-Format-%{version}/Changes HTML-Format-%{version}/README HTML-Format-%{version}/LICENSE
%files -n perl-%{tarname}
%doc Changes README
%license LICENSE
%{perl_vendorlib}/HTML
%{_mandir}/man3/HTML*
%changelog
* Wed Dec 09 2015 Ralf Corsépius <corsepiu@fedoraproject.org> - 2.12-2
- Flatten build tree.
- Disable RELEASE_TESTING, remove corresponding BRs.
- Preps for upstream having renamed dist into HTML-Formatter.
- Add %%license.
- Don't pretend to be supporting rhel < 7.
* Tue Oct 13 2015 Tom Callaway <spot@fedoraproject.org> - 2.12-1
- update to 2.12