[perl-FileHandle-Unget] Tweak provides filter for rpm 4.9 compatibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit df78db29835f1f0c84b0624937bcd05a7a62779b
Author: Paul Howarth <paul@xxxxxxxxxxxx>
Date:   Thu Jul 28 11:17:25 2011 +0100

    Tweak provides filter for rpm 4.9 compatibility
    
    - Tweak provides filter for rpm 4.9 compatibility
    - Nobody else likes macros for commands
    - Use DESTDIR rather than PERL_INSTALL_ROOT

 perl-FileHandle-Unget.spec |   38 +++++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 13 deletions(-)
---
diff --git a/perl-FileHandle-Unget.spec b/perl-FileHandle-Unget.spec
index 4d1e505..ddc8fce 100644
--- a/perl-FileHandle-Unget.spec
+++ b/perl-FileHandle-Unget.spec
@@ -1,16 +1,19 @@
+# Need to tweak provides filter differently if we have rpm 4.9 onwards
+%global rpm49 %(rpm --version | perl -pi -e 's/^.* (\\d+)\\.(\\d+)\\.(\\d+).*/sprintf("%d.%03d%03d",$1,$2,$3) ge 4.009 ? 1 : 0/e')
+
 Summary:	A FileHandle that supports ungetting of multiple bytes
 Name:		perl-FileHandle-Unget
 Version:	0.1623
-Release:	7%{?dist}
+Release:	8%{?dist}
 License:	GPL+
 Group:		Development/Libraries
 Url:		http://search.cpan.org/dist/FileHandle-Unget/
 Source0:	http://search.cpan.org/CPAN/authors/id/D/DC/DCOPPIT/FileHandle-Unget-%{version}.tar.gz
-BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
 BuildArch:	noarch
 BuildRequires:	perl(Scalar::Util) >= 1.14
 BuildRequires:	perl(Devel::Leak), perl(ExtUtils::MakeMaker), perl(Test::More)
-Requires:	perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
+Requires:	perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
 Provides:	perl(FileHandle::Unget) = %{version}
 
 %description
@@ -22,26 +25,30 @@ string of bytes back on the input.
 %prep
 %setup -q -n FileHandle-Unget-%{version}
 
-# Auto provides aren't clever enough for what FileHandle::Unget does
-%global provfilt /bin/sh -c "%{__perl_provides} | %{__grep} -v '^perl(FileHandle::Unget)'"
+# Drop bogus autodetected provide
+%if %{rpm49}
+%global __provides_exclude ^perl\\(FileHandle::Unget\\)
+%else
+%global provfilt /bin/sh -c "%{__perl_provides} | grep -v '^perl(FileHandle::Unget)'"
 %define __perl_provides %{provfilt}
+%endif
 
 %build
-%{__perl} Makefile.PL INSTALLDIRS=vendor
-%{__make} %{?_smp_mflags}
+perl Makefile.PL INSTALLDIRS=vendor
+make %{?_smp_mflags}
 
 %install
-%{__rm} -rf %{buildroot}
-%{__make} pure_install PERL_INSTALL_ROOT=%{buildroot}
-/usr/bin/find %{buildroot} -type f -name .packlist -exec %{__rm} -f {} ';'
-/usr/bin/find %{buildroot} -depth -type d -exec /bin/rmdir {} ';' 2>/dev/null
+rm -rf %{buildroot}
+make pure_install DESTDIR=%{buildroot}
+find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
+find %{buildroot} -depth -type d -exec rmdir {} ';' 2>/dev/null
 %{_fixperms} %{buildroot}
 
 %check
-%{__make} test
+make test
 
 %clean
-%{__rm} -rf %{buildroot}
+rm -rf %{buildroot}
 
 %files
 %defattr(-,root,root,-)
@@ -50,6 +57,11 @@ string of bytes back on the input.
 %{_mandir}/man3/FileHandle::Unget.3pm*
 
 %changelog
+* Thu Jul 28 2011 Paul Howarth <paul@xxxxxxxxxxxx> 0.1623-8
+- Tweak provides filter for rpm 4.9 compatibility
+- Nobody else likes macros for commands
+- Use DESTDIR rather than PERL_INSTALL_ROOT
+
 * Sun Jun 19 2011 Marcela Mašláňová <mmaslano@xxxxxxxxxx> - 0.1623-7
 - Perl mass rebuild
 
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/perl-devel



[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux