Blob Blame History Raw
# Documentation cannot be built on epel7, python-numpydoc is missing
%global with_doc  0%{?fedora}

# Use the same directory of the main package for subpackage licence and doc
%global _docdir_fmt %{name}

Name:           python-pysb
Version:        1.0.1
Release:        7%{?dist}
Summary:        Rule-based modeling of biochemical systems as Python programs
License:        BSD
URL:            http://pysb.org/
Source0:        https://pypi.python.org/packages/source/p/pysb/pysb-%{version}.tar.gz
Patch0:         0001-Mark-run_tutorial_a-executable-same-as-other-example.patch
BuildArch:      noarch

BuildRequires:  python2-devel
# For building documentation
%if %{with_doc}
BuildRequires:  dvipng
BuildRequires:  python-sphinx
BuildRequires:  tex(latex)
BuildRequires:  python-numpydoc
%endif
Requires:       bionetgen
Requires:       numpy
Requires:       scipy
Requires:       python-matplotlib
Requires:       sympy
Requires:       python-pygraphviz

%description
PySB is a framework for building mathematical models of biochemical
systems as Python programs. PySB abstracts the complex process of
creating equations describing interactions among multiple proteins or
other biomolecules into a simple and intuitive domain specific
programming language, which is internally translated into BioNetGen or
Kappa rules and from there into systems of equations. PySB makes it
straightforward to divide models into modules and to call libraries of
reusable elements (macros) that encode standard biochemical
actions. These features promote model transparency, reuse and
accuracy. PySB also interoperates with standard scientific Python
libraries such as NumPy, SciPy and SymPy enabling model simulation and
analysis.

%if %{with_doc}
%package doc
Summary:        HTML documentation for %{name}
Group:          Documentation
Requires:       %{name} = %{version}-%{release}
Provides:       bundled(jquery)
Obsoletes:      %{name}-docs <= 1.0.1

%description doc
This package contains HTML documentation for %{name}.
%endif

%prep
%setup -q -n pysb-%{version}
%patch0 -p1
# https://github.com/pysb/pysb/issues/100
sed -i -e "s|/usr/local/share/BioNetGen|%{perl_vendorlib}/BioNetGen|" \
       -e "s|'c:/Program Files/BioNetGen',||" \
    pysb/bng.py
sed -i -s "1 s|/usr/bin/env python|%{__python2}|" pysb/examples/*.py pysb/tools/*.py

%build
python setup.py build

# Build documentation
%if %{with_doc}
make -C doc html
rm doc/_build/html/.buildinfo
%endif

%install
python2 setup.py install --skip-build --root %{buildroot}
chmod +x %{buildroot}/%{python_sitelib}/pysb/examples/run_*.py
chmod +x %{buildroot}/%{python_sitelib}/pysb/tools/[a-z]*.py

%files
%license LICENSE.txt
%doc README.rst
%{python_sitelib}/pysb/
%{python_sitelib}/pysb-%{version}-*.egg-info
%{_bindir}/pysb_export

%if %{with_doc}
%files doc
%license LICENSE.txt
%doc doc/_build/html
%endif

%changelog
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Sep 26 2016 Dominik Mierzejewski <rpm@greysector.net> - 1.0.1-5
- rebuilt for matplotlib-2.0.0

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Mon Jan 19 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.0.1-1
- Update to 1.0.1
- Remove merged patches
- Rename -docs do -doc following Packaging Guidelines

* Tue Jan  6 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.0.0-1
- Update to 1.0.0 (#1178418)
- Add docs subpackage

* Wed Dec 03 2014 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.1.11-2
- Fix shebangs and permissions on scripts.

* Fri Nov 21 2014 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.1.11-1
- Initial packaging.