%global modname datanommer.models
Name: python-datanommer-models
Version: 0.5.0
Release: 2%{?dist}
Summary: SQLAlchemy models for datanommer
Group: Development/Libraries
License: GPLv3+
URL: http://pypi.python.org/pypi/%{modname}
Source0: http://pypi.python.org/packages/source/d/%{modname}/%{modname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-nose
BuildRequires: fedmsg
Requires: fedmsg
BuildRequires: python-alembic
Requires: python-alembic
%if %{?rhel}%{!?rhel:0} >= 6
BuildRequires: python-sqlalchemy0.7
Requires: python-sqlalchemy0.7
%else
BuildRequires: python-sqlalchemy >= 0.7
Requires: python-sqlalchemy >= 0.7
%endif
%description
SQLAlchemy models for datanommer.
%prep
%setup -q -n %{modname}-%{version}
# Make sure that epel/rhel picks up the correct version of sqlalchemy
%{__awk} 'NR==1{print "import __main__; __main__.__requires__ = __requires__ = [\"sqlalchemy>=0.7\"]; import pkg_resources"}1' setup.py > setup.py.tmp
%{__mv} setup.py.tmp setup.py
# Disable the consumer by default.
# https://github.com/fedora-infra/datanommer/issues/55
sed -i 's/True/False/g' fedmsg.d/example-datanommer.py
# Also (temporarily), use a less insecure db uri by default
# https://github.com/fedora-infra/datanommer/issues/55
sed -i 's/\/\/tmp\/datanommer.db//' fedmsg.d/example-datanommer.py
# Remove upstream egg-info so that it gets rebuilt.
rm -rf *.egg-info
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root=%{buildroot}
# fedmsg owns this directory, but we're going to add a file.
%{__mkdir_p} %{buildroot}%{_sysconfdir}/fedmsg.d/
%{__cp} fedmsg.d/example-datanommer.py %{buildroot}%{_sysconfdir}/fedmsg.d/datanommer.py
# DB upgrade/downgrade scripts
%{__mkdir_p} %{buildroot}%{_datadir}/%{modname}/
%{__cp} alembic.ini %{buildroot}%{_datadir}/%{modname}/alembic.ini
%{__cp} -r alembic/ %{buildroot}%{_datadir}/%{modname}/alembic/
%check
%{__python} setup.py test
%files
%doc README.rst LICENSE
%{python_sitelib}/datanommer/
%{python_sitelib}/%{modname}-%{version}*
%{_datadir}/%{modname}/
%config(noreplace) %{_sysconfdir}/fedmsg.d/datanommer.py*
%changelog
* Mon Aug 26 2013 Ralph Bean <rbean@redhat.com> - 0.5.0-2
- Disable the consumer by default.
- Use an in-memory database by default.
* Mon Aug 12 2013 Ralph Bean <rbean@redhat.com> - 0.5.0-1
- Added source_name and source_version columns.
- Added possibility to disable paging in calls to .grep().
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Fri Jun 14 2013 Ralph Bean <rbean@redhat.com> - 0.4.6-1
- Latest upstream.
- Added optional "defer" argument to the `grep` method.
* Thu May 16 2013 Ralph Bean <rbean@redhat.com> - 0.4.5-1
- Fix links to upstream source.
- Allow queries to 'grep' with no timespan.
* Tue May 14 2013 Ralph Bean <rbean@redhat.com> - 0.4.4-1
- Added an 'order' argument to the 'grep' method.
* Mon Apr 22 2013 Ralph Bean <rbean@redhat.com> - 0.4.3-1
- Bugfixes to category assignment.
- New convenience classmethods on Message, User, and Package.
- Removed old BuildRequires on bunch, argparse, and orderedict.
* Thu Feb 14 2013 Ralph Bean <rbean@redhat.com> - 0.4.2-1
- Latest upstream with improved alembic migration.
* Thu Feb 07 2013 Ralph Bean <rbean@redhat.com> - 0.4.1-1
- Latest upstream contributed by Jessica Anderson.
- Included alembic upgrade scripts in /usr/share/datanommer.models/
* Thu Nov 08 2012 Ralph Bean <rbean@redhat.com> - 0.2.0-6
- Patch setup.py to pull in the correct sqlalchemy for el6.
- Add BR for python-argparse and python-ordereddict.
* Thu Nov 08 2012 Ralph Bean <rbean@redhat.com> - 0.2.0-5
- Added temporary BR on python-bunch to get around an old moksha issue.
* Mon Oct 22 2012 Ralph Bean <rbean@redhat.com> - 0.2.0-4
- Remove explicit versioned Conflicts with old datanommer.
* Fri Oct 12 2012 Ralph Bean <rbean@redhat.com> - 0.2.0-3
- Remove unneccessary CFLAGS definition.
* Thu Oct 11 2012 Ralph Bean <rbean@redhat.com> - 0.2.0-2
- Remove upstream egg-info so that its gets rebuilt.
* Thu Oct 11 2012 Ralph Bean <rbean@redhat.com> - 0.2.0-1
- Initial split out from the main datanommer package.