diff options
author | Artur Wiebe <artur@4wiebe.de> | 2018-08-31 19:39:18 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-09-17 10:22:42 +0200 |
commit | 475d38adcf2b8e499915cab80084f4d60f6b4c86 (patch) | |
tree | d1ef18836aed3dfcb55a6279510696c9708931df | |
parent | 3fb2614bc0d5fda0f3f07f0f9ae0b84bb61f1b0f (diff) | |
download | ptxdist-475d38adcf2b8e499915cab80084f4d60f6b4c86.tar.gz ptxdist-475d38adcf2b8e499915cab80084f4d60f6b4c86.tar.xz |
python3-pytz: new package
Signed-off-by: Artur Wiebe <artur@4wiebe.de>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | patches/pytz-2018.5/0001-use-system-timezone-data.patch | 40 | ||||
-rw-r--r-- | patches/pytz-2018.5/series | 1 | ||||
-rw-r--r-- | rules/python3-pytz.in | 14 | ||||
-rw-r--r-- | rules/python3-pytz.make | 51 |
4 files changed, 106 insertions, 0 deletions
diff --git a/patches/pytz-2018.5/0001-use-system-timezone-data.patch b/patches/pytz-2018.5/0001-use-system-timezone-data.patch new file mode 100644 index 000000000..def117ee7 --- /dev/null +++ b/patches/pytz-2018.5/0001-use-system-timezone-data.patch @@ -0,0 +1,40 @@ +From 09acc56fe52e53042c8d2dcb458b017de55a626d Mon Sep 17 00:00:00 2001 +From: Artur Wiebe <artur@4wiebe.de> +Date: Tue, 11 Sep 2018 10:07:27 +0200 +Subject: [PATCH] use system timezone data + +--- + pytz/__init__.py | 2 +- + pytz/tzfile.py | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/pytz/__init__.py b/pytz/__init__.py +index 120fab4..006db4d 100644 +--- a/pytz/__init__.py ++++ b/pytz/__init__.py +@@ -91,7 +91,7 @@ def open_resource(name): + if zoneinfo_dir is not None: + filename = os.path.join(zoneinfo_dir, *name_parts) + else: +- filename = os.path.join(os.path.dirname(__file__), ++ filename = os.path.join('/usr','share', + 'zoneinfo', *name_parts) + if not os.path.exists(filename): + # http://bugs.launchpad.net/bugs/383171 - we avoid using this +diff --git a/pytz/tzfile.py b/pytz/tzfile.py +index 25117f3..e06ce77 100644 +--- a/pytz/tzfile.py ++++ b/pytz/tzfile.py +@@ -126,7 +126,8 @@ def build_tzinfo(zone, fp): + if __name__ == '__main__': + import os.path + from pprint import pprint +- base = os.path.join(os.path.dirname(__file__), 'zoneinfo') ++ # use system timezone data ++ base = '/usr/share/zoneinfo' + tz = build_tzinfo('Australia/Melbourne', + open(os.path.join(base, 'Australia', 'Melbourne'), 'rb')) + tz = build_tzinfo('US/Eastern', +-- +2.18.0 + diff --git a/patches/pytz-2018.5/series b/patches/pytz-2018.5/series new file mode 100644 index 000000000..f205d3297 --- /dev/null +++ b/patches/pytz-2018.5/series @@ -0,0 +1 @@ +0001-use-system-timezone-data.patch diff --git a/rules/python3-pytz.in b/rules/python3-pytz.in new file mode 100644 index 000000000..24146309c --- /dev/null +++ b/rules/python3-pytz.in @@ -0,0 +1,14 @@ +## SECTION=python3 + +config PYTHON3_PYTZ + tristate + select PYTHON3 + select HOST_PYTHON3_SETUPTOOLS + select TIMEZONE if RUNTIME + prompt "pytz" + help + 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). diff --git a/rules/python3-pytz.make b/rules/python3-pytz.make new file mode 100644 index 000000000..538bc7a46 --- /dev/null +++ b/rules/python3-pytz.make @@ -0,0 +1,51 @@ +# -*-makefile-*- +# +# Copyright (C) 2018 by Artur Wiebe <artur@4wiebe.de> +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_PYTHON3_PYTZ) += python3-pytz + +PYTHON3_PYTZ_VERSION := 2018.5 +PYTHON3_PYTZ_MD5 := 45409cbfa3927bdd2f3ee914dd5b1060 +PYTHON3_PYTZ := pytz-$(PYTHON3_PYTZ_VERSION) +PYTHON3_PYTZ_SUFFIX := tar.gz +PYTHON3_PYTZ_URL := https://pypi.python.org/packages/ca/a9/62f96decb1e309d6300ebe7eee9acfd7bccaeedd693794437005b9067b44/$(PYTHON3_PYTZ).$(PYTHON3_PYTZ_SUFFIX)\#md5=$(PYTHON3_PYTZ_MD5) +PYTHON3_PYTZ_SOURCE := $(SRCDIR)/$(PYTHON3_PYTZ).$(PYTHON3_PYTZ_SUFFIX) +PYTHON3_PYTZ_DIR := $(BUILDDIR)/$(PYTHON3_PYTZ) +PYTHON3_PYTZ_LICENSE := MIT + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +PYTHON3_PYTZ_CONF_TOOL := python3 + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/python3-pytz.targetinstall: + @$(call targetinfo) + + @$(call install_init, python3-pytz) + @$(call install_fixup,python3-pytz,PRIORITY,optional) + @$(call install_fixup,python3-pytz,SECTION,base) + @$(call install_fixup,python3-pytz,AUTHOR,"Artur Wiebe <artur@4wiebe.de>") + @$(call install_fixup,python3-pytz,DESCRIPTION,missing) + + @$(call install_glob, python3-pytz, 0, 0, -, \ + /usr/lib/python$(PYTHON3_MAJORMINOR)/site-packages/pytz,, *.py */zoneinfo*) + + @$(call install_finish,python3-pytz) + + @$(call touch) + +# vim: syntax=make |