%global srcname twine Name: python-%{srcname} Version: 1.7.4 Release: 1%{?dist} Summary: Collection of utilities for interacting with PyPI License: ASL 2.0 URL: https://github.com/pypa/%{srcname} Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz # There's a shebang in twine/__main__.py which generates rpmlint warnings. Patch0: 0001-Remove-shebang-from-__main__.py.patch BuildArch: noarch %description Twine is a utility for interacting with PyPI. Currently it only supports registering projects and uploading distributions. %package -n python2-%{srcname} Summary: %{summary} Requires: python2-clint Requires: python2-pkginfo >= 1.0 Requires: python2-requests >= 2.3.0 Requires: python2-requests-toolbelt >= 0.5.1 Requires: python2-setuptools >= 0.7.0 # Test requirements BuildRequires: python2-devel BuildRequires: python2-pkginfo >= 1.0 BuildRequires: python2-requests >= 2.3.0 BuildRequires: python2-requests-toolbelt >= 0.5.1 BuildRequires: python2-setuptools >= 0.7.0 %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} Twine is a utility for interacting with PyPI. Currently it only supports registering projects and uploading distributions. %package -n python3-%{srcname} Summary: %{summary} Requires: python3-clint Requires: python3-pkginfo >= 1.0 Requires: python3-requests >= 2.3.0 Requires: python3-requests-toolbelt >= 0.5.1 Requires: python3-setuptools >= 0.7.0 # Test requirements BuildRequires: python3-devel BuildRequires: python3-pkginfo >= 1.0 BuildRequires: python3-requests >= 2.3.0 BuildRequires: python3-requests-toolbelt >= 0.5.1 BuildRequires: python3-setuptools >= 0.7.0 %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} Twine is a utility for interacting with PyPI. Currently it only supports registering projects and uploading distributions. %package doc Summary: Documentation for the python2-twine and python3-twine packages BuildRequires: python3-sphinx BuildRequires: python3-releases %description doc Documentation for the python2-twine and python3-twine packages. Twine is a utility for interacting with PyPI. Currently it only supports registering projects and uploading distributions. %prep %autosetup -p1 -n %{srcname}-%{version} %build %py2_build %py3_build make %{?_smp_mflags} -C docs SPHINXBUILD=sphinx-build-3 html PYTHONPATH=$(pwd) make %{?_smp_mflags} -C docs SPHINXBUILD=sphinx-build-3 man PYTHONPATH=$(pwd) rm docs/_build/html/objects.inv rm docs/_build/html/.buildinfo %install # Provide both Python 3 and Python 2 binary entries %py3_install mv %{buildroot}%{_bindir}/twine %{buildroot}%{_bindir}/twine-%{python3_version} ln -s %{_bindir}/twine-%{python3_version} %{buildroot}%{_bindir}/twine-3 %py2_install ln -s %{_bindir}/twine %{buildroot}%{_bindir}/twine-%{python2_version} ln -s %{_bindir}/twine-%{python2_version} %{buildroot}%{_bindir}/twine-2 install -p -D -T -m 0644 docs/_build/man/%{srcname}.1 %{buildroot}%{_mandir}/man1/%{srcname}.1 %check %{__python2} setup.py test %{__python3} setup.py test %files -n python2-%{srcname} %license LICENSE %doc README.rst AUTHORS %doc %{_mandir}/man1/%{srcname}.1* %{python2_sitelib}/* %{_bindir}/twine %{_bindir}/twine-2 %{_bindir}/twine-%{python2_version} %files -n python3-%{srcname} %license LICENSE %doc README.rst AUTHORS %{python3_sitelib}/* %{_bindir}/twine-3 %{_bindir}/twine-%{python3_version} %files doc %license LICENSE %doc README.rst AUTHORS docs/_build/html %changelog * Fri Jul 15 2016 Jeremy Cline - 1.7.4-1 - Update to the latest upstream release - Add clint as a dependency * Tue Jul 12 2016 Jeremy Cline - 1.6.5-5 - Remove unnecessary shebang in __main__.py that caused rpmlint errors * Mon Jul 11 2016 Jeremy Cline - 1.6.5-4 - Mark man pages as docs * Mon Jul 11 2016 Jeremy Cline - 1.6.5-3 - Use python_version macro rather than hardcoding version numbers. * Fri Jul 08 2016 Jeremy Cline - 1.6.5-2 - Update Source0 url to the -.tar.gz format * Thu Jun 09 2016 Jeremy Cline - 1.6.5-1 - Initial commit