2012-03-21 19:38:53 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-pytz
|
|
|
|
#
|
2021-02-09 22:53:32 +00:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2012-03-21 19:38:53 +00:00
|
|
|
#
|
|
|
|
# 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.
|
2013-04-29 12:34:30 +00:00
|
|
|
|
2018-12-04 13:57:15 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2012-03-21 19:38:53 +00:00
|
|
|
#
|
|
|
|
|
2013-04-29 12:34:30 +00:00
|
|
|
|
2019-09-09 07:31:21 +00:00
|
|
|
# Ensure you update the tzdata_version for any minor version increase
|
|
|
|
# otherwise the update python library has the incorrect timezone data.
|
2021-02-23 22:00:05 +00:00
|
|
|
%define tzdata_version 2021a
|
2017-04-05 15:18:15 +00:00
|
|
|
%define oldpython python
|
2017-03-17 07:49:45 +00:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2012-03-21 19:38:53 +00:00
|
|
|
Name: python-pytz
|
2021-02-09 22:53:32 +00:00
|
|
|
Version: 2021.1
|
2012-03-21 19:38:53 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: World timezone definitions, modern and historical
|
|
|
|
License: MIT
|
|
|
|
Group: Development/Languages/Python
|
2019-02-18 15:04:19 +00:00
|
|
|
URL: https://pythonhosted.org/pytz/
|
2018-02-19 20:21:31 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/pytz/pytz-%{version}.tar.gz
|
|
|
|
Source2: https://files.pythonhosted.org/packages/source/p/pytz/pytz-%{version}.tar.gz.asc
|
2018-07-01 06:43:46 +00:00
|
|
|
Source90: %{name}.keyring
|
2014-08-12 13:50:27 +00:00
|
|
|
# PATCH-FIX-UPSTREAM fix-tests.patch -- Remote tests which are known to be broken
|
|
|
|
Patch0: fix-tests.patch
|
2017-06-29 07:02:05 +00:00
|
|
|
# PATCH-FIX-UPSTREAM 0001-Fix-tests-for-older-timezone-versions.patch -- https://code.launchpad.net/~toabctl/pytz/+git/pytz/+merge/326419
|
|
|
|
Patch2: 0001-Fix-tests-for-older-timezone-versions.patch
|
2019-02-18 15:04:19 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2018-07-01 06:43:46 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2019-09-09 07:31:21 +00:00
|
|
|
BuildRequires: timezone >= %{tzdata_version}
|
2019-02-18 15:04:19 +00:00
|
|
|
Requires: python-base
|
2019-09-09 07:31:21 +00:00
|
|
|
Requires: timezone >= %{tzdata_version}
|
2018-07-01 06:43:46 +00:00
|
|
|
BuildArch: noarch
|
2017-04-05 15:18:15 +00:00
|
|
|
%ifpython2
|
|
|
|
Provides: %{oldpython}-tz = %{version}
|
|
|
|
Obsoletes: %{oldpython}-tz < %{version}
|
|
|
|
%endif
|
2017-03-17 07:49:45 +00:00
|
|
|
%python_subpackages
|
2017-03-07 17:18:52 +00:00
|
|
|
|
2012-03-21 19:38:53 +00:00
|
|
|
%description
|
|
|
|
pytz - World Timezone Definitions for Python
|
|
|
|
pytz brings the Olson tz database into Python. This library allows
|
|
|
|
accurate and cross platform timezone calculations using Python 2.4
|
|
|
|
or higher. It also solves the issue of ambiguous times at the end
|
|
|
|
of daylight savings, which you can read more about in the Python
|
|
|
|
Library Reference (``datetime.tzinfo``).
|
|
|
|
|
|
|
|
Amost all of the Olson timezones are supported.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n pytz-%{version}
|
2019-01-09 17:21:14 +00:00
|
|
|
%autopatch -p1
|
2017-03-17 07:49:45 +00:00
|
|
|
|
2013-01-15 14:14:40 +00:00
|
|
|
# For rpmlint warning: remove shebang from python library:
|
|
|
|
sed -i '/^#!/d' ./pytz/tzfile.py
|
2012-03-21 19:38:53 +00:00
|
|
|
|
2019-09-09 07:31:21 +00:00
|
|
|
# Help Python 2.7 unittest
|
|
|
|
touch pytz/tests/__init__.py
|
|
|
|
|
2012-03-21 19:38:53 +00:00
|
|
|
%build
|
2017-03-17 07:49:45 +00:00
|
|
|
%python_build
|
2012-03-21 19:38:53 +00:00
|
|
|
|
|
|
|
%install
|
2017-03-17 07:49:45 +00:00
|
|
|
%python_install
|
2019-09-09 07:31:21 +00:00
|
|
|
# Replace custom data with symlink to /usr/share/zoneinfo
|
|
|
|
%{python_expand rm -r %{buildroot}%{$python_sitelib}/pytz/zoneinfo
|
2020-05-03 07:15:23 +00:00
|
|
|
ln -s %{_datadir}/zoneinfo %{buildroot}%{$python_sitelib}/pytz/zoneinfo
|
2019-09-09 07:31:21 +00:00
|
|
|
%fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
}
|
2012-03-21 19:38:53 +00:00
|
|
|
|
2014-08-12 13:50:27 +00:00
|
|
|
%check
|
2019-09-09 07:31:21 +00:00
|
|
|
%python_exec setup.py test
|
2012-03-21 19:38:53 +00:00
|
|
|
|
2017-03-17 07:49:45 +00:00
|
|
|
%files %{python_files}
|
2018-07-01 06:43:46 +00:00
|
|
|
%license LICENSE.txt
|
2020-05-03 07:15:23 +00:00
|
|
|
%doc README.rst
|
|
|
|
%{python_sitelib}/pytz
|
|
|
|
%{python_sitelib}/pytz-%{version}-py*.egg-info
|
2012-03-21 19:38:53 +00:00
|
|
|
|
|
|
|
%changelog
|