python-math.spec 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. ##
  2. ## python-math.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2017 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 versions
  24. %define V_python 2.7
  25. %define V_numpy 1.12.0b1
  26. %define V_scipy 1.0.0
  27. %define V_theano 1.0.0rc1
  28. # package information
  29. Name: python-math
  30. Summary: Python Modules for Mathematics
  31. URL: http://www.python.org/
  32. Vendor: Python Community
  33. Packager: OpenPKG Foundation e.V.
  34. Distribution: OpenPKG Community
  35. Class: BASE
  36. Group: Language
  37. License: GPL
  38. Version: %{V_python}
  39. Release: 20171101
  40. # list of sources
  41. Source0: https://files.pythonhosted.org/packages/source/n/numpy/numpy-%{V_numpy}.tar.gz
  42. Source1: https://files.pythonhosted.org/packages/source/s/scipy/scipy-%{V_scipy}.tar.gz
  43. Source2: https://files.pythonhosted.org/packages/source/T/Theano/Theano-%{V_theano}.tar.gz
  44. # build information
  45. BuildPreReq: OpenPKG, openpkg >= 20160101, python >= %{V_python}, gcc, gcc::with_fortran = yes
  46. PreReq: OpenPKG, openpkg >= 20160101, python >= %{V_python}, gcc, gcc::with_fortran = yes
  47. BuildPreReq: openblas
  48. PreReq: openblas
  49. %description
  50. This is a set of Python extension modules for mathematics.
  51. %track
  52. prog python-math:numpy = {
  53. version = %{V_numpy}
  54. url = https://pypi.python.org/pypi/numpy
  55. regex = numpy-(__VER__)\.tar\.gz
  56. }
  57. prog python-math:scipy = {
  58. version = %{V_scipy}
  59. url = https://pypi.python.org/pypi/scipy
  60. regex = scipy-(__VER__)\.tar\.gz
  61. }
  62. prog python-math:theano = {
  63. version = %{V_theano}
  64. url = https://pypi.python.org/pypi/Theano
  65. regex = Theano-(__VER__)\.tar\.gz
  66. }
  67. %prep
  68. %setup -q -c
  69. %setup -q -T -D -a 1
  70. %setup -q -T -D -a 2
  71. %build
  72. %install
  73. ( cd numpy-%{V_numpy}
  74. ( echo "[openblas]"
  75. echo "library_dirs = %{l_prefix}/lib"
  76. echo "include_dirs = %{l_prefix}/include"
  77. echo "runtime_library_dirs = %{l_prefix}/lib"
  78. echo "search_static_first = true"
  79. echo "extra_link_args = -lgfortran -lquadmath -lm"
  80. echo "openblas_libs = openblas"
  81. ) >site.cfg
  82. %{l_prefix}/bin/python \
  83. setup.py install \
  84. --root=$RPM_BUILD_ROOT \
  85. --prefix=%{l_prefix}
  86. ) || exit $?
  87. ( cd scipy-%{V_scipy}
  88. %{l_prefix}/bin/python \
  89. setup.py install \
  90. --root=$RPM_BUILD_ROOT \
  91. --prefix=%{l_prefix}
  92. ) || exit $?
  93. ( cd Theano-%{V_theano}
  94. %{l_prefix}/bin/python \
  95. setup.py install \
  96. --root=$RPM_BUILD_ROOT \
  97. --prefix=%{l_prefix}
  98. chmod 644 $RPM_BUILD_ROOT%{l_prefix}/lib/python/site-packages/Theano-*.egg-info/PKG-INFO
  99. ) || exit $?
  100. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  101. %files -f files
  102. %clean