]>
Commit | Line | Data |
---|---|---|
5933ce47 | 1 | # TODO: extern/six -> python-six? |
eaf5760c ER |
2 | # |
3 | # Conditional build: | |
5933ce47 | 4 | %bcond_without tests # test target |
eaf5760c | 5 | %bcond_without python2 # CPython 2.x module |
5933ce47 | 6 | %bcond_without python3 # CPython 3.x module |
eaf5760c ER |
7 | |
8 | %define module d2to1 | |
5933ce47 JB |
9 | Summary: Allow using distutils2-like setup.cfg files with setup.py (Python 2 version) |
10 | Summary(pl.UTF-8): Możliwość używania setup.cfg w stylu distutils2 z setup.py (wersja dla Pythona 2) | |
eaf5760c | 11 | Name: python-%{module} |
5933ce47 | 12 | Version: 0.2.12.post1 |
c63aea7a | 13 | Release: 3 |
eaf5760c ER |
14 | License: BSD |
15 | Group: Libraries/Python | |
5933ce47 JB |
16 | #Source0Download: URL: https://pypi.python.org/pypi/d2to1 |
17 | Source0: https://pypi.python.org/packages/source/d/d2to1/%{module}-%{version}.tar.gz | |
18 | # Source0-md5: 1ba7e64ead23cbf104993122f0871030 | |
19 | URL: https://pypi.python.org/pypi/d2to1 | |
eaf5760c | 20 | BuildRequires: rpm-pythonprov |
bdee49b4 | 21 | BuildRequires: rpmbuild(macros) >= 1.710 |
eaf5760c | 22 | %if %{with python2} |
5933ce47 | 23 | BuildRequires: python-modules >= 1:2.5 |
eaf5760c | 24 | BuildRequires: python-setuptools |
4c6d6332 ER |
25 | %if %{with tests} |
26 | BuildRequires: python-nose | |
27 | %endif | |
eaf5760c ER |
28 | %endif |
29 | %if %{with python3} | |
5933ce47 | 30 | BuildRequires: python3-modules >= 1:3.2 |
eaf5760c | 31 | BuildRequires: python3-setuptools |
4c6d6332 ER |
32 | %if %{with tests} |
33 | BuildRequires: python3-nose | |
34 | %endif | |
eaf5760c ER |
35 | %endif |
36 | Requires: python-setuptools | |
37 | BuildArch: noarch | |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %description | |
41 | d2to1 allows using distutils2-like setup.cfg files for a package's | |
42 | metadata with a distribute/setuptools setup.py script. It works by | |
43 | providing a distutils2-formatted setup.cfg file containing all of a | |
44 | package's metadata, and a very minimal setup.py which will slurp its | |
45 | arguments from the setup.cfg. | |
46 | ||
5933ce47 JB |
47 | %description -l pl.UTF-8 |
48 | d2to1 pozwala na używanie plików setup.cfg w stylu distutils2 jako | |
49 | metadanych pakietu ze skryptem setup.py typowym dla | |
50 | distribute/setuptools. Działa poprzez dostarczenie pliku setup.cfg w | |
51 | formacie distutils2, zawierającego wszystkie metadane pakietu oraz | |
52 | minimalnego pliku setup.py, który pobiera wszystkie argumenty z pliku | |
53 | setup.cfg. | |
54 | ||
eaf5760c | 55 | %package -n python3-d2to1 |
5933ce47 JB |
56 | Summary: Allow using distutils2-like setup.cfg files with setup.py (Python 3 version) |
57 | Summary(pl.UTF-8): Możliwość używania setup.cfg w stylu distutils2 z setup.py (wersja dla Pythona 3) | |
eaf5760c ER |
58 | Group: Libraries/Python |
59 | Requires: python3-setuptools | |
60 | ||
61 | %description -n python3-d2to1 | |
62 | d2to1 allows using distutils2-like setup.cfg files for a package's | |
63 | metadata with a distribute/setuptools setup.py script. It works by | |
64 | providing a distutils2-formatted setup.cfg file containing all of a | |
65 | package's metadata, and a very minimal setup.py which will slurp its | |
66 | arguments from the setup.cfg. | |
67 | ||
5933ce47 JB |
68 | %description -n python3-d2to1 -l pl.UTF-8 |
69 | d2to1 pozwala na używanie plików setup.cfg w stylu distutils2 jako | |
70 | metadanych pakietu ze skryptem setup.py typowym dla | |
71 | distribute/setuptools. Działa poprzez dostarczenie pliku setup.cfg w | |
72 | formacie distutils2, zawierającego wszystkie metadane pakietu oraz | |
73 | minimalnego pliku setup.py, który pobiera wszystkie argumenty z pliku | |
74 | setup.cfg. | |
75 | ||
eaf5760c ER |
76 | %prep |
77 | %setup -q -n %{module}-%{version} | |
78 | ||
5933ce47 | 79 | %{__rm} -r %{module}.egg-info |
eaf5760c ER |
80 | |
81 | %build | |
82 | %if %{with python2} | |
ae58a0a0 | 83 | %py_build %{?with_tests:test} |
eaf5760c ER |
84 | %endif |
85 | ||
86 | %if %{with python3} | |
ae58a0a0 | 87 | %py3_build %{?with_tests:test} |
eaf5760c ER |
88 | %endif |
89 | ||
90 | %install | |
91 | rm -rf $RPM_BUILD_ROOT | |
92 | ||
93 | %if %{with python2} | |
ae58a0a0 | 94 | %py_install |
eaf5760c ER |
95 | |
96 | %py_postclean | |
97 | %endif | |
98 | ||
99 | %if %{with python3} | |
ae58a0a0 | 100 | %py3_install |
eaf5760c ER |
101 | %endif |
102 | ||
103 | %clean | |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %if %{with python2} | |
107 | %files | |
108 | %defattr(644,root,root,755) | |
5933ce47 | 109 | %doc CHANGES.rst CONTRIBUTORS LICENSE README.rst |
eaf5760c ER |
110 | %dir %{py_sitescriptdir}/d2to1 |
111 | %{py_sitescriptdir}/d2to1/*.py[co] | |
112 | %dir %{py_sitescriptdir}/d2to1/extern | |
113 | %{py_sitescriptdir}/d2to1/extern/__init__.py[co] | |
114 | %{py_sitescriptdir}/d2to1/extern/six.py[co] | |
115 | %{py_sitescriptdir}/d2to1-%{version}-py*.egg-info | |
116 | %endif | |
117 | ||
118 | %if %{with python3} | |
119 | %files -n python3-d2to1 | |
120 | %defattr(644,root,root,755) | |
5933ce47 JB |
121 | %doc CHANGES.rst CONTRIBUTORS LICENSE README.rst |
122 | %{py3_sitescriptdir}/d2to1 | |
123 | %{py3_sitescriptdir}/d2to1-%{version}-py*.egg-info | |
eaf5760c | 124 | %endif |