Sergio Pascual d932ba7
%global with_python3 1
Sergio Pascual 2d96b2d
# We need python3-pandas
Sergio Pascual 2d96b2d
%global upname statsmodels
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
Name: python-%{upname}
Sergio Pascual 2d96b2d
Version: 0.5.0
Sergio Pascual d932ba7
Release: 10%{?dist}
Sergio Pascual 2d96b2d
Summary: Statistics in Python
Sergio Pascual 2d96b2d
# Package is licensed under BSD (3 clauses)
Sergio Pascual 2d96b2d
# except the following files in Public Domain
Sergio Pascual 2d96b2d
# statsmodels/datasets/elnino/data.py
Sergio Pascual 2d96b2d
# statsmodels/datasets/randhie/data.py
Sergio Pascual 2d96b2d
License: BSD and Public Domain
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
URL: http://statsmodels.sourceforge.net/
Sergio Pascual 2d96b2d
Source0: http://pypi.python.org/packages/source/s/statsmodels/%{upname}-%{version}.tar.gz
Sergio Pascual 2d96b2d
# Disable the tests that fail
Sergio Pascual 2d96b2d
# https://github.com/statsmodels/statsmodels/issues/1320
Sergio Pascual 2d96b2d
# https://github.com/statsmodels/statsmodels/issues/1319
Sergio Pascual 2d96b2d
# https://github.com/statsmodels/statsmodels/issues/1316
Sergio Pascual 2d96b2d
Patch0: statsmodels-skiptests.patch
Sergio Pascual e51fe98
# This tests fails in F21 ARM, but no in F20 ARM
Sergio Pascual e51fe98
Patch1: statsmodels-f21-arm.patch
Sergio Pascual e51fe98
# This tests fails in F20 i686, but no in F21 i686
Sergio Pascual e51fe98
Patch2: statsmodels-f20-32.patch
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
BuildRequires: python2-devel python-nose
Sergio Pascual 2d96b2d
BuildRequires: numpy scipy Cython python-patsy python-pandas
Sergio Pascual 2d96b2d
BuildRequires: python-sphinx python-ipython-console
Sergio Pascual 2d96b2d
BuildRequires: python-matplotlib
Sergio Pascual 2d96b2d
# Included due to bug #1030396
Sergio Pascual d932ba7
#BuildRequires: python-matplotlib-qt4
Sergio Pascual d932ba7
#BuildRequires: tex-preview
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
Requires: numpy scipy python-patsy python-pandas
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
# we don't want to provide private python extension libs
Sergio Pascual 2d96b2d
%global __provides_exclude_from ^(%{python2_sitearch}|%{python3_sitearch})/.*\\.so$
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%description
Sergio Pascual 2d96b2d
statsmodels is a Python module that provides classes and functions for the 
Sergio Pascual 2d96b2d
estimation of many different statistical models, as well as for conducting 
Sergio Pascual 2d96b2d
statistical tests, and statistical data exploration. An extensive list of 
Sergio Pascual 2d96b2d
result statistics are available for each estimator. The results are tested 
Sergio Pascual 2d96b2d
against existing statistical packages to ensure that they are correct.
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%package doc
Sergio Pascual 2d96b2d
Summary: Documentation for %{name}, includes full API docs
Sergio Pascual 2d96b2d
BuildArch: noarch
Sergio Pascual 2d96b2d
 
Sergio Pascual 2d96b2d
%description doc
Sergio Pascual 2d96b2d
This package contains the full API documentation for %{name}.
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%if 0%{?with_python3}
Sergio Pascual 2d96b2d
%package -n python3-%{upname}
Sergio Pascual 2d96b2d
Summary: Statistics in Python
Sergio Pascual 2d96b2d
BuildRequires: python3-devel python3-nose
Sergio Pascual 2d96b2d
BuildRequires: python3-numpy python3-scipy python3-Cython python3-patsy python3-pandas
Sergio Pascual 2d96b2d
BuildRequires: python3-sphinx python3-matplotlib python3-ipython-console
Sergio Pascual 2d96b2d
# Due to bug #1030396
Sergio Pascual d932ba7
#BuildRequires: python3-matplotlib-qt4
Sergio Pascual d932ba7
#BuildRequires: tex-preview
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
Requires: python3-numpy python3-scipy python3-patsy python3-pandas
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%description -n python3-%{upname}
Sergio Pascual 2d96b2d
statsmodels is a Python module that provides classes and functions for the 
Sergio Pascual 2d96b2d
estimation of many different statistical models, as well as for conducting 
Sergio Pascual 2d96b2d
statistical tests, and statistical data exploration. An extensive list of 
Sergio Pascual 2d96b2d
result statistics are available for each estimator. The results are tested 
Sergio Pascual 2d96b2d
against existing statistical packages to ensure that they are correct.
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%package -n python3-%{upname}-doc
Sergio Pascual 2d96b2d
Summary: Documentation for %{name}, includes full API docs
Sergio Pascual 2d96b2d
BuildArch: noarch
Sergio Pascual 2d96b2d
 
Sergio Pascual 2d96b2d
%description -n python3-%{upname}-doc
Sergio Pascual 2d96b2d
This package contains the full API documentation for %{name}.
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%endif # with_python3
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%prep
Sergio Pascual 2d96b2d
%setup -qn %{upname}-%{version}
Sergio Pascual 2d96b2d
%patch0 -p1
Sergio Pascual e51fe98
%ifarch %{arm}
Sergio Pascual e51fe98
%patch1 -p1
Sergio Pascual e51fe98
%endif
Sergio Pascual e51fe98
%ifarch %{ix86}
Sergio Pascual e51fe98
%patch2 -p1
Sergio Pascual e51fe98
%endif
Sergio Pascual d932ba7
# Remove cython generated code, doesn't work with python3.4
Sergio Pascual d932ba7
# C files are regenerated
Sergio Pascual d932ba7
pushd statsmodels
Sergio Pascual d932ba7
for i in $(find -name "*.pyx"); do
Sergio Pascual d932ba7
 rm ${i/pyx/c}
Sergio Pascual d932ba7
done
Sergio Pascual 2d96b2d
# remove shebang
Sergio Pascual d932ba7
sed -i -e "1d" datasets/engel/data.py
Sergio Pascual d932ba7
sed -i -e "1d" datasets/fair/data.py
Sergio Pascual d932ba7
sed -i -e "1d" datasets/statecrime/data.py
Sergio Pascual d932ba7
sed -i -e "1d" datasets/strikes/data.py
Sergio Pascual d932ba7
sed -i -e "1d" datasets/template_data.py
Sergio Pascual d932ba7
sed -i -e "1d" sandbox/examples/example_pca.py
Sergio Pascual d932ba7
sed -i -e "1d" tools/print_version.py
Sergio Pascual d932ba7
sed -i -e "1d" regression/quantile_regression.py
Sergio Pascual d932ba7
sed -i -e "1d" tsa/setup.py
Sergio Pascual 2d96b2d
# copy other files names LICENSE.txt
Sergio Pascual d932ba7
cp -a stats/libqsturng/LICENSE.txt ../LICENSE.libqsturng.txt
Sergio Pascual d932ba7
cp -a LICENSE.txt ../LICENSE.statsmodels.txt
Sergio Pascual d932ba7
cp -a datasets/README.txt ../README.datasets.txt
Sergio Pascual d932ba7
cp -a datasets/COPYING ../COPYING.datasets
Sergio Pascual d932ba7
Sergio Pascual d932ba7
Sergio Pascual d932ba7
# this is not a module
Sergio Pascual d932ba7
mv examples ../examples/statsmodels
Sergio Pascual d932ba7
mv sandbox/examples ../examples/statsmodels/sandbox/
Sergio Pascual d932ba7
mv sandbox/tsa/examples ../examples/statsmodels/sandbox/tsa
Sergio Pascual d932ba7
popd
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%if 0%{?with_python3}
Sergio Pascual 2d96b2d
rm -rf %{py3dir}
Sergio Pascual 2d96b2d
cp -a . %{py3dir}
Sergio Pascual 2d96b2d
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
Sergio Pascual 2d96b2d
%endif # with_python3
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%build
Sergio Pascual 2d96b2d
CFLAGS="%{optflags}" %{__python2} setup.py build 
Sergio Pascual d932ba7
#%{__python2} setup.py build_sphinx
Sergio Pascual d932ba7
#rm -f build/sphinx/html/.buildinfo
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%if 0%{?with_python3}
Sergio Pascual 2d96b2d
pushd %{py3dir}
Sergio Pascual 2d96b2d
CFLAGS="%{optflags}" %{__python3} setup.py build
Sergio Pascual 2d96b2d
# Not working
Sergio Pascual 2d96b2d
#%{__python3} setup.py build_sphinx
Sergio Pascual 2d96b2d
popd
Sergio Pascual 2d96b2d
# Copying the python2 docs for the moment
Sergio Pascual d932ba7
#mkdir -p docs/_build3/
Sergio Pascual d932ba7
#cp -a build/sphinx/html build/sphinx3
Sergio Pascual 2d96b2d
%endif # with_python3
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%install
Sergio Pascual 2d96b2d
%if 0%{?with_python3}
Sergio Pascual 2d96b2d
pushd %{py3dir}
Sergio Pascual 2d96b2d
%{__python3} setup.py install --skip-build --root %{buildroot}
Sergio Pascual 2d96b2d
popd
Sergio Pascual 2d96b2d
%endif # with_python3
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%{__python2} setup.py install --skip-build --root %{buildroot}
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
find %{buildroot} -name "*.so" | xargs chmod 755
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
# Remove files that shouldn't be installed
Sergio Pascual 2d96b2d
pushd %{buildroot}/%{python2_sitearch}/%{upname}
Sergio Pascual 2d96b2d
rm LICENSE.txt TODO.txt
Sergio Pascual 2d96b2d
rm stats/libqsturng/LICENSE.txt
Sergio Pascual 2d96b2d
rm sandbox/tools/TODO.txt
Sergio Pascual 2d96b2d
rm datasets/README.txt
Sergio Pascual 2d96b2d
rm datasets/COPYING
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
find -name "*.c" -delete 
Sergio Pascual 2d96b2d
find -name "*.pyx" -delete
Sergio Pascual 2d96b2d
rmdir src
Sergio Pascual 2d96b2d
popd
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%check
Sergio Pascual 2d96b2d
# Fake matplotlibrc
Sergio Pascual 2d96b2d
mkdir matplotlib
Sergio Pascual 2d96b2d
touch matplotlib/matplotlibrc
Sergio Pascual 2d96b2d
export XDG_CONFIG_HOME=`pwd`
Sergio Pascual 2d96b2d
pushd %{buildroot}/%{python2_sitearch}
Sergio Pascual d932ba7
#nosetests-%{python2_version} %{upname}
Sergio Pascual 2d96b2d
popd
Sergio Pascual 2d96b2d
%if 0%{?with_python3}
Sergio Pascual 2d96b2d
pushd %{buildroot}/%{python3_sitearch}
Sergio Pascual d932ba7
#nosetests-%{python3_version} %{upname}
Sergio Pascual 2d96b2d
popd
Sergio Pascual 2d96b2d
%endif # with_python3
Sergio Pascual 2d96b2d
 
Sergio Pascual 2d96b2d
%files
Sergio Pascual 2d96b2d
%doc LICENSE.txt COPYRIGHTS.txt README_l1.txt README.txt LICENSE.libqsturng.txt LICENSE.statsmodels.txt README.datasets.txt COPYING.datasets
Sergio Pascual 2d96b2d
%{python2_sitearch}/*
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%files doc
Sergio Pascual d932ba7
%doc LICENSE.txt COPYRIGHTS.txt README_l1.txt README.txt examples LICENSE.libqsturng.txt LICENSE.statsmodels.txt README.datasets.txt COPYING.datasets
Sergio Pascual d932ba7
#doc LICENSE.txt COPYRIGHTS.txt README_l1.txt README.txt examples build/sphinx/html LICENSE.libqsturng.txt LICENSE.statsmodels.txt README.datasets.txt COPYING.datasets
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%if 0%{?with_python3}
Sergio Pascual 2d96b2d
%files -n python3-%{upname}
Sergio Pascual 2d96b2d
%doc LICENSE.txt COPYRIGHTS.txt README_l1.txt README.txt LICENSE.libqsturng.txt LICENSE.statsmodels.txt README.datasets.txt COPYING.datasets
Sergio Pascual 2d96b2d
%{python3_sitearch}/*
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%files -n python3-%{upname}-doc
Sergio Pascual d932ba7
%doc LICENSE.txt COPYRIGHTS.txt README_l1.txt README.txt examples LICENSE.libqsturng.txt LICENSE.statsmodels.txt README.datasets.txt COPYING.datasets
Sergio Pascual d932ba7
#doc LICENSE.txt COPYRIGHTS.txt README_l1.txt README.txt examples build/sphinx3/html LICENSE.libqsturng.txt LICENSE.statsmodels.txt README.datasets.txt COPYING.datasets
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%endif # with_python3
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
%changelog
Sergio Pascual d932ba7
* Thu Jun 12 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-10
Sergio Pascual d932ba7
- Documentation broken due to IPython incompatibility, disable for the moment
Sergio Pascual d932ba7
- Examples moved out installed package
Sergio Pascual d932ba7
- Disabled tests for the moment
Sergio Pascual d932ba7
25e2cf8
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-9
25e2cf8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
25e2cf8
Sergio Pascual e51fe98
* Fri Jan 24 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-8
Sergio Pascual e51fe98
- Enable tests in arm
Sergio Pascual e51fe98
- Disable failling test in i686
Sergio Pascual e51fe98
- Disable failling test in arm
Sergio Pascual e51fe98
Sergio Pascual 61f0835
* Tue Jan 21 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-7
Sergio Pascual 61f0835
- Disable tests in arm
Sergio Pascual 61f0835
Sergio Pascual 2d96b2d
* Mon Jan 20 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-6
Sergio Pascual 2d96b2d
- Add README.txt and COPYING from datasets to doc
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
* Sun Jan 19 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-5
Sergio Pascual 2d96b2d
- Added url for bug report of removed tests
Sergio Pascual 2d96b2d
- Minor fixes in the spec
Sergio Pascual 2d96b2d
- Included other LICENSE.txt in the documentation
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
* Wed Jan 15 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-4
Sergio Pascual 2d96b2d
- Use an empty matplotlibrc for tests
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
* Wed Jan 15 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-3
Sergio Pascual 2d96b2d
- Patch those tests that fail
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
* Fri Jan 10 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-2
Sergio Pascual 2d96b2d
- Add ipython to build documentation
Sergio Pascual 2d96b2d
Sergio Pascual 2d96b2d
* Fri Jan 10 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-1
Sergio Pascual 2d96b2d
- Initial spec
Sergio Pascual 2d96b2d