PaulHowarth/Blog/2009-10-29

Thursday 29th October 2009

Fedora Project

Upstream for perl-Math-Pari released version 2.010802 yesterday so today I looked at doing the update in Fedora. Something I've been meaning to do for a long time is switch to using the system pari library rather than building it (and an old version of it too - 2.1.7 is the latest version still fully supported for the Perl Math::Pari module, whereas the system pari library is currently version 2.3.4) as part of perl-Math-Pari (which is actually severely frowned upon in Fedora and many other distributions).

The Math::Pari build system does now provide hooks for building against a system library, but if you do this it doesn't include as many tests nor as much documentation as it does if you build the library locally. However, I found it was quite easy to fix this problem by including the library sources even though I was linking against the system pari library, and patching Makefile.PL like this:

--- Math-Pari-2.010802/Makefile.PL.orig 2009-10-29 10:47:15.349216927 +0000
+++ Math-Pari-2.010802/Makefile.PL      2009-10-29 11:12:54.651293844 +0000
@@ -102,11 +102,13 @@
 }
 
 my %opts;
+
+# We want to build the docs and the test suite even though we're using the system pari lib
+build_tests $paridir;                          # Convert the test suite
+make_pod 'libPARI.pod', '-to_pod', $paridir;   # Now the docs
+make_pod 'libPARI.dumb.pod', '-to_dumb_pod', $paridir;
+
 unless ($common::parilib) {
-  build_tests $paridir;                # Convert the test suite
-  make_pod 'libPARI.pod', '-to_pod', $paridir; # Now the docs
-  make_pod 'libPARI.dumb.pod', '-to_dumb_pod', $paridir;
-  # ... and paricfg.h
   %opts = build_paricfg($paridir, $common::do_configure, $pari_version);
 
   if ($ENV{MATH_PARI_REPORT_CODES}) {

I also found that the test suite fell over on 64-bit builds because of missing results files. The pari test suite, when run normally, copies over the expected results from the 32-bit results directory if the expected file in the 64-bit results directory is missing, but that step was missing from the Math::Pari build, so I did it myself:

# If 64-bit test results missing, they should be copied from 32-bit test results
cd pari-%{pari_version}/src/test/in
for test in *; do
        [ ! -f ../64/${test} ] && %{__cp} -a ../32/${test} ../64/${test}
done
cd -

That was enough to get the test suite running and passing with the system pari version 2.3.4.

In order to ensure that the perl-Math-Pari package stays in step with the system pari package, I added a fixed version dependency on the system pari library to the perl-Math-Pari. I've requested watchcommits and watchbugzilla access to pari so I'll know when there's going to be a change.

The only issue now is that the system pari dependency now pulls in lots of unwanted dependencies:

# yum install perl-Math-Pari-2.010802-1.fc12.x86_64.rpm 
Loaded plugins: refresh-packagekit
Setting up Install Process
...
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================
 Package                        Arch       Version              Repository     Size
=====================================================================================
Installing:
 perl-Math-Pari                 x86_64     2.010802-1.fc12 /perl-Math-Pari-2.010802-1.fc12.x86_64 869 k
Installing for dependencies:
 Xaw3d                          x86_64     1.5E-14.fc11         fedora-dvd    170 k
 kpathsea                       x86_64     2007-42.fc11         fedora        118 k
 pari                           x86_64     2.3.4-2.fc11         fedora        1.4 M
 t1lib                          x86_64     5.1.2-3.fc11         fedora        214 k
 texlive                        x86_64     2007-42.fc11         fedora        2.2 M
 texlive-dvips                  x86_64     2007-42.fc11         fedora        200 k
 texlive-texmf                  noarch     2007-28.fc11         fedora        3.5 M
 texlive-texmf-dvips            noarch     2007-28.fc11         fedora        392 k
 texlive-texmf-errata           noarch     2007-6.fc11          fedora        4.8 k
 texlive-texmf-errata-dvips     noarch     2007-6.fc11          fedora        4.9 k
 texlive-texmf-errata-fonts     noarch     2007-6.fc11          fedora        5.0 k
 texlive-texmf-fonts            noarch     2007-28.fc11         fedora         57 M
 xdvik                          x86_64     22.84.14-6.fc11      updates       735 k

Transaction Summary
=====================================================================================
Install      14 Package(s)
Upgrade       0 Package(s)

Total size: 66 M
Total download size: 66 M
Is this ok [y/N]: n
Exiting on user Command
Complete!

It's even worse on a system with no X libraries. So I've added my voice to the request to split the libraries in pari off to a subpackage in Bug #530565.


Recent