diff --git a/fedora-review-0.6.1-fix_mock_gteq_141.patch b/fedora-review-0.6.1-fix_mock_gteq_141.patch new file mode 100644 index 0000000..d94d7f6 --- /dev/null +++ b/fedora-review-0.6.1-fix_mock_gteq_141.patch @@ -0,0 +1,79 @@ +From 95c04ed7230671bc813fa1e5df99dc01101f1e85 Mon Sep 17 00:00:00 2001 +From: Björn Esser +Date: Jun 02 2017 21:33:58 +0000 +Subject: Add mock-option '--no-bootstrap-chroot' to defaults + +This is a temporary fix for mock >= 1.4.1 + +--- + +diff --git a/fedora-review.1 b/fedora-review.1 +index e4389ed..0e7a25f 100644 +--- a/fedora-review.1 ++++ b/fedora-review.1 +@@ -117,9 +117,9 @@ with the .cfg suffix stripped. Defaults to the root defined in + /etc/mock/default.cfg + .TP 4 + .B -o, --mock-options "options..." +-Mock options for the build. Defaults to --no-cleanup-after, you might +-want this along with other options +-you provide. ++Mock options for the build. Defaults to --no-cleanup-after --no-clean, ++for use with mock >= 1.4.1 --no-bootstrap-chroot additionally, you might ++want this along with other options you provide. + .TP 4 + .B --no-report + Do not generate the review template. +diff --git a/src/FedoraReview/settings.py b/src/FedoraReview/settings.py +index 8d22751..c637775 100644 +--- a/src/FedoraReview/settings.py ++++ b/src/FedoraReview/settings.py +@@ -26,9 +26,11 @@ import errno + import os + import os.path + import re ++import subprocess + import sys + + import ansi ++from packaging import version + from review_error import ReviewError + from xdg_dirs import XdgDirs + +@@ -53,6 +55,21 @@ def _check_mock_grp(): + raise ReviewError(mock_msg) + + ++def _check_mock_ver(): ++ try: ++ mock_ver = subprocess.check_output(['mock', '--version']) ++ except subprocess.CalledProcessError: ++ mock_ver = '0' ++ return mock_ver ++ ++ ++def _mock_options_default(): ++ mock_opts = '--no-cleanup-after --no-clean' ++ if(version.parse(_check_mock_ver()) >= version.parse('1.4.1')): ++ mock_opts = '--no-bootstrap-chroot %s' % mock_opts ++ return mock_opts ++ ++ + def _add_modes(modes): + ''' Add all mode arguments to the option parser group modes. ''' + modes.add_argument('-b', '--bug', metavar='', +@@ -111,10 +128,10 @@ def _add_optionals(optional): + help='Do not rebuild or install the srpm, use last' + ' built one in mock. Implies --cache') + optional.add_argument('-o', '--mock-options', metavar='', +- default='--no-cleanup-after --no-clean', ++ default=_mock_options_default(), + dest='mock_options', +- help='Options to specify to mock for the build,' +- ' defaults to --no-cleanup-after --no-clean') ++ help=('Options to specify to mock for the build,' ++ ' defaults to %s' % _mock_options_default())) + optional.add_argument('--other-bz', default=None, + metavar='', dest='other_bz', + help='Alternative bugzilla URL') + diff --git a/fedora-review.spec b/fedora-review.spec index 5aa0020..bafc367 100644 --- a/fedora-review.spec +++ b/fedora-review.spec @@ -14,19 +14,22 @@ Name: fedora-review Version: 0.6.1 -Release: 4%{?build_nr}%{?git_tag}%{?dist} +Release: 5%{?build_nr}%{?git_tag}%{?dist} Summary: Review tool for fedora rpm packages License: GPLv2+ -URL: https://fedorahosted.org/FedoraReview/ -Source0: https://fedorahosted.org/released/FedoraReview/%{name}-%{version}%{?git_tag}.tar.gz +URL: https://pagure.io/FedoraReview +Source0: https://releases.pagure.org/FedoraReview/%{name}-%{version}%{?git_tag}.tar.gz + +# Add mock-option '--no-bootstrap-chroot' to defaults, if mock >= 1.4.1 +Patch0: https://pagure.io/fork/besser82/FedoraReview/c/95c04ed7230671bc813fa1e5df99dc01101f1e85.patch#/fedora-review-0.6.1-fix_mock_gteq_141.patch BuildArch: noarch BuildRequires: python-BeautifulSoup BuildRequires: python-bugzilla BuildRequires: python-straight-plugin -%if 0%{?rhel} < 7 +%if 0%{?rhel} && 0%{?rhel} < 7 BuildRequires: python-unittest2 %endif BuildRequires: python2-devel @@ -37,6 +40,7 @@ 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 @@ -92,15 +96,15 @@ Tests are packaged separately due to space concerns. %prep -%setup -q +%autosetup -p 1 %build -%{__python} setup.py --quiet build +%py2_build %install -%{__python} setup.py --quiet install -O1 --skip-build --root $RPM_BUILD_ROOT +%py2_install pkg_dir="$RPM_BUILD_ROOT/%{python_sitelib}/FedoraReview" ln -s %{_datadir}/%{name}/scripts $pkg_dir/scripts ln -s %{_datadir}/%{name}/plugins $pkg_dir/plugins @@ -120,13 +124,15 @@ export MAKE_RELEASE=1 mock --quiet -r fedora-21-i386 --init mock --quiet -r fedora-20-i386 --init mock --quiet -r fedora-21-i386 --uniqueext=hugo --init -python -m unittest discover -f +%{__python2} -m unittest discover -f %endif %files -%doc COPYING AUTHORS README -%{python_sitelib}/* +%doc README +%license COPYING AUTHORS +%{python2_sitelib}/FedoraReview +%{python2_sitelib}/fedora_review-%{version}-py%{python2_version}.egg-info %{_bindir}/fedora-review %{_bindir}/fedora-create-review %{_bindir}/koji-download-scratch @@ -148,6 +154,11 @@ python -m unittest discover -f %changelog +* Fri Jun 02 2017 Björn Esser - 0.6.1-5 +- Add mock-option '--no-bootstrap-chroot' to defaults, if mock >= 1.4.1 +- Update spec file to recent guidelines +- Change package url and source to Pagure + * Fri Feb 10 2017 Fedora Release Engineering - 0.6.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild