pari.spec 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. ##
  2. ## pari.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_major 2.3
  25. %define V_minor 3
  26. %define V_perl 2.010800
  27. # package information
  28. Name: pari
  29. Summary: GP/PARI Number-Theory Library
  30. URL: http://pari.math.u-bordeaux.fr/
  31. Vendor: Henri Cohen et al.
  32. Packager: OpenPKG Foundation e.V.
  33. Distribution: OpenPKG Community
  34. Class: PLUS
  35. Group: Algorithm
  36. License: GPL
  37. Version: %{V_major}.%{V_minor}
  38. Release: 20080427
  39. # package options
  40. %option with_perl no
  41. # list of sources
  42. Source0: http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-%{version}.tar.gz
  43. Source1: http://www.cpan.org/modules/by-module/Math/Math-Pari-%{V_perl}.tar.gz
  44. Patch0: pari.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc, perl
  49. PreReq: OpenPKG, openpkg >= 20040130
  50. BuildPreReq: gmp, readline, ncurses
  51. PreReq: gmp, readline, ncurses
  52. %if "%{with_perl}" == "yes"
  53. BuildPreReq: perl, perl-openpkg
  54. PreReq: perl
  55. %endif
  56. AutoReq: no
  57. AutoReqProv: no
  58. %description
  59. PARI-GP is a software package for computer-aided number theory.
  60. It consists of the C library libpari and of the programmable
  61. interactive gp(1) calculator. While you can write your own
  62. libpari-based programs, many people just start up a gp(1) session,
  63. or have gp(1) execute their scripts.
  64. %track
  65. prog pari = {
  66. version = %{version}
  67. url = http://pari.math.u-bordeaux.fr/download.html
  68. regex = pari-(\d+\.\d+\.\d+)\.(tgz|tar\.gz)
  69. }
  70. prog pari:Math-Pari = {
  71. version = %{V_perl}
  72. url = http://www.cpan.org/modules/by-module/Math/
  73. regex = Math-Pari-(__VER__)\.tar\.gz
  74. }
  75. %prep
  76. %setup -q
  77. %setup -q -D -T -a 1
  78. chmod u+w Math-Pari-%{V_perl}/*
  79. %patch -p0 -d Math-Pari-%{V_perl}
  80. %{l_shtool} subst \
  81. -e 's;^\(install:.*\) install-doc \(.*\);\1 \2;' \
  82. config/Makefile.SH
  83. %{l_shtool} subst \
  84. -e 's;}; double y=log2(10)};' \
  85. config/has_exp2.c
  86. %build
  87. CC="%{l_cc}" \
  88. CFLAGS="%{l_cflags -O}" \
  89. ./Configure \
  90. --prefix=%{l_prefix} \
  91. --mandir=%{l_prefix}/man/man1 \
  92. --datadir=%{l_prefix}/share/pari/galdata \
  93. --with-gmp=%{l_prefix} \
  94. --with-readline=%{l_prefix} \
  95. --with-ncurses=%{l_prefix} \
  96. --static
  97. %{l_make} %{l_mflags -O} gp
  98. %if "%{with_perl}" == "yes"
  99. ( cd `./config/objdir`
  100. %{l_make} %{l_mflags -O} libpari.a
  101. ) || exit $?
  102. %{l_prefix}/bin/perl-openpkg prepare
  103. paridir=".."
  104. parihdr="-I$paridir/`./config/objdir`"
  105. parilib="-L$paridir/`./config/objdir` -lpari %{l_ldflags} -lgmp"
  106. %{l_prefix}/bin/perl-openpkg \
  107. -d Math-Pari-%{V_perl} \
  108. --args "paridir=\"$paridir\"" \
  109. --args "parihdr=\"$parihdr\"" \
  110. --args "parilib=\"$parilib\"" \
  111. configure build
  112. %endif
  113. %install
  114. rm -rf $RPM_BUILD_ROOT
  115. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  116. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/gp
  117. mv $RPM_BUILD_ROOT%{l_prefix}/bin/gp-%{V_major} \
  118. $RPM_BUILD_ROOT%{l_prefix}/bin/gp
  119. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/gp.1
  120. mv $RPM_BUILD_ROOT%{l_prefix}/man/man1/gp-%{V_major}.1 \
  121. $RPM_BUILD_ROOT%{l_prefix}/man/man1/gp.1
  122. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/tex2mail
  123. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/tex2mail.1
  124. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  125. %if "%{with_perl}" == "yes"
  126. %{l_prefix}/bin/perl-openpkg -d Math-Pari-%{V_perl} install
  127. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  128. %else
  129. >perl-openpkg-files
  130. %endif
  131. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  132. %{l_files_std} `cat perl-openpkg-files`
  133. %files -f files
  134. %clean
  135. rm -rf $RPM_BUILD_ROOT