Blob Blame History Raw
# This package includes the pari library source even though that is
# being introduced to Fedora Extras in its own right (#169703). The
# rationale for this is:
# (a)	This package patches the library source code
# (b)	This package integrates very tightly with the library and may
#	break if the library is changed underneath it
# (c)	Functionality is lost if built against an external PARI library
#	(see the INSTALL file in the distribution)

# The perl module version used to indicate the latest PARI version that
# it was tested against, but due to an oversight 2.010800 was released
# and broke the numbering scheme, so we need to hardcode both version
# numbers from now on (see CPAN RT#35493)
%define module_version	2.010801
%define pari_version	2.1.7

Summary:	Perl interface to PARI
Name:		perl-Math-Pari
Version:	%{module_version}
Release:	3%{?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-%{module_version}.tar.gz
Source1:	http://pari.math.u-bordeaux.fr/pub/pari/unix/OLD/pari-%{pari_version}.tgz
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires:	perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
BuildRequires:	perl(ExtUtils::MakeMaker)

# don't "provide" private Perl libs or the redundant unversioned perl(Math::Pari) one
%global _use_internal_dependency_generator 0
%global __deploop() while read FILE; do /usr/lib/rpm/rpmdeps -%{1} ${FILE}; done | /bin/sort -u
%global __find_provides /bin/sh -c "%{__grep} -v '%{perl_vendorarch}/.*\\.so$' | %{__deploop P} | %{__grep} -Fvx 'perl(Math::Pari)'"
%global __find_requires /bin/sh -c "%{__deploop R}"

%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-%{module_version} -a 1

# Remove spurious executable permission bits
%{__chmod} -x Changes README Pari.pm PariInit.pm func_codes.h Pari.xs

%build
# machine=linux-none needed to avoid breakage of 64-bit builds
# other flags cribbed from pari.spec (#169703)
export DLCFLAGS=-fPIC
%{__perl} Makefile.PL \
	INSTALLDIRS=vendor \
	OPTIMIZE="%{optflags} -fomit-frame-pointer" \
	machine=none
%{__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} -type f -name '*.bs' -a -size 0 -exec %{__rm} -f {} ';'
/usr/bin/find %{buildroot} -depth -type d -exec /bin/rmdir {} 2>/dev/null ';'
%{__chmod} -R u+w %{buildroot}/*

%check
%{__make} test

%clean
%{__rm} -rf %{buildroot}

%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
* 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