diff --git a/git-review.spec b/git-review.spec index 0549f08..4d118cd 100644 --- a/git-review.spec +++ b/git-review.spec @@ -1,22 +1,36 @@ +# Enable Python 3 only for Fedora +%global with_python3 1 + Name: git-review Version: 1.25.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Git helper for integration with Gerrit Group: Development/Tools License: ASL 2.0 -URL: https://github.com/openstack-infra/git-review -Source0: http://tarballs.openstack.org/git-review/git-review-%{version}.tar.gz +URL: https://github.com/openstack-infra/%{name} +Source0: http://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz BuildArch: noarch +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-pbr +BuildRequires: python3-setuptools +%else BuildRequires: python2-devel -BuildRequires: python-pbr -BuildRequires: python-setuptools +BuildRequires: python2-pbr +BuildRequires: python2-setuptools +%endif Requires: git -Requires: python-requests -Requires: python-setuptools +%if 0%{?with_python3} +Requires: python3-requests +Requires: python3-setuptools +%else +Requires: python2-requests +Requires: python2-setuptools +%endif %description An extension for source control system Git that creates and manages review @@ -26,14 +40,21 @@ requests in the patch management system Gerrit. It replaces the rfc.sh script. %setup -q %build -%{__python} setup.py build +%if 0%{?with_python3} +%py3_build +%else +%py2_build +%endif sed -i 's/\r//' LICENSE %install -rm -rf %{buildroot} -%{__python} setup.py install -O1 --skip-build --root %{buildroot} +%if 0%{?with_python3} +%py3_install +%else +%py2_install +%endif -mkdir -p %{buildroot}%{_sysconfdir}/git-review/ +mkdir -p %{buildroot}%{_sysconfdir}/%{name}/ # We do not save ".gitreview" as dot.gitreview because the man page has it too. # cp .gitreview #{buildroot}/usr/share/doc/dot.gitreview @@ -45,17 +66,23 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) +%license LICENSE +%doc AUTHORS README.rst %{_bindir}/git-review %{_mandir}/man1/git-review.1.gz # Our package name is git-review, but setup.py installs with underscore. -%{python_sitelib}/git_review/ -%{python_sitelib}/git_review-%{version}-*.egg-info/ - -%license LICENSE -%doc AUTHORS -%doc README.rst +%if 0%{?with_python3} +%{python3_sitelib}/git_review/ +%{python3_sitelib}/git_review-%{version}-py%{python3_version}*.egg-info/ +%else +%{python2_sitelib}/git_review/ +%{python2_sitelib}/git_review-%{version}-py%{python2_version}*.egg-info/ +%endif %changelog +* Wed Sep 14 2016 Pete Zaitcev - 1.25.0-4 +- Add Python 3 (#1322471) + * Tue Jul 19 2016 Fedora Release Engineering - 1.25.0-3 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages