Blob Blame History Raw
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2:        %global __python2 /usr/bin/python2}
%{!?python2_sitelib:  %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif

%global modname summershum

Name:               python-summershum
Version:            0.1.5
Release:            5%{?dist}
Summary:            A fedmsg consumer that extracts and stores hashes of source files

Group:              Development/Libraries
License:            GPLv2+
URL:                http://pypi.python.org/pypi/summershum
Source0:            http://pypi.python.org/packages/source/s/%{modname}/%{modname}-%{version}.tar.gz

BuildArch:          noarch


BuildRequires:      python2-devel
BuildRequires:      python-setuptools

BuildRequires:      fedmsg
Requires:           fedmsg

BuildRequires:      python-kitchen
Requires:           python-kitchen

%if 0%{?rhel} && 0%{?rhel} <= 6
BuildRequires:      python-sqlalchemy0.8
Requires:           python-sqlalchemy0.8
BuildRequires:      python-logutils
Requires:           python-logutils
%else
BuildRequires:      python-sqlalchemy
Requires:           python-sqlalchemy
%endif

Requires:           rpmdevtools


%description
A fedmsg consumer that extracts and stores hashes of source files.

summershum is composed of two components:

- A fedmsg consumer plugin that listens for
  ``org.fedoraproject.prod.git.lookaside.new`` messages.  Whenever a
  contributor uploads a new source tarball to the lookaside cache,
  summershum will download that tarball, unpack it, and calculate the
  sha1 sum of every file in the tarball.  Those hashes are then stored in
  a database to be queried later.
- A cli tool ``summershum-cli`` that queries datagrepper for the fedmsg
  history.  It then crawls through old lookaside messages to fill in data where
  it was missed.

With the summershum database, we can then make some interesting queries
in short time:

- how many files have this hash sum in all of fedora?  and for which
  packages ?
- we can easily find what is bundling what and generate a programatic list
- we could check the db in taskotron tests
- we could check to see how many packages include the full GPL license
- how many packages have that license but with the old FSF address


%prep
%setup -q -n %{modname}-%{version}

# Remove bundled egg-info in case it exists
rm -rf %{modname}.egg-info

%build
%{__python2} setup.py build

%install
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}

%check
# Eventually, the tests will be run this way, but not yet.
#%%{__python2} setup.py test
%if 0%{?rhel} && 0%{?rhel} <= 6
# pass the tests on el6
%else
%{__python2} tests/__init__.py
%endif

%files
%doc README.rst LICENSE
%{python2_sitelib}/%{modname}/
%{python2_sitelib}/%{modname}-%{version}*
%{_bindir}/summershum-cli

%changelog
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Thu Feb 27 2014 Ralph Bean <rbean@redhat.com> - 0.1.5-1
- Fixes for invalid files, gems, odd archives.
- New options to summershum-cli

* Fri Feb 21 2014 Ralph Bean <rbean@redhat.com> - 0.1.4-1
- Latest upstream with bugfixes for symlinks, non-archives, and spamminess.

* Wed Feb 19 2014 Ralph Bean <rbean@redhat.com> - 0.1.3-1
- Upstream with bugfix for el6 logging config.
- Add requires on rpmdevtools.
- Add requires on python-logutils.

* Wed Feb 19 2014 Ralph Bean <rbean@redhat.com> - 0.1.2-2
- Don't run tests on el6.

* Wed Feb 19 2014 Ralph Bean <rbean@redhat.com> - 0.1.2-1
- Latest upstream with bugfixes.
- Require python-sqlalchemy0.8 for el6.

* Tue Feb 18 2014 Ralph Bean <rbean@redhat.com> - 0.1.1-1
- Latest upstream.

* Tue Feb 18 2014 Ralph Bean <rbean@redhat.com> - 0.1-1
- Initial package for Fedora