]>
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 | |
15 | Release: 1 | |
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} | |
67 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
68 | %endif | |
69 | ||
70 | %if %{with python3} | |
71 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
72 | %endif | |
73 | ||
74 | %install | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
77 | %if %{with python2} | |
78 | %{__python} setup.py \ | |
79 | build --build-base build-2 \ | |
80 | install --skip-build \ | |
81 | --optimize=2 \ | |
82 | --root=$RPM_BUILD_ROOT | |
83 | ||
84 | %py_postclean | |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
88 | %{__python3} setup.py \ | |
89 | build --build-base build-3 \ | |
90 | install --skip-build \ | |
91 | --optimize=2 \ | |
92 | --root=$RPM_BUILD_ROOT | |
93 | %endif | |
94 | ||
95 | %clean | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %if %{with python2} | |
99 | %files | |
100 | %defattr(644,root,root,755) | |
101 | %doc CHANGES.rst LICENSE README.rst | |
102 | %dir %{py_sitescriptdir}/d2to1 | |
103 | %{py_sitescriptdir}/d2to1/*.py[co] | |
104 | %dir %{py_sitescriptdir}/d2to1/extern | |
105 | %{py_sitescriptdir}/d2to1/extern/__init__.py[co] | |
106 | %{py_sitescriptdir}/d2to1/extern/six.py[co] | |
107 | %{py_sitescriptdir}/d2to1-%{version}-py*.egg-info | |
108 | %endif | |
109 | ||
110 | %if %{with python3} | |
111 | %files -n python3-d2to1 | |
112 | %defattr(644,root,root,755) | |
113 | %doc CHANGES.rst LICENSE README.rst | |
114 | %{py3_sitescriptdir}/* | |
115 | %endif |