OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   22-Dec-2006 15:37:32
  Branch: HEAD                             Handle: 2006122214373200

  Added files:
    openpkg-src/pari        pari.patch
  Modified files:
    openpkg-src/pari        pari.spec

  Log:
    perl is always required even for building PARI/GP itself; add optional
    Math-Pari Perl bindings

  Summary:
    Revision    Changes     Path
    1.1         +32 -0      openpkg-src/pari/pari.patch
    1.33        +48 -9      openpkg-src/pari/pari.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/pari/pari.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.1 pari.patch
  --- /dev/null 2006-12-22 15:36:43 +0100
  +++ pari.patch        2006-12-22 15:37:32 +0100
  @@ -0,0 +1,32 @@
  +Index: Makefile.PL
  +--- Makefile.PL.orig 2006-10-25 22:36:34 +0200
  ++++ Makefile.PL      2006-12-22 15:24:00 +0100
  +@@ -23,8 +23,9 @@
  + grep {/^pari_tgz=(.*?)[\/\\]?$/i     and $parisrc = $1}          @ARGV;
  + grep {/^force_download$/i    and $force_download = 1}    @ARGV;
  + grep {/^parilib=(.*)$/i              and $common::parilib = $1}  @ARGV;
  ++grep {/^parihdr=(.*)$/i              and $common::parihdr = $1}  @ARGV;
  + 
  [EMAIL PROTECTED] = grep 
!/^((machine|paridir|pari_tgz|parilib)=.*|configure|force_download)$/i, @ARGV;
  [EMAIL PROTECTED] = grep 
!/^((machine|paridir|pari_tgz|parilib|parihdr)=.*|configure|force_download)$/i, 
@ARGV;
  + 
  + $paridir   = find_pari_dir() unless defined $paridir or $parisrc or 
$force_download;
  + ($paridir) = download_and_patch_pari($parisrc, $force_download)
  +@@ -44,7 +45,7 @@
  + EOP
  + 
  + if ($common::parilib) {
  +-  $pari_version = '2001004';        # XXXX How to get a correct one?
  ++  $pari_version = '2003001';        # XXXX How to get a correct one?
  +   $define = '-DNO_HIGHLEVEL_PARI';
  +   print <<EOP;
  + Trying to use existing PARI library (at $common::parilib)
  +@@ -151,7 +152,7 @@
  + # XXXX otherwise segfaults trying to install highlevel functions???
  + $define .= ' -DNO_HIGHLEVEL_PARI' if $pari_version >= 2003000;
  + 
  +-my $extra_inc = extra_includes($paridir);
  ++my $extra_inc = $common::parihdr . " " . extra_includes($paridir);
  + 
  + # See lib/ExtUtils/MakeMaker.pm for details of how to influence
  + # the contents of the Makefile being created.
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/pari/pari.spec
  ============================================================================
  $ cvs diff -u -r1.32 -r1.33 pari.spec
  --- openpkg-src/pari/pari.spec        13 Oct 2006 17:31:26 -0000      1.32
  +++ openpkg-src/pari/pari.spec        22 Dec 2006 14:37:32 -0000      1.33
  @@ -25,6 +25,7 @@
   #   package version
   %define       V_major 2.3
   %define       V_minor 1
  +%define       V_perl  2.010709
   
   #   package information
   Name:         pari
  @@ -37,28 +38,36 @@
   Group:        Algorithm
   License:      GPL
   Version:      %{V_major}.%{V_minor}
  -Release:      20061013
  +Release:      20061222
  +
  +#   package options
  +%option       with_perl  no
   
   #   list of sources
   Source0:      
http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-%{version}.tar.gz
  +Source1:      
http://www.cpan.org/modules/by-module/Math/Math-Pari-%{V_perl}.tar.gz
  +Patch0:       pari.patch
   
   #   build information
   Prefix:       %{l_prefix}
   BuildRoot:    %{l_buildroot}
  -BuildPreReq:  OpenPKG, openpkg >= 20040130, make, gcc
  +BuildPreReq:  OpenPKG, openpkg >= 20040130, make, gcc, perl
   PreReq:       OpenPKG, openpkg >= 20040130
   BuildPreReq:  gmp, readline, ncurses
   PreReq:       gmp, readline, ncurses
  +%if "%{with_perl}" == "yes"
  +BuildPreReq:  perl, perl-openpkg
  +PreReq:       perl
  +%endif
   AutoReq:      no
   AutoReqProv:  no
   
   %description
  -    PARI-GP is a software package for computer-aided number theory. It
  -    consists of a C library, libpari (with optional assembler cores for
  -    some popular architectures), and of the programmable interactive gp
  -    calculator. While you can write your own libpari-based programs,
  -    many people just start up a gp session, or have gp execute their
  -    scripts.
  +    PARI-GP is a software package for computer-aided number theory.
  +    It consists of the C library libpari and of the programmable
  +    interactive gp(1) calculator. While you can write your own
  +    libpari-based programs, many people just start up a gp(1) session,
  +    or have gp(1) execute their scripts.
   
   %track
       prog pari = {
  @@ -66,9 +75,17 @@
           url       = http://pari.math.u-bordeaux.fr/download.html
           regex     = pari-(\d+\.\d+\.\d+)\.(tgz|tar\.gz)
       }
  +    prog pari:Math-Pari = {
  +        version   = %{V_perl}
  +        url       = http://www.cpan.org/modules/by-module/Math/
  +        regex     = Math-Pari-(__VER__)\.tar\.gz
  +    }
   
   %prep
       %setup -q
  +    %setup -q -D -T -a 1
  +    chmod u+w Math-Pari-%{V_perl}/*
  +    %patch -p0 -d Math-Pari-%{V_perl}
       %{l_shtool} subst \
           -e 's;^\(install:.*\) install-doc \(.*\);\1 \2;' \
           config/Makefile.SH
  @@ -88,6 +105,21 @@
           --with-ncurses=%{l_prefix} \
           --static
       %{l_make} %{l_mflags -O} gp
  +%if "%{with_perl}" == "yes"
  +    ( cd `./config/objdir`
  +      %{l_make} %{l_mflags -O} libpari.a
  +    ) || exit $?
  +    %{l_prefix}/bin/perl-openpkg prepare
  +    paridir=".."
  +    parihdr="-I$paridir/`./config/objdir`"
  +    parilib="-L$paridir/`./config/objdir` -lpari"
  +    %{l_prefix}/bin/perl-openpkg \
  +        -d Math-Pari-%{V_perl} \
  +        --args "paridir=\"$paridir\"" \
  +        --args "parihdr=\"$parihdr\"" \
  +        --args "parilib=\"$parilib\"" \
  +        configure build
  +%endif
   
   %install
       rm -rf $RPM_BUILD_ROOT
  @@ -101,7 +133,14 @@
       rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/tex2mail
       rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/tex2mail.1
       strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  -    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  +%if "%{with_perl}" == "yes"
  +    %{l_prefix}/bin/perl-openpkg -d Math-Pari-%{V_perl} install
  +    %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  +%else
  +    >perl-openpkg-files
  +%endif
  +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  +        %{l_files_std} `cat perl-openpkg-files`
   
   %files -f files
   
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     openpkg-cvs@openpkg.org

Reply via email to