saltbundlepy-pytz/saltbundlepy-pytz.spec

93 lines
3.1 KiB
RPMSpec

#
# spec file for package saltbundlepy-pytz
#
# Copyright (c) 2023 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%{?!saltbundlepy_module:%define saltbundlepy_module() saltbundlepy-%{**}}
%define pythons saltbundlepy
# Disable python bytecompile for all distros
# It's called explicitly in the spec
%global __brp_python_bytecompile %{nil}
Name: saltbundlepy-pytz
Version: 2023.3
Release: 0
Summary: World timezone definitions, modern and historical
License: MIT
Group: Development/Languages/Python
URL: https://pythonhosted.org/pytz/
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
Source90: %{name}.keyring
# PATCH-FIX-UPSTREAM fix-tests.patch -- Remote tests which are known to be broken
Patch0: fix-tests.patch
# 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
BuildRequires: %{saltbundlepy_module base >= 3.10}
BuildRequires: %{saltbundlepy_module setuptools}
BuildRequires: fdupes
BuildRequires: saltbundlepy-rpm-macros
BuildRequires: timezone
Requires: saltbundlepy-base
Requires: timezone
BuildArch: noarch
%python_subpackages
%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}
%autopatch -p1
# For rpmlint warning: remove shebang from python library:
sed -i '/^#!/d' ./pytz/tzfile.py
%build
%python_build
%install
%python_install
# Replace custom data with symlink to /usr/share/zoneinfo
%{python_expand rm -r %{buildroot}%{$python_sitelib}/pytz/zoneinfo
ln -s %{_datadir}/zoneinfo %{buildroot}%{$python_sitelib}/pytz/zoneinfo
%fdupes %{buildroot}%{$python_sitelib}
}
%check
%pyunittest discover -v
%pre
if [ $1 -gt 1 ] ; then
[ "$(readlink -e %{python_sitelib}/pytz/zoneinfo)" = "%{python_sitelib}/pytz/zoneinfo" ] && rm -rf %{python_sitelib}/pytz/zoneinfo
fi || :
%files %{python_files}
%license LICENSE.txt
%doc README.rst
%{python_sitelib}/pytz
%{python_sitelib}/pytz-%{version}-py*.egg-info
%changelog