|
| 1 | +%global srcname newdoc |
| 2 | + |
| 3 | +Name: python-%{srcname} |
| 4 | +Version: 1.3.1 |
| 5 | +Release: 1%{?dist} |
| 6 | +Summary: A script to generate assembly and module AsciiDoc files from templates |
| 7 | + |
| 8 | +License: GPLv3+ |
| 9 | +URL: https://pypi.python.org/pypi/%{srcname} |
| 10 | +Source0: %pypi_source |
| 11 | + |
| 12 | +BuildArch: noarch |
| 13 | +BuildRequires: python2-devel python3-devel |
| 14 | + |
| 15 | +%description |
| 16 | +A script to generate assembly and module AsciiDoc files from templates |
| 17 | + |
| 18 | +%package -n python2-%{srcname} |
| 19 | +Summary: %{summary} |
| 20 | +%{?python_provide:%python_provide python2-%{srcname}} |
| 21 | + |
| 22 | +%description -n python2-%{srcname} |
| 23 | +A script to generate assembly and module AsciiDoc files from templates |
| 24 | + |
| 25 | + |
| 26 | +%package -n python3-%{srcname} |
| 27 | +Summary: %{summary} |
| 28 | +%{?python_provide:%python_provide python3-%{srcname}} |
| 29 | + |
| 30 | +%description -n python3-%{srcname} |
| 31 | +A script to generate assembly and module AsciiDoc files from templates |
| 32 | + |
| 33 | + |
| 34 | +%prep |
| 35 | +%autosetup -n %{srcname}-%{version} |
| 36 | + |
| 37 | +%build |
| 38 | +%py2_build |
| 39 | +%py3_build |
| 40 | + |
| 41 | +%install |
| 42 | +# Must do the python2 install first because the scripts in /usr/bin are |
| 43 | +# overwritten with every setup.py install, and in general we want the |
| 44 | +# python3 version to be the default. |
| 45 | +# If, however, we're installing separate executables for python2 and python3, |
| 46 | +# the order needs to be reversed so the unversioned executable is the python2 one. |
| 47 | +%py2_install |
| 48 | +%py3_install |
| 49 | + |
| 50 | +%check |
| 51 | +%{__python2} setup.py test |
| 52 | +%{__python3} setup.py test |
| 53 | + |
| 54 | +# Note that there is no %%files section for the unversioned python module if we are building for several python runtimes |
| 55 | +%files -n python2-%{srcname} |
| 56 | +%license LICENSE |
| 57 | +%doc README.md |
| 58 | +%{python2_sitelib}/* |
| 59 | + |
| 60 | +%files -n python3-%{srcname} |
| 61 | +%license COPYING |
| 62 | +%doc README.md |
| 63 | +%{python3_sitelib}/* |
| 64 | +%{_bindir}/newdoc |
| 65 | + |
| 66 | +%changelog |
0 commit comments