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