blob: 6af6c55b0c09d171f9bee8329dbcc3444a67896e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
%if 0%{?fedora}
%global with_python3 1
%global _docdir_fmt %{name}
%endif
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%endif
%global pkgname tambo
Name: python-%{pkgname}
Version: 0.0.9
Release: 2%{?dist}
Summary: A command line object dispatcher
Group: Development/Languages
License: MIT
URL: https://github.com/alfredodeza/tambo
Source0: https://pypi.python.org/packages/source/t/%{pkgname}/%{pkgname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: pytest
BuildRequires: python2-devel
BuildRequires: python-mock
BuildRequires: python-setuptools
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-pytest
BuildRequires: python3-mock
BuildRequires: python3-setuptools
%endif # with_python3
%description
Use any argument parser you want for each sub-command. Easily manage each
command as a self-contained application.
%if 0%{?with_python3}
%package -n python3-tambo
Summary: A command line object dispatcher
Group: Development/Languages
Requires: python3
%description -n python3-tambo
Use any argument parser you want for each sub-command. Easily manage each
command as a self-contained application.
%endif # with_python3
%prep
%setup -q -n %{pkgname}-%{version}
%if 0%{?with_python3}
cp -a . %{py3dir}
%endif # with_python3
%build
%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif # with_python3
%install
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
popd
%endif # with_python3
%check
export PYTHONPATH=$(pwd)
py.test-%{python_version} -v tambo/tests
%if 0%{?with_python3}
pushd %{py3dir}
py.test-%{python3_version} -v tambo/tests
popd
%endif # with_python3
%files
%{!?_licensedir:%global license %%doc}
%doc README.rst
%license LICENSE
%{python2_sitelib}/*
%if 0%{?with_python3}
%files -n python3-tambo
%{python3_sitelib}/*
%license LICENSE
%doc README.rst
%endif # with_python3
%changelog
* Sat Jun 27 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.0.9-2
- set _docdir_fmt to get the same license and doc directories for python- and
python3- subpackages (rhbz#1208665)
* Thu Apr 02 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.0.9-1
- Initial package
|