File python-FiPy.spec of Package python-FiPy
#
# spec file for package python-FiPy
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define modname FiPy
%define pyname fipy
Name: python-%{modname}
Version: 3.0
Release: 0
Summary: A Finite Volume PDE Solver Using Python
License: GPL
Group: Development/Languages/Python
Url: http://www.ctcms.nist.gov/fipy/
Source0: http://www.ctcms.nist.gov/fipy/download/%{modname}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: fdupes
BuildRequires: python-Pygments
BuildRequires: python-Sphinx
BuildRequires: python-devel
BuildRequires: python-numpy-devel
BuildRequires: python-pysparse
BuildRequires: python-scipy
BuildRequires: python-setuptools
BuildRequires: python-simpleparse
BuildRequires: python-xml
Requires: python-numpy
Requires: python-scipy
Recommends: python-matplotlib
%if 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%else
BuildArch: noarch
%{py_requires}
%endif
%description
FiPy is an object oriented, partial differential equation (PDE) solver, written
in Python, based on a standard finite volume (FV) approach. The FiPy framework
includes terms for transient diffusion, convection and standard sources, enabling
the solution of arbitrary combinations of coupled elliptic, hyperbolic and
parabolic PDEs. Currently implemented models include phase field, treatments
of polycrystalline, dendritic, and electrochemical phase transformations as well
as a level set treatment of the electrodeposition process.
%package doc
Summary: The documentation files of %{name}
Group: Development/Languages/Python
Recommends: %{name} = %{version}
%description doc
This package contains the html documentation files for %{name}.
%prep
%setup -q -n %{modname}-%{version}
%build
python setup.py build
python setup.py build_docs --html
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# fix executables permissions
find %{buildroot} -type f -name "*.py" -exec chmod 755 {} \;
# fix missing shebang
find %{buildroot} -type f -name "*.py" -exec sed -i -e '1i#!/usr/bin/python' {} \;
# remove unwanted files
find examples -type f -name ".git*" -exec rm -f {} \;
# Manage the documentation files
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -r -t %{buildroot}%{_docdir}/%{name}/ examples documentation/_build/html
%fdupes -s %{buildroot}%{_docdir}/%{name}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc DISCLAIMER.txt LICENSE.txt README.txt
%{python_sitelib}/%{pyname}/
%{python_sitelib}/%{modname}-%{version}-py%{py_ver}.egg-info/
%if 0%{?suse_version} > 1140
%exclude %{_docdir}/%{name}/examples/
%exclude %{_docdir}/%{name}/html/
%endif
%if 0%{?suse_version} > 1140
%files doc
%defattr(-,root,root,-)
%{_docdir}/%{name}/examples/
%{_docdir}/%{name}/html/
%endif
%changelog