#invoke with "--with tests" to enable tests
%bcond_with tests
# See notes in make_release which patches this.
#global git_tag .fa1afe1
Name: fedora-review
Version: 0.4.0
Release: 4%{?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
BuildArch: noarch
BuildRequires: python-BeautifulSoup
BuildRequires: python-bugzilla
BuildRequires: python-straight-plugin
BuildRequires: python2-devel
BuildRequires: rpm-python
BuildRequires: python-argparse
Requires: fedora-packager
Requires: python-BeautifulSoup
Requires: python-bugzilla
Requires: python-kitchen
Requires: python-straight-plugin
Requires: rpm-python
Requires: rpmdevtools
Requires: python-argparse
# Let's be consistent with the name used on fedorahosted
provides: FedoraReview = %{version}-%{release}
# Applied upstream - 5aee7f3
Patch1: 0001-Fix-syntax-error.patch
# Applied upstream - caeb135
Patch2: 0002-Handle-characters-i-package-name-BZ908830.patch
# Applied upstream - d7298ce
Patch3: 0003-Fix-large-docs-to-separate-doc-package-test-BZ-90883.patch
# Applied upstream - d7aab9e
Patch4: 0004-Use-REVIEW_NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch
# Applied upstream - 1216801, #912182
Patch5: 0005-Make-sure-Mock.init-is-invoked-before-other-usage-91.patch
# Applied upstream - b493e1c
Patch6: 0006-Ensure-we-run-correct-mock-binary.patch
%description
This tool automates much of the dirty work when reviewing a package
for the Fedora Package Collection like:
* Downloading SRPM & SPEC.
* Download upstream source
* Check md5sums
* Build and install package in mock.
* Run rpmlint.
* Generate a review template, which becomes the starting
point for the review work.
The tool is composed of a plugins, one for each supported language.
As of today, there is plugins for C/C++, Ruby, java, R, perl and
python. There is also support for external tests that can be written
in a simple way in bash.
%package tests
Summary: Test and test data files for fedora-review
Requires: %{name} = %{version}-%{release}
%description tests
Tests are packaged separately due to space concerns.
%package php-phpci
Summary: Run phpci static analyzer on php packages
Requires: %{name} = %{version}-%{release}
Requires: php-bartlett-PHP-CompatInfo
%description php-phpci
Bash plugin running the phpci static analyzer on php packages,
see http://php5.laurent-laville.org/compatinfo/.
%prep
%setup -q
%patch1 -p1 -b .
%patch2 -p1 -b .
%patch3 -p1 -b .
%patch4 -p1 -b .
%patch5 -p1 -b .
%patch6 -p1 -b .
%build
%{__python} setup.py --quiet build
%install
%{__python} setup.py --quiet install -O1 --skip-build --root $RPM_BUILD_ROOT
pkg_dir="$RPM_BUILD_ROOT/%{python_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}"
%check
%if %{with tests}
cd test
export REVIEW_LOGLEVEL=warning
export MAKE_RELEASE=1
mock --quiet -r fedora-17-i386 --init
mock --quiet -r fedora-16-i386 --init
mock --quiet -r fedora-17-i386 --uniqueext=hugo --init
python -m unittest discover -f
%endif
%files
%doc COPYING AUTHORS TODO README
%{python_sitelib}/*
%{_bindir}/fedora-review
%{_bindir}/fedora-create-review
%{_bindir}/koji-download-scratch
%{_mandir}/man1/%{name}.1.*
%{_mandir}/man1/fedora-create-review.1.*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/plugins
%{_datadir}/%{name}/scripts
%exclude %{_datadir}/%{name}/scripts/php-phpci.sh
%files tests
%doc test/README.test
%{_datadir}/%{name}/test
%files php-phpci
%{_datadir}/%{name}/scripts/php-phpci.sh
%changelog
* Tue Feb 19 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.4.0-4
- Fix rhbz912182
- Reorganize patches a bit
* Fri Feb 8 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.4.0-3
- Fix rhbz908830 and rhbz908830
- Add patch for REVIEW_NO_MOCKGROUP_TEST environment variable
- Remove old patch
* Mon Feb 04 2013 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.4.0-2
- Add Patch0 (0001-Fix-syntax-error.patch) from Ralph Bean fixing fedora-create-review
* Mon Jan 28 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.4.0-1
- Updating to upstream 0.4.0
* Wed Nov 07 2012 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.3.1-3
- Backport from upstream's git fix to RHBZ#874246 (Patch0)
* Thu Oct 25 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.3.1-2
- Add symlink to scripts directory so they are loaded
* Tue Sep 25 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.3.1-1
- Update to lastest upstream (0.3.1)
- Fix loading of system-wide plugins
- Add back suport for EL6
* Mon Sep 24 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.3.0-1
- Update to lastest upstream (0.3.0)
- Remove no longer needed build workarounds
* Thu Aug 9 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.2.2-1
- Update to lastest upstream (0.2.2)
- Add koji-download-scratch script
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Wed Jul 11 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.2.0-1
- Update to latest release (0.2.0)
* Fri Feb 24 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.1.3-1
- Update to latest bugfix release
* Fri Jan 13 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.1.2-1
- Update to latest bugfix release
- Add fedora-create-review script
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed Jan 11 2012 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.1.1-2
- Add wget as requires
* Wed Nov 23 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.1.1-1
- New upstream bugfix release
* Wed Nov 16 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.1.0-2
- Remove things not needed in el6+
* Thu Nov 10 2011 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.1.0-1
- Initial packaging work for Fedora