Sergio Pascual 1f0362a
%global upname patsy
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%global with_python3 1
Sergio Pascual 1f0362a
Name: python-%{upname}
Sergio Pascual 1f0362a
Version: 0.2.1
Sergio Pascual 1f0362a
Release: 2%{?dist}
Sergio Pascual 1f0362a
Summary: Describing statistical models in Python using symbolic formulas
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
Group: Development/Languages
Sergio Pascual 1f0362a
# All code is under BSD except patsy.compat that is under Python
Sergio Pascual 1f0362a
# See LICENSE.txt for details
Sergio Pascual 1f0362a
License: BSD and Python
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
URL: https://github.com/pydata/patsy
Sergio Pascual 1f0362a
Source0: https://pypi.python.org/packages/source/p/patsy/patsy-%{version}.tar.gz
Sergio Pascual 1f0362a
# Disable test if pandas not present
Sergio Pascual 1f0362a
Patch0: patsy-nopandas.patch
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
BuildArch: noarch
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
BuildRequires: python2-devel python-nose
Sergio Pascual 1f0362a
# For the docs
Sergio Pascual 1f0362a
BuildRequires: python-sphinx python-matplotlib python-ipython-console
Sergio Pascual 1f0362a
BuildRequires: numpy
Sergio Pascual 1f0362a
# For splines
Sergio Pascual 1f0362a
BuildRequires: scipy  
Sergio Pascual 1f0362a
BuildRequires: python-pandas
Sergio Pascual 1f0362a
Requires: numpy scipy python-pandas
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%description
Sergio Pascual 1f0362a
A Python package for describing statistical models and for building design 
Sergio Pascual 1f0362a
matrices. It is closely inspired by and compatible with the 'formula' 
Sergio Pascual 1f0362a
mini-language used in R and S.
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%package doc
Sergio Pascual 1f0362a
Summary: Documentation for %{name}, includes full API docs
Sergio Pascual 1f0362a
BuildArch: noarch
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%description doc
Sergio Pascual 1f0362a
This package contains the full API documentation for %{name}.
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%if 0%{?with_python3}
Sergio Pascual 1f0362a
%package -n python3-%{upname}
Sergio Pascual 1f0362a
Summary: Describing statistical models in Python using symbolic formulas
Sergio Pascual 1f0362a
BuildRequires: python3-devel python3-nose
Sergio Pascual 1f0362a
# For the docs
Sergio Pascual 1f0362a
BuildRequires: python3-sphinx python3-matplotlib python3-ipython-console
Sergio Pascual 1f0362a
BuildRequires: python3-numpy
Sergio Pascual 1f0362a
# For splines
Sergio Pascual 1f0362a
BuildRequires: python3-scipy  
Sergio Pascual 1f0362a
# No python3-pandas
Sergio Pascual 1f0362a
# BuildRequires: python3-pandas
Sergio Pascual 1f0362a
Requires: python3-numpy python3-scipy
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%description -n python3-%{upname}
Sergio Pascual 1f0362a
A Python package for describing statistical models and for building design 
Sergio Pascual 1f0362a
matrices. It is closely inspired by and compatible with the 'formula' 
Sergio Pascual 1f0362a
mini-language used in R and S.
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%package -n python3-%{upname}-doc
Sergio Pascual 1f0362a
Summary: Documentation for %{name}, includes full API docs
Sergio Pascual 1f0362a
BuildArch: noarch
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%description -n python3-%{upname}-doc
Sergio Pascual 1f0362a
This package contains the full API documentation for %{name}.
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%endif # with_python3
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%prep
Sergio Pascual 1f0362a
%setup -q -n %{upname}-%{version}
Sergio Pascual 1f0362a
%patch0 -p1
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%if 0%{?with_python3}
Sergio Pascual 1f0362a
rm -rf %{py3dir}
Sergio Pascual 1f0362a
cp -a . %{py3dir}
Sergio Pascual 1f0362a
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
Sergio Pascual 1f0362a
%endif # with_python3
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%build
Sergio Pascual 1f0362a
%{__python2} setup.py build
Sergio Pascual 1f0362a
%{__python2} setup.py build_sphinx
Sergio Pascual 1f0362a
rm -f build/sphinx/html/.buildinfo
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%if 0%{?with_python3}
Sergio Pascual 1f0362a
pushd %{py3dir}
Sergio Pascual 1f0362a
%{__python3} setup.py build
Sergio Pascual 1f0362a
# Creating the docs with python3-sphinx doesn't work
Sergio Pascual 1f0362a
#%{__python3} setup.py build_sphinx
Sergio Pascual 1f0362a
popd
Sergio Pascual 1f0362a
%endif # with_python3
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%install
Sergio Pascual 1f0362a
%if 0%{?with_python3}
Sergio Pascual 1f0362a
pushd %{py3dir}
Sergio Pascual 1f0362a
%{__python3} setup.py install --skip-build --root %{buildroot}
Sergio Pascual 1f0362a
popd
Sergio Pascual 1f0362a
%endif # with_python3
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%{__python2} setup.py install --root %{buildroot}
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%check
Sergio Pascual 1f0362a
pushd %{buildroot}/%{python2_sitelib}
Sergio Pascual 1f0362a
nosetests-%{python2_version} patsy
Sergio Pascual 1f0362a
popd
Sergio Pascual 1f0362a
%if 0%{?with_python3}
Sergio Pascual 1f0362a
pushd %{buildroot}/%{python3_sitelib}
Sergio Pascual 1f0362a
nosetests-%{python3_version} patsy
Sergio Pascual 1f0362a
popd
Sergio Pascual 1f0362a
%endif # with_python3
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%files
Sergio Pascual 1f0362a
%doc LICENSE.txt README TODO
Sergio Pascual 1f0362a
%{python2_sitelib}/patsy*
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%files doc
Sergio Pascual 1f0362a
%doc LICENSE.txt README TODO build/sphinx/html
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%if 0%{?with_python3}
Sergio Pascual 1f0362a
%files -n python3-%{upname}
Sergio Pascual 1f0362a
%doc LICENSE.txt README TODO
Sergio Pascual 1f0362a
%{python3_sitelib}/patsy*
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%files -n python3-%{upname}-doc
Sergio Pascual 1f0362a
%doc LICENSE.txt README TODO build/sphinx/html
Sergio Pascual 1f0362a
%endif # with_python3
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
%changelog
Sergio Pascual 1f0362a
* Sat Jan 11 2014 Sergio Pascual <sergio.pasra@gmail.com> - 0.2.1-2
Sergio Pascual 1f0362a
- Split docs in a subpackage
Sergio Pascual 1f0362a
- License is BSD and Python
Sergio Pascual 1f0362a
Sergio Pascual 1f0362a
* Fri Dec 13 2013 Sergio Pascual <sergio.pasra@gmail.com> - 0.2.1-1
Sergio Pascual 1f0362a
- Initial specfile
Sergio Pascual 1f0362a