Clean up for modern rpm

- Always run test suite but don't run release tests when bootstrapping
- Nobody else likes macros for commands
- Clean up for modern rpm:
  - Drop explicit buildroot tag
  - Drop buildroot cleaning
  - Drop %defattr
  - Use native provides filtering
- Use a patch rather than scripting iconv to fix character encoding
- Upstream file permissions no longer need fixing
This commit is contained in:
Paul Howarth 2011-07-21 11:02:40 +01:00
parent d1e75a2edf
commit 9ba4d51171
2 changed files with 49 additions and 33 deletions

11
PPI-1.215-UTF8.patch Normal file
View File

@ -0,0 +1,11 @@
--- PPI/Changes
+++ PPI/Changes
@@ -705,7 +705,7 @@
- Resolved Lexer bug CPAN #13425 ( $p{package} creates a PPI::Statement::Package )
Added smarts to resolve word-started statements as ::Expression in subscripts
- Resolved PDOM bug CPAN #13326 ( problems in index_locations )
- Patch and comprehensive additional tests provided by johanl[ÄT]DarSerMan.com
+ Patch and comprehensive additional tests provided by johanl[ÄT]DarSerMan.com
- Removed dependency on Class::Autouse. Just load Tokenizer and Lexer up front.
- Removed dependency on File::Slurp. Only use it 3 times and it's not worth it
when almost all the files we will read are under 50k.

View File

@ -1,39 +1,42 @@
Name: perl-PPI Name: perl-PPI
Version: 1.215 Version: 1.215
Release: 2%{?dist} Release: 3%{?dist}
Summary: Parse, Analyze and Manipulate Perl Summary: Parse, Analyze and Manipulate Perl
Group: Development/Libraries Group: Development/Libraries
License: GPL+ or Artistic License: GPL+ or Artistic
URL: http://search.cpan.org/dist/PPI/ URL: http://search.cpan.org/dist/PPI/
Source0: http://www.cpan.org/authors/id/A/AD/ADAMK/PPI-%{version}.tar.gz Source0: http://www.cpan.org/authors/id/A/AD/ADAMK/PPI-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Patch0: PPI-1.215-UTF8.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(ExtUtils::MakeMaker)
# Perl core modules
BuildRequires: perl(List::Util) >= 1.20 BuildRequires: perl(List::Util) >= 1.20
BuildRequires: perl(Storable) >= 2.17 BuildRequires: perl(Storable) >= 2.17
BuildRequires: perl(Test::More) >= 0.86
BuildRequires: perl(Digest::MD5) >= 2.35
# CPAN modules
BuildRequires: perl(Clone) >= 0.30 BuildRequires: perl(Clone) >= 0.30
BuildRequires: perl(File::Find::Rule) >= 0.32 BuildRequires: perl(Digest::MD5) >= 2.35
BuildRequires: perl(File::Remove) >= 1.42 BuildRequires: perl(File::Remove) >= 1.42
BuildRequires: perl(IO::String) >= 1.07 BuildRequires: perl(IO::String) >= 1.07
BuildRequires: perl(List::MoreUtils) >= 0.16 BuildRequires: perl(List::MoreUtils) >= 0.16
BuildRequires: perl(Params::Util) >= 1.00 BuildRequires: perl(Params::Util) >= 1.00
%if !%{defined perl_bootstrap}
BuildRequires: perl(File::Find::Rule::Perl) >= 1.09
BuildRequires: perl(Perl::MinimumVersion) >= 1.25
BuildRequires: perl(Task::Weaken) BuildRequires: perl(Task::Weaken)
BuildRequires: perl(Test::ClassAPI) >= 1.04 BuildRequires: perl(Test::More) >= 0.86
BuildRequires: perl(Test::CPAN::Meta) >= 0.17
BuildRequires: perl(Test::MinimumVersion) >= 0.101080
BuildRequires: perl(Test::NoWarnings) >= 0.084 BuildRequires: perl(Test::NoWarnings) >= 0.084
BuildRequires: perl(Test::Object) >= 0.07 BuildRequires: perl(Test::Object) >= 0.07
BuildRequires: perl(Test::Pod) >= 1.44
BuildRequires: perl(Test::SubCalls) >= 1.07 BuildRequires: perl(Test::SubCalls) >= 1.07
# Circular dependencies in release tests, so don't do them when bootstrapping:
# Perl::MinimumVersion -> PPI
%if 0%{!?perl_bootstrap:1}
BuildRequires: perl(File::Find::Rule) >= 0.32
BuildRequires: perl(File::Find::Rule::Perl) >= 1.09
BuildRequires: perl(Perl::MinimumVersion) >= 1.20
BuildRequires: perl(Test::ClassAPI) >= 1.03
BuildRequires: perl(Test::CPAN::Meta)
BuildRequires: perl(Test::MinimumVersion) >= 0.101080
BuildRequires: perl(Test::Pod) >= 1.00
%endif %endif
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
# Filter out redundant unversioned provides
%global __provides_exclude ^perl\\(PPI::.+\\)$
%description %description
Parse, analyze and manipulate Perl (without perl). Parse, analyze and manipulate Perl (without perl).
@ -41,40 +44,31 @@ Parse, analyze and manipulate Perl (without perl).
%prep %prep
%setup -q -n PPI-%{version} %setup -q -n PPI-%{version}
%{?filter_setup:
%filter_from_provides /^perl(PPI::.*)$/d # Re-code docs as UTF-8
%?perl_default_filter %patch0 -p1
}
iconv -f iso8859-1 -t utf-8 < Changes > Changes.1
mv Changes.1 Changes
chmod -c 644 lib/PPI/Document/File.pm
%build %build
%{__perl} Makefile.PL INSTALLDIRS=vendor perl Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
rm -rf $RPM_BUILD_ROOT make pure_install DESTDIR=%{buildroot}
make pure_install DESTDIR=$RPM_BUILD_ROOT find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';' find %{buildroot} -type d -depth -exec rmdir {} 2>/dev/null ';'
find $RPM_BUILD_ROOT -type d -depth -exec rmdir {} 2>/dev/null ';' %{_fixperms} %{buildroot}
%{_fixperms} $RPM_BUILD_ROOT
%check %check
%if !%{defined perl_bootstrap}
make test make test
%if 0%{!?perl_bootstrap:1}
make test TEST_FILES="xt/*.t" RELEASE_TESTING=1 make test TEST_FILES="xt/*.t" RELEASE_TESTING=1
%endif %endif
%clean
rm -rf $RPM_BUILD_ROOT
%files %files
%defattr(-,root,root,-)
%doc Changes LICENSE README inline2test.conf inline2test.tpl %doc Changes LICENSE README inline2test.conf inline2test.tpl
%{perl_vendorlib}/PPI/ %{perl_vendorlib}/PPI/
%{perl_vendorlib}/PPI.pm %{perl_vendorlib}/PPI.pm
@ -82,6 +76,17 @@ rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Thu Jul 21 2011 Paul Howarth <paul@city-fan.org> - 1.215-3
- always run test suite but don't run release tests when bootstrapping
- nobody else likes macros for commands
- clean up for modern rpm:
- drop explicit buildroot tag
- drop buildroot cleaning
- drop %%defattr
- use native provides filtering
- use a patch rather than scripting iconv to fix character encoding
- upstream file permissions no longer need fixing
* Tue Jun 28 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.215-2 * Tue Jun 28 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.215-2
- rebuild with Perl 5.14.1 - rebuild with Perl 5.14.1
- use perl_bootstrap macro - use perl_bootstrap macro