Преглед изворни кода

pytz-2018.7-1

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@11929 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop пре 6 година
родитељ
комит
c978a2018e
1 измењених фајлова са 82 додато и 17 уклоњено
  1. 82 17
      p/pytz/pytz-vl.spec

+ 82 - 17
p/pytz/pytz-vl.spec

@@ -1,7 +1,9 @@
-%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%bcond_with check
+
+%define pathfix %{_libdir}/python3.5/Tools/scripts/pathfix.py
 
 Name: pytz
-Version: 2014.4
+Version: 2018.7
 Release: 1%{?_dist_release}
 Summary: World Timezone Definitions for Python
 Summary(ja): Python 用の世界タイムゾーン定義
@@ -9,15 +11,17 @@ Summary(ja): Python 用の世界タイムゾーン定義
 Group: Development/Languages
 License: MIT
 URL: http://pytz.sourceforge.net/
-Source0: http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.bz2
-Patch0: tzdata
+Vendor: Project Vine
+Distribution: Vine Linux
 
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
+Source0: http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
+# Patch to use the system supplied zoneinfo files
+Patch0: pytz-zoneinfo.patch
+# https://bugzilla.redhat.com/1497572
+Patch1: remove_tzinfo_test.patch
 
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildArch: noarch
-BuildRequires: python-devel
-
-Requires: tzdata
 
 %description
 pytz brings the Olson tz database into Python. This library allows accurate
@@ -28,31 +32,92 @@ which you can read more about in the Python Library Reference
 
 Amost all (over 540) of the Olson timezones are supported.
 
+%package -n python-%{name}
+Summary:        World Timezone Definitions for Python
+Summary(ja):    Python 用の世界タイムゾーン定義
+%{?python_provide:%python_provide python2-%{name}}
+BuildRequires:  python-devel, python-rpm-macros
+%if %{with check}
+BuildRequires:  python-pytest
+%endif
+Requires:       tzdata
+# Remove before vl7
+Provides: pytz = %{version}-%{release}
+Obsoletes: pytz < %{version}-%{release}
+
+%description -n python-%{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.
+
+%package -n python3-%{name}
+Summary:        World Timezone Definitions for Python
+Summary(ja):    Python 用の世界タイムゾーン定義
+%{?python_provide:%python_provide python3-%{name}}
+BuildRequires:  python3-devel, python3-rpm-macros
+%if %{with check}
+BuildRequires:  python3-pytest
+%endif
+Requires:       tzdata
+
+%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.
+
 %prep
-%setup -q
-%patch0 -p1
+%autosetup -p1
 
 %build
-%{__python} setup.py build
-
+%py_build
+%py3_build
 
 %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
+%py_install
+rm -r %{buildroot}%{python_sitelib}/pytz/zoneinfo
+%{pathfix} -p -i %{__python} %{buildroot}%{python_sitelib}
+
+%py3_install
+rm -r %{buildroot}%{python3_sitelib}/pytz/zoneinfo
+%{pathfix} -p -i %{__python3} %{buildroot}%{python3_sitelib}
+
+%if %{with check}
+%check
+PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} -m pytest -v
+PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 
-%files
+%files -n python-%{name}
 %defattr(-,root,root,-)
-%doc CHANGES.txt LICENSE.txt README.txt
+%license LICENSE.txt
+%doc README.txt
 %{python_sitelib}/pytz/
 %{python_sitelib}/*.egg-info
 
+%files -n python3-pytz
+%license LICENSE.txt
+%doc README.txt
+%{python3_sitelib}/pytz/
+%{python3_sitelib}/*.egg-info
+
 %changelog
+* Tue Nov 27 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2018.7-1
+- new upstream release.
+- added python3 support.
+
 * Sat Aug 09 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> - 2014.4-1
 - initial build for VineSeed