[perl-Math-Pari] Migrate to build against libpari23

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

 



commit 8d296dfb744806a49f9e46deffdc12002e80ee72
Author: Paul Howarth <paul@xxxxxxxxxxxx>
Date:   Mon Jul 2 20:05:50 2012 +0100

    Migrate to build against libpari23
    
    - Migrate to build against libpari23, since the new pari 2.5.x is not yet
      supported upstream (CPAN RT#69295, CPAN RT#70990)
    - BR: perl(Carp)
    - Don't need to remove empty directories from the buildroot
    - Drop %defattr, redundant since rpm 4.4

 Math-Pari-2.01080604-extra-stack-for-test.patch |   25 -----------
 Math-Pari-2.01080605-include-path.patch         |   11 +++++
 perl-Math-Pari.spec                             |   53 ++++++++++-------------
 sources                                         |    1 -
 4 files changed, 34 insertions(+), 56 deletions(-)
---
diff --git a/Math-Pari-2.01080605-include-path.patch b/Math-Pari-2.01080605-include-path.patch
new file mode 100644
index 0000000..515059a
--- /dev/null
+++ b/Math-Pari-2.01080605-include-path.patch
@@ -0,0 +1,11 @@
+--- Pari.xs
++++ Pari.xs
+@@ -3,7 +3,7 @@
+ #  include <windows.h>
+ #endif
+ 
+-#  include <pari.h>
++#  include <pari/pari.h>
+ #  include <graph/rect.h>
+ #  include <language/anal.h>
+ 
diff --git a/perl-Math-Pari.spec b/perl-Math-Pari.spec
index 2e0965f..55d21fe 100644
--- a/perl-Math-Pari.spec
+++ b/perl-Math-Pari.spec
@@ -1,37 +1,24 @@
-# 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}
+Release:	14%{?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)
+Patch2:		Math-Pari-2.01080605-include-path.patch
+BuildRequires:	libpari23-devel
+BuildRequires:	perl(Carp)
 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}
+Requires:	libpari23%{?_isa} = %(pkg-config --modversion libpari23 2>/dev/null || echo 0)
 
 # Don't "provide" private Perl libs or the redundant unversioned perl(Math::Pari)
 %global __provides_exclude ^(perl\\(Math::Pari\\)$|Pari\\.so)
@@ -42,42 +29,41 @@ 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
+%setup -q -n Math-Pari-%{version}%{extraversion}
 
 # Remove spurious executable permission bits
-chmod -x Changes README Pari.pm PariInit.pm func_codes.h Pari.xs
+chmod -c -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
+pari_int_version=$(pkg-config --modversion libpari23 | perl -pi -e 's/(\d+)\.(\d+)\.(\d+)/sprintf("%d%03d%03d",$1,$2,$3)/e')
+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
+# We want to build the docs and test suite too
 %patch1 -p1
 
-# Need extra stack for intnum test on some arches
-cd pari-%{pari_version}
-%patch2 -p2
-cd -
+# Use <pari/pari.h> as per pari upstream documentation
+%patch2
 
 %build
+paridir=$(pkg-config --variable=paridir libpari23)
 perl Makefile.PL \
 	INSTALLDIRS=vendor \
-	OPTIMIZE="-I%{_includedir}/pari %{optflags}" \
-	parilib="-lpari"
+	OPTIMIZE="$(pkg-config --cflags-only-I libpari23) -I${paridir}/src %{optflags}" \
+	paridir="${paridir}" \
+	parilib="$(pkg-config --libs libpari23)"
 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
@@ -90,6 +76,13 @@ make test
 %exclude %{_mandir}/man3/Math::libPARI.dumb.3pm*
 
 %changelog
+* Wed Jun 13 2012 Paul Howarth <paul@xxxxxxxxxxxx> - 2.010806-14
+- Migrate to build against libpari23, since the new pari 2.5.x is not yet
+  supported upstream (CPAN RT#69295, CPAN RT#70990)
+- BR: perl(Carp)
+- Don't need to remove empty directories from the buildroot
+- Drop %%defattr, redundant since rpm 4.4
+
 * Mon Jun 11 2012 Petr Pisar <ppisar@xxxxxxxxxx> - 2.010806-13
 - Perl 5.16 rebuild
 
diff --git a/sources b/sources
index 220a366..747b530 100644
--- a/sources
+++ b/sources
@@ -1,2 +1 @@
 ccb3da2bdce184a5df3f52cfa8b43a85  Math-Pari-2.01080605.tar.gz
-6077c6db56fdd32e39a06a9bf320e1f7  pari-2.3.5.tar.gz
--
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