LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File python-pytz.spec of Package python-pytz (Project home:phprus:oss:devel:python)

%define realname pytz
%define srcext   tar.bz2

%if ! 0%{?py_ver:1}
%define py_ver %(python -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)

# See: https://bugzilla.redhat.com/show_bug.cgi?id=533022
%if 0%{?fedora} <= 12
    %define python_sitelib  %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
    %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")

# Common info
Name:          python-%{realname}
Version:       2016.4
Release:       wiz%{?extraver:0.}1
License:       MIT
Group:         Development/Languages/Python
URL:           https://pypi.python.org/pypi/pytz
Summary:       World Timezone Definitions for Python

# Install-time parameters
Requires:      python%{?suse_version:-base}

# Build-time parameters
%if ! 0%{?sles_version}
BuildArch:     noarch
BuildRequires: rsync
%if 0%{?suse_version}
BuildRequires: fdupes
BuildRequires: python-setuptools
BuildRequires: python-devel
BuildRoot:     %{_tmppath}/%{name}-root
Source:        https://pypi.python.org/packages/source/p/pytz/%{realname}-%{version}%{?extraver}.%{srcext}

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 saving time, which you can
read more about in the Python Library Reference (datetime.tzinfo).

Almost all of the Olson timezones are supported.

# Preparation step (unpackung and patching if necessary)
%setup -q -n %{realname}-%{version}%{?extraver}

make build PYTHON=python
cd build/dist
python setup.py build

cd build/dist
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%if 0%{?suse_version}
%fdupes %{buildroot}%{python_sitelib}/%{realname}/

[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%doc *.txt