]>
Commit | Line | Data |
---|---|---|
eaf5760c ER |
1 | # TODO |
2 | # - extern/six -> python-six? | |
3 | ||
4 | # | |
5 | # Conditional build: | |
6 | %bcond_without doc # don't build doc | |
7 | %bcond_without tests # do not perform "make test" | |
8 | %bcond_without python2 # CPython 2.x module | |
9 | %bcond_with python3 # CPython 3.x module | |
10 | ||
11 | %define module d2to1 | |
12 | Summary: Allows using distutils2-like setup.cfg files with setup.py | |
13 | Name: python-%{module} | |
14 | Version: 0.2.11 | |
c28ed2b1 | 15 | Release: 2 |
eaf5760c ER |
16 | License: BSD |
17 | Group: Libraries/Python | |
18 | Source0: http://pypi.python.org/packages/source/d/d2to1/%{module}-%{version}.tar.gz | |
19 | # Source0-md5: 81addef3dde584ab89b35ada8177c0d0 | |
20 | URL: http://pypi.python.org/pypi/d2to1 | |
21 | BuildRequires: rpm-pythonprov | |
22 | BuildRequires: rpmbuild(macros) >= 1.219 | |
23 | %if %{with python2} | |
24 | BuildRequires: python-modules | |
25 | BuildRequires: python-setuptools | |
4c6d6332 ER |
26 | %if %{with tests} |
27 | BuildRequires: python-nose | |
28 | %endif | |
eaf5760c ER |
29 | %endif |
30 | %if %{with python3} | |
31 | BuildRequires: python3-modules | |
32 | BuildRequires: python3-setuptools | |
4c6d6332 ER |
33 | %if %{with tests} |
34 | BuildRequires: python3-nose | |
35 | %endif | |
eaf5760c ER |
36 | %endif |
37 | Requires: python-setuptools | |
38 | BuildArch: noarch | |
39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
40 | ||
41 | %description | |
42 | d2to1 allows using distutils2-like setup.cfg files for a package's | |
43 | metadata with a distribute/setuptools setup.py script. It works by | |
44 | providing a distutils2-formatted setup.cfg file containing all of a | |
45 | package's metadata, and a very minimal setup.py which will slurp its | |
46 | arguments from the setup.cfg. | |
47 | ||
48 | %package -n python3-d2to1 | |
49 | Summary: Allows using distutils2-like setup.cfg files with setup.py | |
50 | Group: Libraries/Python | |
51 | Requires: python3-setuptools | |
52 | ||
53 | %description -n python3-d2to1 | |
54 | d2to1 allows using distutils2-like setup.cfg files for a package's | |
55 | metadata with a distribute/setuptools setup.py script. It works by | |
56 | providing a distutils2-formatted setup.cfg file containing all of a | |
57 | package's metadata, and a very minimal setup.py which will slurp its | |
58 | arguments from the setup.cfg. | |
59 | ||
60 | %prep | |
61 | %setup -q -n %{module}-%{version} | |
62 | ||
63 | rm -r %{module}.egg-info | |
64 | ||
65 | %build | |
66 | %if %{with python2} | |
ae58a0a0 | 67 | %py_build %{?with_tests:test} |
eaf5760c ER |
68 | %endif |
69 | ||
70 | %if %{with python3} | |
ae58a0a0 | 71 | %py3_build %{?with_tests:test} |
eaf5760c ER |
72 | %endif |
73 | ||
74 | %install | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
77 | %if %{with python2} | |
ae58a0a0 | 78 | %py_install |
eaf5760c ER |
79 | |
80 | %py_postclean | |
81 | %endif | |
82 | ||
83 | %if %{with python3} | |
ae58a0a0 | 84 | %py3_install |
eaf5760c ER |
85 | %endif |
86 | ||
87 | %clean | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
90 | %if %{with python2} | |
91 | %files | |
92 | %defattr(644,root,root,755) | |
93 | %doc CHANGES.rst LICENSE README.rst | |
94 | %dir %{py_sitescriptdir}/d2to1 | |
95 | %{py_sitescriptdir}/d2to1/*.py[co] | |
96 | %dir %{py_sitescriptdir}/d2to1/extern | |
97 | %{py_sitescriptdir}/d2to1/extern/__init__.py[co] | |
98 | %{py_sitescriptdir}/d2to1/extern/six.py[co] | |
99 | %{py_sitescriptdir}/d2to1-%{version}-py*.egg-info | |
100 | %endif | |
101 | ||
102 | %if %{with python3} | |
103 | %files -n python3-d2to1 | |
104 | %defattr(644,root,root,755) | |
105 | %doc CHANGES.rst LICENSE README.rst | |
106 | %{py3_sitescriptdir}/* | |
107 | %endif |