# This package includes the pari library source even though we link
# against the system version of the library; the library source is
# needed to build the documentation for this perl binding and also
# to enhance the test suite, by providing additional tests from the
# main library test suite.
#
# Since this binding is tightly linked to the main library, we
# have to enforce a tight dependency on the main pari library version
# so that we stay in step properly.
%global pari_version 2.3.5
%global pari_int_version %(echo %{pari_version} | perl -pi -e 's/(\\d+)\\.(\\d+)\\.(\\d+)/sprintf("%d%03d%03d",$1,$2,$3)/e')
%global extraversion 05
Summary: Perl interface to PARI
Name: perl-Math-Pari
Version: 2.010806
Release: 13%{?dist}
License: GPL+ or Artistic
Group: Development/Libraries
Url: http://search.cpan.org/dist/Math-Pari/
Source0: http://search.cpan.org/CPAN/authors/id/I/IL/ILYAZ/modules/Math-Pari-%{version}%{extraversion}.tar.gz
Source1: http://pari.math.u-bordeaux.fr/pub/pari/unix/OLD/pari-%{pari_version}.tar.gz
Patch0: Math-Pari-2.010802-no-fake-version.patch
Patch1: Math-Pari-2.010802-docs-and-testsuite.patch
Patch2: Math-Pari-2.01080604-extra-stack-for-test.patch
BuildRequires: perl(DynaLoader)
BuildRequires: perl(Exporter)
BuildRequires: perl(ExtUtils::MakeMaker)
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
# Enforce dependency against same version of pari that we're built for
BuildRequires: pari-devel = %{pari_version}
Requires: pari%{?_isa} = %{pari_version}
# Don't "provide" private Perl libs or the redundant unversioned perl(Math::Pari)
%global __provides_exclude ^(perl\\(Math::Pari\\)$|Pari\\.so)
%description
This package is a Perl interface to the famous library PARI for numerical/
scientific/ number-theoretic calculations. It allows use of most PARI functions
as Perl functions, and (almost) seamless merging of PARI and Perl data.
%prep
%setup -q -n Math-Pari-%{version}%{extraversion} -a 1
# Remove spurious executable permission bits
chmod -x Changes README Pari.pm PariInit.pm func_codes.h Pari.xs
# Don't use a fake version number when we can use a real one
%patch0 -p1
sed -i -e s/@@@OUR-PARI-VERSION@@@/%{pari_int_version}/ Makefile.PL
# We want to build the docs and test suite from the local pari sources
%patch1 -p1
# Need extra stack for intnum test on some arches
cd pari-%{pari_version}
%patch2 -p2
cd -
%build
perl Makefile.PL \
INSTALLDIRS=vendor \
OPTIMIZE="-I%{_includedir}/pari %{optflags}" \
parilib="-lpari"
make %{?_smp_mflags}
%install
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -type f -name '*.bs' -a -size 0 -exec rm -f {} ';'
find %{buildroot} -depth -type d -exec rmdir {} ';' 2>/dev/null
%{_fixperms} %{buildroot}
%check
make test
%files
%defattr(-,root,root,-)
%doc Changes README
%dir %{perl_vendorarch}/Math/
%exclude %doc %{perl_vendorarch}/Math/libPARI.dumb.pod
%doc %{perl_vendorarch}/Math/libPARI.pod
%{perl_vendorarch}/Math/*.pm
%{perl_vendorarch}/auto/Math/
%{_mandir}/man3/Math::Pari.3pm*
%{_mandir}/man3/Math::PariInit.3pm*
%{_mandir}/man3/Math::libPARI.3pm*
%exclude %{_mandir}/man3/Math::libPARI.dumb.3pm*
%changelog
* Mon Jun 11 2012 Petr Pisar <ppisar@redhat.com> - 2.010806-13
- Perl 5.16 rebuild
* Thu Jan 12 2012 Paul Howarth <paul@city-fan.org> - 2.010806-12
- Update pari source URL to reflect that we're using an OLD version
- Add buildreqs for perl core modules, which might be dual-lived
- Rewrite provides filter for rpm-4.9 compatibility
- Rename patches to strip 'perl-' prefix
* Wed Jun 15 2011 Marcela Mašláňová <mmaslano@redhat.com> - 2.010806-11
- Perl mass rebuild
* Sat Apr 30 2011 Paul Howarth <paul@city-fan.org> - 2.010806-10
- Update to 2.01080605 (see Changes for details)
- Remove buildroot definition and cleaning, redundant with modern rpmbuild
- Nobody else likes macros for commands
- PERL_INSTALL_ROOT => DESTDIR
- Use %%{_fixperms} macro instead of our own chmod incantation
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.010806-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Dec 20 2010 Marcela Maslanova <mmaslano@redhat.com> - 2.010806-8
- Rebuild to fix problems with vendorarch/lib (#661697)
* Fri Jul 9 2010 Paul Howarth <paul@city-fan.org> - 2.010806-7
- Rebuild with pari 2.3.5
- Tweak application of intnum test patch to apply with different pari versions
* Tue Jun 22 2010 Paul Howarth <paul@city-fan.org> - 2.010806-6
- Make stack size bigger for intnum test to avoid test failures on some
arches (e.g. s390x, ppc64 - #551988)
* Mon May 3 2010 Marcela Maslanova <mmaslano@redhat.com> - 2.010806-5
- Mass rebuild with perl-5.12.0
* Thu Mar 4 2010 Paul Howarth <paul@city-fan.org> - 2.010806-4
- Update to 2.01080604 (see Changes for details)
* Fri Dec 11 2009 Paul Howarth <paul@city-fan.org> - 2.010806-3
- Update to 2.01080603 (see Changes for details)
* Thu Nov 12 2009 Paul Howarth <paul@city-fan.org> - 2.010806-2
- Update to 2.01080602 (see Changes for details)
- No longer need to fix test suite for 64-bit builds
* Fri Nov 6 2009 Paul Howarth <paul@city-fan.org> - 2.010806-1
- Update to 2.010806
* Wed Nov 4 2009 Paul Howarth <paul@city-fan.org> - 2.010805-1
- Update to 2.010805
* Mon Nov 2 2009 Paul Howarth <paul@city-fan.org> - 2.010804-1
- Update to 2.010804
* Thu Oct 29 2009 Paul Howarth <paul@city-fan.org> - 2.010802-1
- Update to 2.010802
- Use system pari library (version 2.3.4) rather than a local build
(requires patches to Makefile.PL to get docs and test suite)
- Enforce tight dependency on system pari version to ensure we stay in step
- Fix test suite so that 64-bit builds work with pari-2.3.4
- Use standard filter macros for provides filter
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.010801-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Sun Mar 8 2009 Paul Howarth <paul@city-fan.org> - 2.010801-3
- Filter out unwanted provides for perl shared objects
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.010801-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Wed Feb 11 2009 Paul Howarth <paul@city-fan.org> - 2.010801-1
- update to 2.010801, but build with pari-2.1.7 since 2.1.8 doesn't exist
(upstream forgot their own numbering convention - CPAN RT#35493)
- re-enable tests
- drop patch for perl 5.10, no longer needed
- remove spurious exec bits on files in upstream distribution
* Fri Mar 7 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.010709-7
- disable tests, they're being weird in the buildservers
* Fri Mar 7 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.010709-6
- fix for perl 5.10 (many many thanks to Nicholas Clark)
* Wed Mar 5 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.010709-5
- rebuild for new perl
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.010709-4
- Autorebuild for GCC 4.3
* Mon Aug 13 2007 Paul Howarth <paul@city-fan.org> 2.010709-3
- clarify license as GPL v1 or later, or Artistic (same as perl)
* Wed Apr 18 2007 Paul Howarth <paul@city-fan.org> 2.010709-2
- Buildrequire perl(ExtUtils::MakeMaker)
* Fri Oct 27 2006 Paul Howarth <paul@city-fan.org> 2.010709-1
- Update to 2.010709
* Wed Oct 18 2006 Paul Howarth <paul@city-fan.org> 2.010708-1
- Update to 2.010708
- Fix argument order for find with -depth
- Fix Source1 URL
* Wed Aug 30 2006 Paul Howarth <paul@city-fan.org> 2.010706-2
- FE6 mass rebuild
* Fri Jun 2 2006 Paul Howarth <paul@city-fan.org> 2.010706-1
- Update to 2.010706
* Wed May 31 2006 Paul Howarth <paul@city-fan.org> 2.010705-1
- Update to 2.010705
* Tue Apr 18 2006 Paul Howarth <paul@city-fan.org> 2.010704-2
- Omit dumb docs (#175198)
* Mon Mar 20 2006 Paul Howarth <paul@city-fan.org> 2.010704-1
- Update to 2.010704
* Fri Mar 17 2006 Paul Howarth <paul@city-fan.org> 2.010703-2
- Simplify %%{__perl_requires} filter
* Wed Feb 1 2006 Paul Howarth <paul@city-fan.org> 2.010703-1
- Update to 2.010703
- Make pari version number calculation more robust
* Wed Dec 7 2005 Paul Howarth <paul@city-fan.org> 2.010702-1
- Initial build