diff --git a/.scipy.metadata b/.scipy.metadata new file mode 100644 index 0000000..e4a6c6d --- /dev/null +++ b/.scipy.metadata @@ -0,0 +1 @@ +72fc43def904105fd93b21283bdaa559c726154d SOURCES/scipy-0.12.1.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/change-wd-to-builddir.patch b/SOURCES/change-wd-to-builddir.patch new file mode 100644 index 0000000..28e043d --- /dev/null +++ b/SOURCES/change-wd-to-builddir.patch @@ -0,0 +1,25 @@ +diff --git a/scipy/weave/build_tools.py b/scipy/weave/build_tools.py +index b1a8cfc..904dbba 100644 +--- a/scipy/weave/build_tools.py ++++ b/scipy/weave/build_tools.py +@@ -266,6 +266,11 @@ def build_extension(module_path,compiler_name='',build_dir=None, + old_SysExit = builtin.__dict__['SystemExit'] + builtin.__dict__['SystemExit'] = CompileError + ++ # change current working directory to 'build_dir' so compiler won't ++ # pick up anything by mistake ++ oldcwd = os.path.abspath(os.getcwd()) ++ os.chdir(build_dir) ++ + # distutils for MSVC messes with the environment, so we save the + # current state and restore them afterward. + import copy +@@ -277,6 +282,8 @@ def build_extension(module_path,compiler_name='',build_dir=None, + os.environ = environ + # restore SystemExit + builtin.__dict__['SystemExit'] = old_SysExit ++ # restore working directory to one before setup ++ os.chdir(oldcwd) + t2 = time.time() + + if verbose == 1: diff --git a/SOURCES/scipy-gerqf.patch b/SOURCES/scipy-gerqf.patch new file mode 100644 index 0000000..cf93c0e --- /dev/null +++ b/SOURCES/scipy-gerqf.patch @@ -0,0 +1,12 @@ +diff -up scipy-0.12.0/scipy/linalg/flapack.pyf.src.gerqf scipy-0.12.0/scipy/linalg/flapack.pyf.src +--- scipy-0.12.0/scipy/linalg/flapack.pyf.src.gerqf 2013-04-06 10:10:35.000000000 -0600 ++++ scipy-0.12.0/scipy/linalg/flapack.pyf.src 2013-04-15 17:03:37.290059000 -0600 +@@ -650,7 +650,7 @@ interface + dimension(m,n),intent(in,out,copy,out=qr,aligned8) :: a + dimension(MIN(m,n)),intent(out) :: tau + +- integer optional,intent(in),depend(n),check(lwork>=m||lwork==-1) :: lwork=3*m ++ integer optional,intent(in),depend(m),check(lwork>=m||lwork==-1) :: lwork=3*m + dimension(MAX(lwork,1)),intent(out),depend(lwork) :: work + integer intent(out) :: info + end subroutine gerqf diff --git a/SOURCES/use-argument-build_dir.patch b/SOURCES/use-argument-build_dir.patch new file mode 100644 index 0000000..ff0ca8f --- /dev/null +++ b/SOURCES/use-argument-build_dir.patch @@ -0,0 +1,16 @@ +diff --git a/scipy/weave/build_tools.py b/scipy/weave/build_tools.py +index b990f33..57a5a8e 100644 +--- a/scipy/weave/build_tools.py ++++ b/scipy/weave/build_tools.py +@@ -228,7 +228,7 @@ def build_extension(module_path,compiler_name = '',build_dir = None, + + # configure temp and build directories + temp_dir = configure_temp_dir(temp_dir) +- build_dir = configure_build_dir(module_dir) ++ build_dir = configure_build_dir(build_dir or module_dir) + + # dag. We keep having to add directories to the path to keep + # object files separated from each other. gcc2.x and gcc3.x C++ +-- +1.8.1.2 + diff --git a/SOURCES/use-sha-256-instead-of-md5.patch b/SOURCES/use-sha-256-instead-of-md5.patch new file mode 100644 index 0000000..5f571c9 --- /dev/null +++ b/SOURCES/use-sha-256-instead-of-md5.patch @@ -0,0 +1,147 @@ +diff --git a/doc/source/tutorial/weave.rst b/doc/source/tutorial/weave.rst +index 12cff19..7a481db 100644 +--- a/doc/source/tutorial/weave.rst ++++ b/doc/source/tutorial/weave.rst +@@ -885,11 +885,11 @@ Microsoft VC++ installed. + When ``inline`` is first run, you'll notice that pause and some trash printed + to the screen. The "trash" is acutually part of the compilers output that + distutils does not supress. The name of the extension file, +-``sc_bighonkingnumber.cpp``, is generated from the md5 check sum of the C/C++ +-code fragment. On Unix or windows machines with only gcc installed, the trash +-will not appear. On the second call, the code fragment is not compiled since +-it already exists, and only the answer is returned. Now kill the interpreter +-and restart, and run the same code with a different string. ++``sc_bighonkingnumber.cpp``, is generated from the SHA-256 check sum of the ++C/C++ code fragment. On Unix or windows machines with only gcc installed, the ++trash will not appear. On the second call, the code fragment is not compiled ++since it already exists, and only the answer is returned. Now kill the ++interpreter and restart, and run the same code with a different string. + + :: + +@@ -1151,8 +1151,8 @@ A quick look at the code + ------------------------ + + ``weave`` generates a C++ file holding an extension function for each +-``inline`` code snippet. These file names are generated using from the md5 +-signature of the code snippet and saved to a location specified by the ++``inline`` code snippet. These file names are generated using from the ++SHA-256 signature of the code snippet and saved to a location specified by the + PYTHONCOMPILED environment variable (discussed later). The cpp files are + generally about 200-400 lines long and include quite a few functions to + support type conversions, etc. However, the actual compiled function is +@@ -2401,10 +2401,10 @@ been built before. + + .. note:: + If we were willing to always pay the penalty of building the C++ +- code for a module, we could store the md5 checksum of the C++ code ++ code for a module, we could store the SHA-256 checksum of the C++ code + along with some information about the compiler, platform, etc. Then, + ``ext_module.compile()`` could try importing the module before it +- actually compiles it, check the md5 checksum and other meta-data in ++ actually compiles it, check the SHA-256 checksum and other meta-data in + the imported module with the meta-data of the code it just produced + and only compile the code if the module didn't exist or the + meta-data didn't match. This would reduce the above code to:: +diff --git a/scipy/weave/accelerate_tools.py b/scipy/weave/accelerate_tools.py +index 935ca23..1627447 100644 +--- a/scipy/weave/accelerate_tools.py ++++ b/scipy/weave/accelerate_tools.py +@@ -12,7 +12,7 @@ from __future__ import absolute_import, print_function + + from types import InstanceType, XRangeType + import inspect +-import scipy.weave.md5_load as md5 ++from hashlib import sha256 + import scipy.weave as weave + from numpy.testing import assert_ + +@@ -342,7 +342,7 @@ class accelerate(object): + return fast + + def identifier(self,signature): +- # Build an MD5 checksum ++ # Build a SHA-256 checksum + f = self.function + co = f.func_code + identifier = str(signature)+\ +@@ -350,7 +350,7 @@ class accelerate(object): + str(co.co_consts)+\ + str(co.co_varnames)+\ + co.co_code +- return 'F'+md5.md5(identifier).hexdigest() ++ return 'F' + sha256(identifier).hexdigest() + + def accelerate(self,signature,identifier): + P = Python2CXX(self.function,signature,name=identifier) +diff --git a/scipy/weave/build_tools.py b/scipy/weave/build_tools.py +index c0f8baa..27d27a4 100644 +--- a/scipy/weave/build_tools.py ++++ b/scipy/weave/build_tools.py +@@ -234,7 +234,7 @@ def build_extension(module_path,compiler_name = '',build_dir = None, + # dag. We keep having to add directories to the path to keep + # object files separated from each other. gcc2.x and gcc3.x C++ + # object files are not compatible, so we'll stick them in a sub +- # dir based on their version. This will add an md5 check sum ++ # dir based on their version. This will add a SHA-256 check sum + # of the compiler binary to the directory name to keep objects + # from different compilers in different locations. + +diff --git a/scipy/weave/catalog.py b/scipy/weave/catalog.py +index 274ed41..bb15f26 100644 +--- a/scipy/weave/catalog.py ++++ b/scipy/weave/catalog.py +@@ -84,13 +84,13 @@ def getmodule(object): + def expr_to_filename(expr): + """ Convert an arbitrary expr string to a valid file name. + +- The name is based on the md5 check sum for the string and ++ The name is based on the SHA-256 check sum for the string and + Something that was a little more human readable would be + nice, but the computer doesn't seem to care. + """ +- import scipy.weave.md5_load as md5 ++ from hashlib import sha256 + base = 'sc_' +- return base + md5.new(expr).hexdigest() ++ return base + sha256(expr).hexdigest() + + def unique_file(d,expr): + """ Generate a unqiue file name based on expr in directory d +diff --git a/scipy/weave/md5_load.py b/scipy/weave/md5_load.py +deleted file mode 100644 +index 80594ad..0000000 +--- a/scipy/weave/md5_load.py ++++ /dev/null +@@ -1,11 +0,0 @@ +-# Import correct md5, irrespective of the Python version +-# +-# `hashlib` was introduced in 2.5, deprecating `md5` +-from __future__ import absolute_import, print_function +- +-try: +- from hashlib import * +-except ImportError: +- from md5 import * +- +-new = md5 +diff --git a/scipy/weave/platform_info.py b/scipy/weave/platform_info.py +index df67ca5..f7d7490 100644 +--- a/scipy/weave/platform_info.py ++++ b/scipy/weave/platform_info.py +@@ -89,13 +89,13 @@ def compiler_exe_path(exe_name): + return exe_path + + def check_sum(file): +- import scipy.weave.md5_load as md5 ++ from hashlib import sha256 + try: + f = open(file,'r') + bytes = f.read(-1) + except IOError: + bytes = '' +- chk_sum = md5.md5(bytes) ++ chk_sum = sha256(bytes) + return chk_sum.hexdigest() + + def get_compiler_dir(compiler_name): diff --git a/SPECS/scipy.spec b/SPECS/scipy.spec new file mode 100644 index 0000000..70c335b --- /dev/null +++ b/SPECS/scipy.spec @@ -0,0 +1,360 @@ +%global with_python3 0 +%{?filter_setup: +%filter_provides_in %{python_sitearch}.*\.so$ +##filter_provides_in #{python3_sitearch}.*\.so$ +%filter_setup +} + +Summary: Scipy: Scientific Tools for Python +Name: scipy +Version: 0.12.1 +Release: 1%{?dist} + +Group: Development/Libraries +# BSD -- whole package except: +# Boost -- scipy/special/cephes/scipy_iv.c +# Public Domain -- scipy/odr/__odrpack.c +License: BSD and Boost and Public Domain +Url: http://www.scipy.org +Source0: http://downloads.sourceforge.net/scipy/%{name}-%{version}.tar.gz +# Fix definition on gerqf that caused test segfault +Patch0: scipy-gerqf.patch +Patch1: use-argument-build_dir.patch +Patch2: change-wd-to-builddir.patch +Patch3: use-sha-256-instead-of-md5.patch + +BuildRequires: numpy, python2-devel,f2py +BuildRequires: python-six +BuildRequires: fftw-devel, blas-devel, lapack-devel, suitesparse-devel +BuildRequires: atlas-devel +BuildRequires: gcc-gfortran, swig +Requires: numpy, python,f2py +Requires: python-six + +%if 0%{?with_python3} +BuildRequires: python3-numpy, python3-devel, python3-f2py +BuildRequires: python3-setuptools +BuildRequires: python3-nose +BuildRequires: python3-six +%endif + +%description +Scipy is open-source software for mathematics, science, and +engineering. The core library is NumPy which provides convenient and +fast N-dimensional array manipulation. The SciPy library is built to +work with NumPy arrays, and provides many user-friendly and efficient +numerical routines such as routines for numerical integration and +optimization. Together, they run on all popular operating systems, are +quick to install, and are free of charge. NumPy and SciPy are easy to +use, but powerful enough to be depended upon by some of the world's +leading scientists and engineers. + + +%if 0%{?with_python3} +%package -n python3-scipy +Summary: Scipy: Scientific Tools for Python +Group: Development/Libraries +License: BSD and LGPLv2+ +Requires: python3-numpy, python3-f2py +Requires: python3-six +%description -n python3-scipy +Scipy is open-source software for mathematics, science, and +engineering. The core library is NumPy which provides convenient and +fast N-dimensional array manipulation. The SciPy library is built to +work with NumPy arrays, and provides many user-friendly and efficient +numerical routines such as routines for numerical integration and +optimization. Together, they run on all popular operating systems, are +quick to install, and are free of charge. NumPy and SciPy are easy to +use, but powerful enough to be depended upon by some of the world's +leading scientists and engineers. + +%endif # with _python3 + +%prep +%setup -q +%patch0 -p1 -b .gerqf +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 + +# Bundled libs +rm scipy/lib/six.py +find -name \*.py | xargs sed -i -e 's/scipy\.lib\.six/six/' +cat > site.cfg << EOF + +[amd] +library_dirs = %{_libdir} +include_dirs = /usr/include/suitesparse +amd_libs = amd + +[umfpack] +library_dirs = %{_libdir} +include_dirs = /usr/include/suitesparse +umfpack_libs = umfpack +EOF + + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif + +%build +%if 0%{?with_python3} +pushd %{py3dir} +env CFLAGS="$RPM_OPT_FLAGS" ATLAS=%{_libdir}/atlas FFTW=%{_libdir} BLAS=%{_libdir} LAPACK=%{_libdir} python3 setup.py config_fc --fcompiler=gnu95 --noarch build +popd +%endif # with _python3 + +env CFLAGS="$RPM_OPT_FLAGS" ATLAS=%{_libdir}/atlas FFTW=%{_libdir} BLAS=%{_libdir} LAPACK=%{_libdir} python setup.py config_fc --fcompiler=gnu95 --noarch build + + + +%install +rm -rf $RPM_BUILD_ROOT +# first install python3 so the binaries are overwritten by the python2 ones +%if 0%{?with_python3} +pushd %{py3dir} +env CFLAGS="$RPM_OPT_FLAGS" ATLAS=%{_libdir}/atlas FFTW=%{_libdir} BLAS=%{_libdir} LAPACK=%{_libdir} python3 setup.py install --root=$RPM_BUILD_ROOT +popd +%endif # with_python3 + +env CFLAGS="$RPM_OPT_FLAGS" ATLAS=%{_libdir}/atlas FFTW=%{_libdir} BLAS=%{_libdir} LAPACK=%{_libdir} python setup.py install --root=$RPM_BUILD_ROOT + + +%check +%if 0%{?with_python3} +pushd %{py3dir} +mkdir test +cd test +PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitearch} python3 -c "import scipy; scipy.test('full')" +popd +%endif # with_python3 + +mkdir test +cd test +PYTHONPATH=$RPM_BUILD_ROOT%{python_sitearch} python -c "import scipy; scipy.test('full', verbose=3)" || true + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%doc LICENSE.txt +%{python_sitearch}/scipy +%{python_sitearch}/*.egg-info + + +%if 0%{?with_python3} +%files -n python3-scipy +%doc LICENSE.txt +%{python3_sitearch}/scipy +%{python3_sitearch}/*.egg-info +%endif # with_python3 + +%changelog +* Wed Oct 16 2013 Tomas Tomecek - 0.12.1-1 +- Update to 0.12.1 - fixes CVE-2013-4251 (rhbz#997579) +- change working directory to build directory when building ext (rhbz#916695) +- use SHA-256 instead of md5 -- FIPS mode (rhbz#877920) +- unbundle python-six (bug rhbz#1019642) + +* Thu Oct 03 2013 Tomas Tomecek - 0.12.0-6 +- rebuilt due to a bug in gcc causing segfault on s390x (rhbz#1012870 rhbz#1012286) + +* Wed Sep 25 2013 Tomas Tomecek - 0.12.0-5 +- rebuilt with atlas 3.10 (rhbz#1009070) + +* Tue Jul 23 2013 Tomas Tomecek - 0.12.0-4 +- Add patch to use build_dir argument in build_extension +- Fix rpmlint warnings +- License Updated +- Don't build with python3 + +* Wed May 15 2013 Orion Poplawski - 0.12.0-3 +- Remove old ufsparse references, use suitesparse +- Spec cleanup + +* Mon Apr 15 2013 Orion Poplawski - 0.12.0-2 +- Add patch to fix segfaul in test of sgeqrf + +* Wed Apr 10 2013 Orion Poplawski - 0.12.0-1 +- Update to 0.12.0 final +- No longer remove weave from python3 build + +* Sat Feb 16 2013 Orion Poplawski - 0.12.0-0.1.b1 +- Update to 0.12.0b1 +- Drop upstreamed linalg patch + +* Wed Feb 13 2013 Orion Poplawski - 0.11.0-4 +- Add patch from upstream to fix python3.3 issues in linalg routines + +* Tue Feb 12 2013 Orion Poplawski - 0.11.0-3 +- Disable python3 tests for now + +* Mon Oct 8 2012 Orion Poplawski - 0.11.0-2 +- Add requires python3-numpy, python3-f2py for python3-scipy (bug 863755) + +* Sun Sep 30 2012 Orion Poplawski - 0.11.0-1 +- Update to 0.11.0 final + +* Thu Aug 23 2012 Orion Poplawski - 0.11.0-0.1.rc2 +- Update to 0.11.0rc2 + +* Mon Aug 6 2012 Orion Poplawski - 0.10.1-4 +- Rebuild for python 3.3 + +* Fri Aug 3 2012 David Malcolm - 0.10.1-3 +- remove rhel logic from with_python3 conditional + +* Sat Jul 21 2012 Fedora Release Engineering - 0.10.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Mar 16 2012 Orion Poplawski - 0.10.1-1 +- Update to 0.10.1 + +* Sat Jan 14 2012 Fedora Release Engineering - 0.10.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Nov 14 2011 Orion Poplawski - 0.10.0-1 +- Update to 0.10.0 + +* Sat Sep 3 2011 Thomas Spura - 0.9.0-2 +- little cosmetic changes +- filter provides in python_sitearch + +* Fri Sep 02 2011 Andrew McNabb +- add python3 subpackage + +* Fri Apr 1 2011 Orion Poplawski - 0.9.0-1 +- Update to 0.9.0 +- Drop all stsci sources and patches, dropped from upstream +- Drop gcc and py27 patches fixed upstream +- Add %%check section to run tests + +* Wed Feb 09 2011 Fedora Release Engineering - 0.7.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sat Jul 31 2010 Toshio Kuratomi - 0.7.2-3 +- Fix scipy build on python-2.7 + +* Thu Jul 22 2010 David Malcolm - 0.7.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Thu Jul 1 2010 Jef Spaleta - 0.7.2-1 +- New upstream release + +* Sun Apr 11 2010 Jef Spaleta - 0.7.1-3 +- Bump for rebuild against numpy 1.3 + +* Thu Apr 1 2010 Jef Spaleta - 0.7.1-2 +- Bump for rebuild against numpy 1.4.0 + +* Thu Dec 10 2009 Jon Ciesla - 0.7.1-1 +- Update to 0.7.1. + +* Sun Jul 26 2009 Fedora Release Engineering - 0.7.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Sun Jun 14 2009 Jef Spaleta - 0.7.0-4 +- Fix for gcc34 weave blitz bug #505379 + +* Tue Apr 7 2009 Jef Spaleta - 0.7.0-3 +- Add f2py requires to prepared for numpy packaging split + +* Sun Mar 1 2009 Jef Spaleta - 0.7.0-2 +- Patch for stsci image function syntax fix. + +* Thu Feb 26 2009 Jef Spaleta - 0.7.0-1 +- Update to final 0.7 release + +* Wed Feb 25 2009 Fedora Release Engineering - 0.7.0-0.3.b1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Dec 15 2008 Deji Akingunola - 0.7.0-0.2.b1 +- Rebuild for atlas-3.8.2 + +* Mon Dec 01 2008 Jef Spaleta - 0.7.0-0.1.b1 +- Update to latest beta which lists python 2.6 support + +* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 0.6.0-8 +- Rebuild for Python 2.6 + +* Fri Oct 03 2008 Jef Spaleta - 0.6.0-7 +- fix the stsci fix + +* Thu Oct 02 2008 Jef Spaleta - 0.6.0-6 +- include missing setup files for stsci module + +* Tue Feb 19 2008 Fedora Release Engineering - 0.6.0-5 +- Autorebuild for GCC 4.3 + +* Fri Jan 04 2008 Jef Spaleta - 0.6.0-4 +- fix for egg-info file creation + +* Wed Oct 03 2007 Jef Spaleta - 0.6.0-3 +- include_dirs changes for ufsparse change in development + +* Tue Oct 02 2007 Jef Spaleta - 0.6.0-2 +- Fix licensing to match Fedora packaging guidance +- Remove unnecessary library deps + +* Tue Sep 25 2007 Jarrod Millman - 0.6.0-1 +- update to new upstream source +- update Summary, License, Url, and description +- added extra dependencies +- remove symlink since Lib has been renamed scipy + +* Tue Aug 21 2007 Jef Spaleta - 0.5.2.1-1 +- Update to new upstream source + +* Tue Aug 21 2007 Jef Spaleta - 0.5.2-3 +- fix licensing tag and bump for buildid rebuild + +* Wed Apr 18 2007 Jef Spaleta - 0.5.2-2.2 +- go back to using gfortran now that numpy is patched + +* Sat Apr 14 2007 Jef Spaleta - 0.5.2-2.1 +- minor correction for f77 usage + +* Sat Apr 14 2007 Jef Spaleta - 0.5.2-2 +- revert to f77 due to issue with numpy in development + +* Sat Apr 14 2007 Jef Spaleta - 0.5.2-1.1 +- remove arch specific optimizations + +* Wed Feb 21 2007 Jef Spaleta - 0.5.2-1 +- Update for new upstream release + +* Mon Dec 11 2006 Jef Spaleta - 0.5.1-5 +- Bump for rebuild against python 2.5 in devel tree + +* Sun Dec 3 2006 Jef Spaleta - 0.5.1-4 +- Minor adjustments to specfile for packaging guidelines. +- Changed buildrequires fftw version 3 from fftw2 + +* Sat Dec 2 2006 Jef Spaleta - 0.5.1-2 +- Updated spec for FE Packaging Guidelines and for upstream version 0.5.1 + +* Mon May 8 2006 Neal Becker - 0.4.8-4 +- Add BuildRequires gcc-c++ +- Add python-devel +- Add libstdc++ + +* Mon May 8 2006 Neal Becker - 0.4.8-3 +- Add BuildRequires gcc-gfortran + +* Sun May 7 2006 Neal Becker - 0.4.8-3 +- Add BuildRequires numpy + + +* Wed May 3 2006 Neal Becker - 0.4.8-2 +- Fix BuildRoot +- Add BuildRequires, Requires +- Test remove d1mach patch +- Fix defattr +- Add changelog +- Removed Prefix, Vendor +- Fix Source0 +