]>
Commit | Line | Data |
---|---|---|
9070e283 AM |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # Python 2.x module | |
4 | %bcond_without python3 # Python 3.x module | |
03c7cb18 | 5 | |
9070e283 | 6 | %define module rpdb |
9070e283 AM |
7 | Summary: pdb wrapper with remote access via tcp socket |
8 | Name: python-rpdb | |
9 | Version: 0.1.3 | |
8b0379a7 | 10 | Release: 3 |
9070e283 AM |
11 | License: ? |
12 | Group: Development/Languages/Python | |
13 | Source0: https://pypi.python.org/packages/source/r/rpdb/rpdb-%{version}.tar.gz | |
14 | # Source0-md5: 4f350f523446a9100395d41b0b05c6cb | |
15 | URL: https://pypi.python.org/pypi/rpdb/ | |
03c7cb18 ER |
16 | BuildRequires: rpm-pythonprov |
17 | BuildRequires: rpmbuild(macros) >= 1.219 | |
9070e283 AM |
18 | %if %{with python2} |
19 | BuildRequires: python-devel | |
20 | BuildRequires: python-modules | |
9070e283 AM |
21 | %endif |
22 | %if %{with python3} | |
23 | BuildRequires: python3-2to3 | |
24 | BuildRequires: python3-devel | |
25 | BuildRequires: python3-modules | |
26 | %endif | |
03c7cb18 | 27 | Requires: python |
9070e283 AM |
28 | Requires: python-devel-src |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | A wrapper around pdb that will re-route stdin and stdout to a socket | |
34 | handler. | |
35 | ||
03c7cb18 | 36 | %package -n python3-%{module} |
9070e283 | 37 | Summary: pdb wrapper with remote access via tcp socket |
9070e283 AM |
38 | Group: Libraries/Python |
39 | Requires: python3 | |
40 | Requires: python3-devel-tools | |
41 | ||
42 | %description -n python3-%{module} | |
43 | A wrapper around pdb that will re-route stdin and stdout to a socket | |
44 | handler. | |
45 | ||
46 | %prep | |
47 | %setup -q -n %{module}-%{version} | |
48 | ||
49 | %build | |
50 | %if %{with python2} | |
03c7cb18 | 51 | %{__python} setup.py build --build-base py2 |
9070e283 AM |
52 | %endif |
53 | %if %{with python3} | |
03c7cb18 | 54 | %{__python3} setup.py build --build-base py3 |
9070e283 AM |
55 | %endif |
56 | ||
57 | %install | |
58 | rm -rf $RPM_BUILD_ROOT | |
59 | %if %{with python2} | |
03c7cb18 | 60 | %{__python} setup.py build \ |
9070e283 AM |
61 | --build-base py2 \ |
62 | install \ | |
63 | --optimize 2 \ | |
64 | --root=$RPM_BUILD_ROOT | |
03c7cb18 ER |
65 | |
66 | %py_postclean | |
9070e283 | 67 | %endif |
03c7cb18 | 68 | |
9070e283 AM |
69 | %if %{with python3} |
70 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
03c7cb18 | 71 | %{__python3} setup.py build \ |
9070e283 AM |
72 | --build-base py3 \ |
73 | install \ | |
74 | --optimize 2 \ | |
75 | --root=$RPM_BUILD_ROOT | |
76 | %endif | |
77 | ||
78 | %clean | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %if %{with python2} | |
82 | %files | |
83 | %defattr(644,root,root,755) | |
84 | %doc PKG-INFO | |
03c7cb18 ER |
85 | %{py_sitescriptdir}/rpdb |
86 | %{py_sitescriptdir}/rpdb-%{version}-py*.egg-info | |
9070e283 AM |
87 | %endif |
88 | ||
89 | %if %{with python3} | |
90 | %files -n python3-%{module} | |
91 | %defattr(644,root,root,755) | |
92 | %doc PKG-INFO | |
03c7cb18 ER |
93 | %{py3_sitescriptdir}/rpdb |
94 | %{py3_sitescriptdir}/rpdb-%{version}-py*.egg-info | |
9070e283 | 95 | %endif |