## ## python-math.spec -- OpenPKG RPM Package Specification ## Copyright (c) 2000-2020 OpenPKG Project ## ## Permission to use, copy, modify, and distribute this software for ## any purpose with or without fee is hereby granted, provided that ## the above copyright notice and this permission notice appear in all ## copies. ## ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ## SUCH DAMAGE. ## # package versions %define V_python 3.8 %define V_numpy 1.18.1 %define V_scipy 1.4.1 %define V_scikit 0.22.1 %define V_theano 1.0.4 %define V_pandas 1.0.1 # package information Name: python-math Summary: Python Modules for Mathematics URL: http://www.python.org/ Vendor: Python Community Packager: OpenPKG Project Distribution: OpenPKG Community Class: BASE Group: Language License: GPL Version: %{V_python} Release: 20200206 # list of sources Source0: https://files.pythonhosted.org/packages/source/n/numpy/numpy-%{V_numpy}.zip Source1: https://files.pythonhosted.org/packages/source/s/scipy/scipy-%{V_scipy}.tar.gz Source2: https://files.pythonhosted.org/packages/source/s/scikit-learn/scikit-learn-%{V_scikit}.tar.gz Source3: https://files.pythonhosted.org/packages/source/T/Theano/Theano-%{V_theano}.tar.gz Source4: https://files.pythonhosted.org/packages/source/p/pandas/pandas-%{V_pandas}.tar.gz Patch0: python-math.patch # build information BuildPreReq: OpenPKG, openpkg >= 20160101 PreReq: OpenPKG, openpkg >= 20160101 BuildPreReq: gcc, gcc::with_fortran = yes PreReq: gcc, gcc::with_fortran = yes BuildPreReq: python >= %{V_python}, python-sys PreReq: python >= %{V_python}, python-sys BuildPreReq: openblas PreReq: openblas %description This is a set of Python extension modules for mathematics. %track prog python-math:numpy = { version = %{V_numpy} url = https://pypi.python.org/pypi/numpy regex = numpy-(__VER__)\.zip } prog python-math:scipy = { version = %{V_scipy} url = https://pypi.python.org/pypi/scipy regex = scipy-(__VER__)\.tar\.gz } prog python-math:scikit = { version = %{V_scikit} url = https://pypi.python.org/pypi/scikit-learn regex = scikit-learn-(__VER__)\.tar\.gz } prog python-math:theano = { version = %{V_theano} url = https://pypi.python.org/pypi/Theano regex = Theano-(__VER__)\.tar\.gz } prog python-math:pandas = { version = %{V_pandas} url = https://pypi.python.org/pypi/pandas regex = pandas-(__VER__)\.tar\.gz } %prep %setup -q -c %setup -q -T -D -a 1 %setup -q -T -D -a 2 %setup -q -T -D -a 3 %setup -q -T -D -a 4 %patch -p0 %build %install export PYTHONPATH=$RPM_BUILD_ROOT%{l_prefix}/lib/python%{V_python}/site-packages ( echo "#!/bin/sh" echo "exec %{l_prefix}/bin/gcc \"\$@\" -lgfortran -lquadmath -lm" ) >gcc chmod a+x gcc PATH=`pwd`:$PATH HOME=`pwd` ( cd numpy-%{V_numpy} ( echo "[openblas]" echo "library_dirs = %{l_prefix}/lib" echo "include_dirs = %{l_prefix}/include" echo "runtime_library_dirs = %{l_prefix}/lib" echo "extra_link_args = -lgfortran -lquadmath -lm" echo "search_static_first = true" ) >site.cfg %{l_prefix}/bin/python \ setup.py install \ --root=$RPM_BUILD_ROOT \ --prefix=%{l_prefix} ) || exit $? ( cd scipy-%{V_scipy} %{l_prefix}/bin/python \ setup.py install \ --root=$RPM_BUILD_ROOT \ --prefix=%{l_prefix} ) || exit $? ( cd scikit-learn-%{V_scikit} %{l_prefix}/bin/python \ setup.py install \ --root=$RPM_BUILD_ROOT \ --prefix=%{l_prefix} ) || exit $? ( cd Theano-%{V_theano} %{l_prefix}/bin/python \ setup.py install \ --root=$RPM_BUILD_ROOT \ --prefix=%{l_prefix} chmod 644 $RPM_BUILD_ROOT%{l_prefix}/lib/python*/site-packages/Theano-*.egg-info/PKG-INFO ) || exit $? ( cd pandas-%{V_pandas} %{l_prefix}/bin/python \ setup.py install \ --root=$RPM_BUILD_ROOT \ --prefix=%{l_prefix} ) || exit $? %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} %files -f files %clean