Initial packaging
Credit goes to Tristan Cacqueray for the initial version of the packaging. I just cleaned it up and added python3 support. Closes #235431 Co-Authored-By: Tristan de Cacqueray <tdecacqu@redhat.com> Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
8358fc2ca8
commit
cb7dffadf2
3 changed files with 125 additions and 0 deletions
123
python-APScheduler.spec
Normal file
123
python-APScheduler.spec
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
%global pypi_name APScheduler
|
||||
%if 0%{?fedora}
|
||||
%global with_python3 1
|
||||
%endif
|
||||
|
||||
Name: python-%{pypi_name}
|
||||
Version: 3.0.5
|
||||
Release: 1%{?dist}
|
||||
Summary: In-process task scheduler with Cron-like capabilities
|
||||
|
||||
License: MIT
|
||||
URL: https://pypi.python.org/pypi/%{pypi_name}
|
||||
Source0: https://pypi.python.org/packages/source/A/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: python2-devel
|
||||
BuildRequires: python-funcsigs
|
||||
BuildRequires: python-futures
|
||||
BuildRequires: python-setuptools
|
||||
BuildRequires: python-six >= 1.4.0
|
||||
BuildRequires: python-tzlocal
|
||||
# Unit testing
|
||||
BuildRequires: python-mock
|
||||
BuildRequires: python-pytest
|
||||
|
||||
%if 0%{?with_python3}
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: python3-six >= 1.4.0
|
||||
BuildRequires: python3-tzlocal
|
||||
# Unit testing
|
||||
BuildRequires: python3-mock
|
||||
BuildRequires: python3-pytest
|
||||
%endif
|
||||
|
||||
%description
|
||||
Advanced Python Scheduler (APScheduler) is a Python library that lets you
|
||||
schedule your Python code to be executed later, either just once or
|
||||
periodically.
|
||||
|
||||
%package -n python2-%{pypi_name}
|
||||
Summary: %{summary}
|
||||
%{?python_provide:%python_provide python2-%{pypi_name}}
|
||||
|
||||
Requires: python-funcsigs
|
||||
Requires: python-futures
|
||||
Requires: python-six >= 1.4.0
|
||||
Requires: python-tzlocal
|
||||
|
||||
%description -n python2-%{pypi_name}
|
||||
Advanced Python Scheduler (APScheduler) is a Python library that lets you
|
||||
schedule your Python code to be executed later, either just once or
|
||||
periodically.
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%package -n python3-%{pypi_name}
|
||||
Summary: %{summary}
|
||||
%{?python_provide:%python_provide python3-%{pypi_name}}
|
||||
|
||||
Requires: python3-six >= 1.4.0
|
||||
Requires: python3-tzlocal
|
||||
|
||||
%description -n python3-%{pypi_name}
|
||||
Advanced Python Scheduler (APScheduler) is a Python library that lets you
|
||||
schedule your Python code to be executed later, either just once or
|
||||
periodically.
|
||||
%endif
|
||||
|
||||
%package doc
|
||||
Summary: Documentation of the Advanced Python Scheduler library
|
||||
BuildRequires: python-sphinx
|
||||
|
||||
%description doc
|
||||
Documentation of the Advanced Python Scheduler library.
|
||||
|
||||
%prep
|
||||
%autosetup -n %{pypi_name}-%{version}
|
||||
rm -rf %{pypi_name}.egg-info
|
||||
|
||||
%build
|
||||
%py2_build
|
||||
%if 0%{?with_python3}
|
||||
%py3_build
|
||||
%endif
|
||||
|
||||
## generate html docs
|
||||
%{__python} setup.py build_sphinx
|
||||
rm -rf docs/_build/html/.{doctrees,buildinfo} docs/_build/html/objects.inv
|
||||
|
||||
%install
|
||||
%py2_install
|
||||
%if 0%{?with_python3}
|
||||
%py3_install
|
||||
%endif
|
||||
|
||||
%check
|
||||
# Default timezone to UTC otherwise unit tests fail.
|
||||
export TZ=UTC
|
||||
%{__python2} -m pytest
|
||||
%if 0%{?with_python3}
|
||||
%{__python3} -m pytest
|
||||
%endif
|
||||
|
||||
%files -n python2-%{pypi_name}
|
||||
%license LICENSE.txt
|
||||
%doc README.rst
|
||||
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info/
|
||||
%{python2_sitelib}/apscheduler/
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%files -n python3-%{pypi_name}
|
||||
%license LICENSE.txt
|
||||
%doc README.rst
|
||||
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/
|
||||
%{python3_sitelib}/apscheduler/
|
||||
%endif
|
||||
|
||||
%files doc
|
||||
%doc docs/_build/html
|
||||
|
||||
%changelog
|
||||
* Sat Dec 19 2015 Paul Belanger <pabelanger@redhat.com> - 3.0.5-1
|
||||
- Initial packaging (#1218410)
|
||||
Loading…
Add table
Add a link
Reference in a new issue