]> git.pld-linux.org Git - packages/python-iso8601.git/blob - python-iso8601.spec
a7ecf60b21a8d9b55ac15beed2b8d58652e21f0e
[packages/python-iso8601.git] / python-iso8601.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # do not perform "make test"
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module  iso8601
8 Summary:        Simple module to parse ISO 8601 dates
9 Summary(pl.UTF-8):      Prosty moduł do analizy dat ISO 8601
10 Name:           python-%{module}
11 Version:        0.1.12
12 Release:        5
13 License:        MIT
14 Group:          Development/Languages/Python
15 #Source0Download: https://pypi.org/simple/iso8601/
16 Source0:        https://files.pythonhosted.org/packages/source/i/iso8601/%{module}-%{version}.tar.gz
17 # Source0-md5:  4de940f691c5ea759fb254384c8ddcf6
18 URL:            https://bitbucket.org/micktwomey/pyiso8601
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.714
21 %if %{with python2}
22 BuildRequires:  python-devel >= 1:2.6
23 %{?with_tests:BuildRequires:    python-pytest}
24 BuildRequires:  python-setuptools
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-devel >= 1:3.2
28 %{?with_tests:BuildRequires:    python3-pytest}
29 BuildRequires:  python3-setuptools
30 %endif
31 Requires:       python-modules >= 1:2.6
32 BuildArch:      noarch
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %description
36 This module parses the most common forms of ISO 8601 date strings
37 (e.g. 2007-01-14T20:34:22+00:00) into datetime objects.
38
39 %description -l pl.UTF-8
40 Ten moduł analizuje najbardziej popularne postaci łańcuchów dat ISO
41 8601 (np. 2007-01-14T20:34:22+00:00) i przekształca na obiekty
42 datetime.
43
44 %package -n python3-%{module}
45 Summary:        Simple module to parse ISO 8601 dates
46 Summary(pl.UTF-8):      Prosty moduł do analizy dat ISO 8601
47 Group:          Development/Languages/Python
48 Requires:       python3-modules >= 1:3.2
49
50 %description -n python3-%{module}
51 This module parses the most common forms of ISO 8601 date strings
52 (e.g. 2007-01-14T20:34:22+00:00) into datetime objects.
53
54 %description -n python3-%{module} -l pl.UTF-8
55 Ten moduł analizuje najbardziej popularne postaci łańcuchów dat ISO
56 8601 (np. 2007-01-14T20:34:22+00:00) i przekształca na obiekty
57 datetime.
58
59 %prep
60 %setup -qn %{module}-%{version}
61
62 %build
63 %if %{with python2}
64 %py_build
65
66 %if %{with tests}
67 %{__python} -mpytest iso8601/test_iso8601.py
68 %endif
69 %endif
70
71 %if %{with python3}
72 %py3_build
73
74 %if %{with tests}
75 %{__python} -mpytest iso8601/test_iso8601.py
76 %endif
77 %endif
78
79 %install
80 rm -rf $RPM_BUILD_ROOT
81
82 %if %{with python2}
83 %py_install
84
85 %py_postclean
86 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/iso8601/test_*
87 %endif
88
89 %if %{with python3}
90 %py3_install
91
92 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/iso8601/test_*
93 %endif
94
95 %clean
96 rm -rf $RPM_BUILD_ROOT
97
98 %if %{with python2}
99 %files
100 %defattr(644,root,root,755)
101 %doc LICENSE README.rst
102 %{py_sitescriptdir}/iso8601
103 %{py_sitescriptdir}/iso8601-%{version}-py*.egg-info
104 %endif
105
106 %if %{with python3}
107 %files -n python3-%{module}
108 %defattr(644,root,root,755)
109 %doc LICENSE README.rst
110 %{py3_sitescriptdir}/iso8601
111 %{py3_sitescriptdir}/iso8601-%{version}-py*.egg-info
112 %endif
This page took 0.115052 seconds and 2 git commands to generate.