]>
Commit | Line | Data |
---|---|---|
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 | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-modules | |
29 | BuildRequires: python3-setuptools | |
30 | %endif | |
31 | Requires: python-setuptools | |
32 | BuildArch: noarch | |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | d2to1 allows using distutils2-like setup.cfg files for a package's | |
37 | metadata with a distribute/setuptools setup.py script. It works by | |
38 | providing a distutils2-formatted setup.cfg file containing all of a | |
39 | package's metadata, and a very minimal setup.py which will slurp its | |
40 | arguments from the setup.cfg. | |
41 | ||
42 | %package -n python3-d2to1 | |
43 | Summary: Allows using distutils2-like setup.cfg files with setup.py | |
44 | Group: Libraries/Python | |
45 | Requires: python3-setuptools | |
46 | ||
47 | %description -n python3-d2to1 | |
48 | d2to1 allows using distutils2-like setup.cfg files for a package's | |
49 | metadata with a distribute/setuptools setup.py script. It works by | |
50 | providing a distutils2-formatted setup.cfg file containing all of a | |
51 | package's metadata, and a very minimal setup.py which will slurp its | |
52 | arguments from the setup.cfg. | |
53 | ||
54 | %prep | |
55 | %setup -q -n %{module}-%{version} | |
56 | ||
57 | rm -r %{module}.egg-info | |
58 | ||
59 | %build | |
60 | %if %{with python2} | |
61 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
62 | %endif | |
63 | ||
64 | %if %{with python3} | |
65 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
66 | %endif | |
67 | ||
68 | %install | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | ||
71 | %if %{with python2} | |
72 | %{__python} setup.py \ | |
73 | build --build-base build-2 \ | |
74 | install --skip-build \ | |
75 | --optimize=2 \ | |
76 | --root=$RPM_BUILD_ROOT | |
77 | ||
78 | %py_postclean | |
79 | %endif | |
80 | ||
81 | %if %{with python3} | |
82 | %{__python3} setup.py \ | |
83 | build --build-base build-3 \ | |
84 | install --skip-build \ | |
85 | --optimize=2 \ | |
86 | --root=$RPM_BUILD_ROOT | |
87 | %endif | |
88 | ||
89 | %clean | |
90 | rm -rf $RPM_BUILD_ROOT | |
91 | ||
92 | %if %{with python2} | |
93 | %files | |
94 | %defattr(644,root,root,755) | |
95 | %doc CHANGES.rst LICENSE README.rst | |
96 | %dir %{py_sitescriptdir}/d2to1 | |
97 | %{py_sitescriptdir}/d2to1/*.py[co] | |
98 | %dir %{py_sitescriptdir}/d2to1/extern | |
99 | %{py_sitescriptdir}/d2to1/extern/__init__.py[co] | |
100 | %{py_sitescriptdir}/d2to1/extern/six.py[co] | |
101 | %{py_sitescriptdir}/d2to1-%{version}-py*.egg-info | |
102 | %endif | |
103 | ||
104 | %if %{with python3} | |
105 | %files -n python3-d2to1 | |
106 | %defattr(644,root,root,755) | |
107 | %doc CHANGES.rst LICENSE README.rst | |
108 | %{py3_sitescriptdir}/* | |
109 | %endif |