Accepting request 479855 from devel:languages:python:singlespec

Implement single-spec version

OBS-URL: https://build.opensuse.org/request/show/479855
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pytz?expand=0&rev=56
This commit is contained in:
Andreas Stieger 2017-03-17 07:49:45 +00:00 committed by Git OBS Bridge
parent 82c4dd80ee
commit 7710aff419
2 changed files with 24 additions and 22 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Mar 16 02:58:11 UTC 2017 - toddrme2178@gmail.com
- Implement single-spec version
-------------------------------------------------------------------
Wed Mar 15 21:33:50 UTC 2017 - astieger@suse.com

View File

@ -16,6 +16,7 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pytz
Version: 2016.10
Release: 0
@ -31,21 +32,19 @@ Patch0: fix-tests.patch
# PATCH-FEATURE-OPENSUSE -- Use system tz database (Olson database)
Patch1: system_zoneinfo.patch
Patch2: pytz-2016.10-fix-tests-with-2017a.patch
Requires: timezone
BuildRequires: fdupes
BuildRequires: python-devel
BuildRequires: python-nose
# Tests will use this package
BuildRequires: timezone >= 2017a
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
# Test requirements
BuildRequires: %{python_module nose}
BuildRequires: timezone
Requires: timezone
Provides: python-tz = 2014b
Obsoletes: python-tz < 2014b
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%python_subpackages
%description
pytz - World Timezone Definitions for Python
@ -61,29 +60,27 @@ Amost all of the Olson timezones are supported.
%setup -q -n pytz-%{version}
# Disable test which is not working (and documented so)
%patch0 -p1
%if 0%{?suse_version} >= 1310
# Use system tz database
%patch1 -p1
# timezone 2017 a is currently only available in Leap 42.1
%if 0%{?sle_version} == 120100 && 0%{?is_opensuse}
%patch2 -p2
%endif
# For rpmlint warning: remove shebang from python library:
sed -i '/^#!/d' ./pytz/tzfile.py
%build
python setup.py build
%python_build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# Remove the pytz zoneinfo only if we use the system tz database
%if 0%{?suse_version} >= 1310
rm -fr %{buildroot}%{python_sitelib}/pytz/zoneinfo
%endif
%fdupes %{buildroot}%{python_sitelib}
%python_install
%python_expand rm -fr %{buildroot}%{$python_sitelib}/pytz/zoneinfo
%check
nosetests
%python_expand nosetests-%{$python_bin_suffix}
%files
%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE.txt README.txt
%{python_sitelib}/*