From aaecab99ec7149ba03cad250ae4e07dadfba0fbf Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Mar 14 2019 14:19:34 +0000 Subject: Update spec for Python 3 --- diff --git a/fedora-review.spec b/fedora-review.spec index e92c7f5..046d044 100644 --- a/fedora-review.spec +++ b/fedora-review.spec @@ -23,36 +23,26 @@ Source0: https://releases.pagure.org/FedoraReview/%{name}-%{version}%{?git_ta BuildArch: noarch -BuildRequires: python-BeautifulSoup -BuildRequires: python-bugzilla -BuildRequires: python-packaging -BuildRequires: python-straight-plugin -%if 0%{?rhel} && 0%{?rhel} < 7 -BuildRequires: python-unittest2 -%endif -BuildRequires: python2-devel -BuildRequires: rpm-python +BuildRequires: python3-beautifulsoup4 +BuildRequires: python3-bugzilla +BuildRequires: python3-packaging +BuildRequires: python3-straight-plugin +BuildRequires: python3-devel +BuildRequires: python3-rpm -Requires: packagedb-cli Requires: fedora-packager -Requires: python-BeautifulSoup -Requires: python-bugzilla -Requires: python-kitchen -Requires: python-packaging -Requires: python-straight-plugin -Requires: packagedb-cli -Requires: rpm-python +Requires: python3-beautifulsoup4 +Requires: python3-bugzilla +Requires: python3-packaging +Requires: python3-straight-plugin +Requires: python3-rpm # licensecheck used to be in rpmdevtools, moved to devscripts later # this is compatible with both situations without ifdefs Requires: %{_bindir}/licensecheck -%if 0%{?fedora} > 21 Requires: dnf-plugins-core -%else -Requires: yum-utils -%endif # Let's be consistent with the name used on fedorahosted -provides: FedoraReview = %{version}-%{release} +Provides: FedoraReview = %{version}-%{release} Provides: %{name}-php-phpci = %{version}-%{release} Obsoletes: %{name}-php-phpci < %{version}-%{release} @@ -87,7 +77,7 @@ fedora-review ruby-specific tests, not installed by default. %package tests Summary: Test and test data files for fedora-review Requires: %{name} = %{version}-%{release} -Requires: python-nose +Requires: python3-nose %description tests Tests are packaged separately due to space concerns. @@ -98,20 +88,24 @@ Tests are packaged separately due to space concerns. %build -%py2_build +%py3_build %install -%py2_install -pkg_dir="$RPM_BUILD_ROOT/%{python_sitelib}/FedoraReview" +%py3_install +pkg_dir="%{buildroot}/%{python3_sitelib}/FedoraReview" ln -s %{_datadir}/%{name}/scripts $pkg_dir/scripts ln -s %{_datadir}/%{name}/plugins $pkg_dir/plugins cd test bash < restore-links.sh rm restore-links.sh remember-links cd .. -cp -ar test "$RPM_BUILD_ROOT%{_datadir}/%{name}" -cp -a pep8.conf pylint.conf "$RPM_BUILD_ROOT%{_datadir}/%{name}" +cp -ar test "%{buildroot}%{_datadir}/%{name}" +cp -a pep8.conf pylint.conf "%{buildroot}%{_datadir}/%{name}" + +# Fix shebangs in %%{_bindir}. +chmod -c 0755 %{buildroot}%{_bindir}/* +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}%{python3_sitelib} %{buildroot}%{_bindir}/* %check @@ -122,15 +116,15 @@ export MAKE_RELEASE=1 mock --quiet -r fedora-25-i386 --init mock --quiet -r fedora-26-i386 --init mock --quiet -r fedora-26-i386 --uniqueext=hugo --init -%{__python2} -m unittest discover -f +%{__python3} -m unittest discover -f %endif %files %doc README %license COPYING AUTHORS -%{python2_sitelib}/FedoraReview -%{python2_sitelib}/fedora_review-%{version}-py%{python2_version}.egg-info +%{python3_sitelib}/FedoraReview +%{python3_sitelib}/fedora_review-%{version}-py%{python3_version}.egg-info %{_bindir}/fedora-review %{_bindir}/fedora-create-review %{_bindir}/koji-download-scratch