]> git.pld-linux.org Git - packages/python-traitlets.git/blame - python-traitlets.spec
Version 4.3.2. rel. 1. Initial.
[packages/python-traitlets.git] / python-traitlets.spec
CommitLineData
b2db72f4
MK
1# TODO:
2# - fix docs
3# Conditional build:
4%bcond_with doc # don't build doc
5%bcond_with tests # do not perform "make test"
6%bcond_without python2 # CPython 2.x module
7%bcond_without python3 # CPython 3.x module
8
9# NOTE: 'module' should match the python import path, not the egg name
10%define module traitlets
11Summary: A configuration system for Python applications
12Summary(pl.UTF-8): System konfiguracji dla aplikacji w Pythonie.
13Name: python-%{module}
14Version: 4.3.2
15Release: 1
16License: BSD
17Group: Libraries/Python
18Source0: https://github.com/ipython/traitlets/archive/%{version}.tar.gz
19# Source0-md5: 0b5b7986aef676d12f31a16cbbe3ed92
20URL: https://traitlets.readthedocs.io/en/stable/
21BuildRequires: rpm-pythonprov
22# for the py_build, py_install macros
23BuildRequires: rpmbuild(macros) >= 1.714
24%if %{with python2}
25BuildRequires: python-modules
26BuildRequires: python-setuptools
27BuildRequires: python-sphinx_rtd_theme
28%endif
29%if %{with python3}
30BuildRequires: python3-modules
31BuildRequires: python3-setuptools
32BuildRequires: python3-sphinx_rtd_theme
33
34%endif
35# when using /usr/bin/env or other in-place substitutions
36#BuildRequires: sed >= 4.0
37# replace with other requires if defined in setup.py
38Requires: python-modules
39BuildArch: noarch
40BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42%description
43Traitlets is a framework that lets Python classes have attributes with
44type checking, dynamically calculated default values, and ‘on change’
45callbacks.
46
47%description -l pl.UTF-8
48System konfiguracji dla aplikacji w Pythonie.
49
50%package -n python3-%{module}
51Summary: -
52Summary(pl.UTF-8): -
53Group: Libraries/Python
54Requires: python3-modules
55
56%description -n python3-%{module}
57
58%description -n python3-%{module} -l pl.UTF-8
59
60%package apidocs
61Summary: %{module} API documentation
62Summary(pl.UTF-8): Dokumentacja API %{module}
63Group: Documentation
64
65%description apidocs
66API documentation for %{module}.
67
68%description apidocs -l pl.UTF-8
69Dokumentacja API %{module}.
70
71%prep
72%setup -q -n %{module}-%{version}
73
74#%{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py
75
76%build
77%if %{with python2}
78%py_build %{?with_tests:test}
79%endif
80
81%if %{with python3}
82%py3_build %{?with_tests:test}
83%endif
84
85%if %{with doc}
86cd docs
87%{__make} -j1 html
88rm -rf _build/html/_sources
89%endif
90
91%install
92rm -rf $RPM_BUILD_ROOT
93
94%if %{with python2}
95%py_install
96
97%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
98%py_comp $RPM_BUILD_ROOT%{py_sitedir}
99
100%py_postclean
101%endif
102
103%if %{with python3}
104%py3_install
105%endif
106
107# in case there are examples provided
108%if %{with python2}
109install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
110cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
111find $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} -name '*.py' \
112 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
113%endif
114%if %{with python3}
115install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
116cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
117find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
118 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
119%endif
120
121%clean
122rm -rf $RPM_BUILD_ROOT
123
124%if %{with python2}
125%files
126%defattr(644,root,root,755)
127%doc README.md
128%{py_sitescriptdir}/%{module}
129%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
130%{_examplesdir}/python-%{module}-%{version}
131%endif
132
133%if %{with python3}
134%files -n python3-%{module}
135%defattr(644,root,root,755)
136%doc README.md
137%{py3_sitescriptdir}/%{module}
138%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
139%{_examplesdir}/python3-%{module}-%{version}
140%endif
141
142%if %{with doc}
143%files apidocs
144%defattr(644,root,root,755)
145%doc docs/_build/html/*
146%endif
This page took 0.16619 seconds and 4 git commands to generate.