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