Python 3 support, latest upstream.
This commit is contained in:
parent
17939973d9
commit
790efc91af
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
pytz-2010h.tar.gz
|
||||
/pytz-2012d.tar.gz
|
||||
|
67
pytz.spec
67
pytz.spec
@ -1,10 +1,12 @@
|
||||
%if 0%{?fedora} < 13 || 0%{?rhel} < 6
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
|
||||
%global with_python3 1
|
||||
%else
|
||||
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
%endif
|
||||
|
||||
Name: pytz
|
||||
Version: 2010h
|
||||
Release: 6%{?dist}
|
||||
Version: 2012d
|
||||
Release: 1%{?dist}
|
||||
Summary: World Timezone Definitions for Python
|
||||
|
||||
Group: Development/Languages
|
||||
@ -12,11 +14,14 @@ License: MIT
|
||||
URL: http://pytz.sourceforge.net/
|
||||
Source0: http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
|
||||
|
||||
Patch0: pytz-2010h_zoneinfo.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: python2-devel
|
||||
|
||||
%if 0%{?with_python3}
|
||||
BuildRequires: python3-devel
|
||||
%endif
|
||||
|
||||
Requires: tzdata
|
||||
|
||||
@ -29,19 +34,50 @@ which you can read more about in the Python Library Reference
|
||||
|
||||
Amost all (over 540) of the Olson timezones are supported.
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%package -n python3-%{name}
|
||||
Requires: python3
|
||||
Summary: World Timezone Definitions for Python
|
||||
|
||||
Group: Development/Languages
|
||||
%description -n python3-%{name}
|
||||
pytz brings the Olson tz database into Python. This library allows accurate
|
||||
and cross platform timezone calculations using Python 2.3 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 (over 540) of the Olson timezones are supported.
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
|
||||
%if 0%{?with_python3}
|
||||
cp -a . %{py3dir}
|
||||
%endif
|
||||
|
||||
%build
|
||||
%{__python} setup.py build
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py build
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
|
||||
chmod +x $RPM_BUILD_ROOT%{python_sitelib}/pytz/*.py
|
||||
rm -rf $RPM_BUILD_ROOT%{python_sitelib}/pytz/zoneinfo
|
||||
%{__python} setup.py install --skip-build --root %{buildroot}
|
||||
chmod +x %{buildroot}%{python_sitelib}/pytz/*.py
|
||||
rm -rf %{buildroot}%{python_sitelib}/pytz/zoneinfo
|
||||
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py install --skip-build --root %{buildroot}
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
@ -53,7 +89,18 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{python_sitelib}/pytz/
|
||||
%{python_sitelib}/*.egg-info
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%files -n python3-pytz
|
||||
%doc CHANGES.txt LICENSE.txt README.txt
|
||||
%{python3_sitelib}/pytz/
|
||||
%{python3_sitelib}/*.egg-info
|
||||
%endif # with_python3
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Aug 23 2012 Jon Ciesla <limburgher@gmail.com> - 2012d-1
|
||||
- Latest upstream, python3 support, BZ 851226.
|
||||
|
||||
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2010h-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user