Blob Blame History Raw
%global modname tahrir_api

Name:             python-tahrir-api
Version:          0.8.1
Release:          4%{?dist}
Summary:          An API for interacting with the Tahrir database

Group:            Development/Languages
License:          GPLv3+
URL:              https://pypi.python.org/pypi/tahrir-api
Source0:          https://pypi.python.org/packages/source/t/tahrir-api/tahrir-api-%{version}.tar.gz

BuildArch:        noarch

BuildRequires:    python2-devel
BuildRequires:    python-setuptools
BuildRequires:    python-pygments
BuildRequires:    python-zope-sqlalchemy
BuildRequires:    python-simplejson
BuildRequires:    python-httplib2
BuildRequires:    python-webob1.2
BuildRequires:    python-nose
BuildRequires:    python-alembic
BuildRequires:    python-arrow

# This is just a dep of python-arrow that are missing from
# python-arrow-0.4.2-1.  They can be removed in the future.
BuildRequires:    python2-chai


%if 0%{?fedora}
BuildRequires:  python-mako >= 0.3.6
BuildRequires:  python-paste-deploy
BuildRequires:  python-sqlalchemy >= 0.7
BuildRequires:  python-zope-interface
%else
%if 0%{?rhel} && 0%{?rhel} <= 6
BuildRequires:  python-mako0.4 >= 0.3.6
BuildRequires:  python-paste-deploy1.5
BuildRequires:  python-sqlalchemy0.7
BuildRequires:  python-zope-interface4
BuildRequires:  python-ordereddict
%else
BuildRequires:  python-mako
BuildRequires:  python-paste-deploy
BuildRequires:  python-sqlalchemy
BuildRequires:  python-zope-interface
%endif
%endif

%global _description\
API for interacting with the Tahrir database Based on the `Tahrir\
<https://github.com/fedora-infra/tahrir>`_ database model.\
\
There are two classes that can be used in this module. The first is\
TahrirDatabase class located in tahrir_api.dbapi and the second is the database\
model located in tahrir_api.model. The TahrirDatabase class is a high level way\
to interact with the database. The model is used for a slightly more low level\
way of interacting with the database. It allows for custom interactions with\
the database without having to use the TahrirDatabase class.

%description %_description

%package -n python2-tahrir-api
Summary: %summary
Requires:       python-pygments
Requires:       python-zope-sqlalchemy
Requires:       python-simplejson
Requires:       python-httplib2
Requires:       python-webob1.2
Requires:       python-alembic
Requires:       python-arrow

# This is just a dep of python-arrow that are missing from
# python-arrow-0.4.2-1.  They can be removed in the future.
Requires:       python2-chai

%if 0%{?fedora}
Requires:       python-mako >= 0.3.6
Requires:       python-paste-deploy
Requires:       python-sqlalchemy >= 0.7
Requires:       python-zope-interface
%else
%if 0%{?rhel} && 0%{?rhel} <= 6
Requires:       python-mako0.4 >= 0.3.6
Requires:       python-paste-deploy1.5
Requires:       python-sqlalchemy0.7
Requires:       python-zope-interface4
Requires:       python-ordereddict
%else
Requires:       python-mako
Requires:       python-paste-deploy
Requires:       python-sqlalchemy
Requires:       python-zope-interface
%endif
%endif
%{?python_provide:%python_provide python2-tahrir-api}

%description -n python2-tahrir-api %_description

%prep
%setup -q -n tahrir-api-%{version}

# Remove upstream egg-info so that it gets rebuilt.
rm -rf *.egg-info
sed -i -e "s|__requires__ = 'SQLAlchemy>=0.7.0'|__requires__ = ['WebOb>=1.2', 'SQLAlchemy>=0.7.0', 'PasteDeploy>=1.5.0', 'zope.interface>=3.8.0', 'Mako>=0.3.6']; import pkg_resources|" setup.py
head setup.py

%build
%{__python} setup.py build

%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
awk 'NR==3{print "import __main__; __main__.__requires__ = __requires__ = [\"WebOb>=1.2\", \"SQLAlchemy>=0.7.0\", \"PasteDeploy>=1.5.0\", \"zope.interface>=3.8.0\", \"Mako>=0.3.6\"]; import pkg_resources"}3' %{buildroot}/%{_bindir}/initialize_tahrir_db > tempfile
install -p -m755 tempfile %{buildroot}/%{_bindir}/initialize_tahrir_db

# 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
head setup.py

%if 0%{?rhel} && 0%{?rhel} <= 6
# pass.  the tests suddenly stopped working on rhel6.  :(
%else
%{__python} setup.py test
%endif

%files -n python2-tahrir-api
%doc README.rst LICENSE

%{python_sitelib}/%{modname}
%{python_sitelib}/%{modname}-%{version}*
%{_datadir}/%{modname}/
%{_bindir}/initialize_tahrir_db
%{_bindir}/populate_series_in_tahrir_db

%changelog
* Tue Aug 29 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.8.1-4
- Python 2 binary package renamed to python2-tahrir-api
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Nov 01 2016 Sayan Chowdhury <sayan.chowdhury2012@gmail.com> - 0.8.1-1
- 0.8.1

* Tue Sep 20 2016 Sayan Chowdhury <sayan.chowdhury2012@gmail.com> - 0.8.0-3
- Change the http:// to https://

* Tue Sep 20 2016 Sayan Chowdhury <sayan.chowdhury2012@gmail.com> - 0.8.0-2
- Specify the missing file populate_series_in_tahir_db in files section

* Tue Sep 20 2016 Sayan Chowdhury <sayan.chowdhury2012@gmail.com> - 0.8.0-1
- Updates to 0.8.0

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

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

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

* Fri Feb 13 2015 Ralph Bean <rbean@redhat.com> - 0.7.2-1
- add badge_name_to_id function in dbapi

* Mon Sep 29 2014 Ralph Bean <rbean@redhat.com> - 0.7.0-2
- Prepare for epel7 branching.

* Mon Jul 14 2014 Ralph Bean <rbean@redhat.com> - 0.7.0-1
- Add new column supporting STLs.

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

* Tue Mar 04 2014 Ralph Bean <rbean@redhat.com> - 0.6.0-2
- Disable tests for rhel6.

* Tue Mar 04 2014 Ralph Bean <rbean@redhat.com> - 0.6.0-1
- Add the ability to track events that trigger a badge.

* Mon Feb 24 2014 Ralph Bean <rbean@redhat.com> - 0.5.1-2
- Bump spec.

* Mon Feb 24 2014 Ralph Bean <rbean@redhat.com> - 0.5.1-1
- Standardize arguments to the add_invitation api.

* Tue Dec 17 2013 Ralph Bean <rbean@redhat.com> - 0.5.0-4
- Convert awk to sed to fight weirdness.

* Tue Dec 17 2013 Ralph Bean <rbean@redhat.com> - 0.5.0-3
- Adjust setuptools line in prep section.

* Tue Dec 17 2013 Ralph Bean <rbean@redhat.com> - 0.5.0-2
- Add temporary requires to get around broken python-arrow.

* Tue Dec 17 2013 Ralph Bean <rbean@redhat.com> - 0.5.0-1
- Latest upstream with new authorization table.
- Use UTC time everywhere.
- New invitation manipulation API methods.
- New dep on python-arrow

* Mon Nov 18 2013 Ralph Bean <rbean@redhat.com> - 0.4.2-2
- Direct requires on python-alembic.

* Mon Nov 18 2013 Ralph Bean <rbean@redhat.com> - 0.4.2-1
- Latest upstream with packaging bugfixes.

* Mon Nov 18 2013 Ralph Bean <rbean@redhat.com> - 0.4.1-2
- Add BR on python-alembic.

* Mon Nov 18 2013 Ralph Bean <rbean@redhat.com> - 0.4.1-1
- Latest upstream
- Correct fedmsg schema.
- New calculation of tied rank.

* Fri Oct 25 2013 Ralph Bean <rbean@redhat.com> - 0.4.0-1
- Latest upstream.
- Keep track of logins.
- Return leaderboard as an ordereddict

* Mon Aug 26 2013 Ralph Bean <rbean@redhat.com> - 0.3.0-1
- Latest upstream.
- Allow a notification callback to be used for different events.
- Add a column to the DB to cache the rank of users.
- Add routines to calculate the rank of users.

* Tue Jul 30 2013 Ralph Bean <rbean@redhat.com> - 0.2.8-1
- Latest upstream, more enhancements.

* Wed Jul 17 2013 Ralph Bean <rbean@redhat.com> - 0.2.7-1
- Latest upstream, simplified badge id.
- Bugfixes.

* Tue Jul 16 2013 Ralph Bean <rbean@redhat.com> - 0.2.6-1
- Latest upstream, more enhancements.

* Wed Jul 10 2013 Ralph Bean <rbean@redhat.com> - 0.2.5-1
- Latest upstream, uniquifies the nickname field.

* Wed Jul 03 2013 Ralph Bean <rbean@redhat.com> - 0.2.4-1
- Latest upstream with some new get_all_... methods.

* Wed Jun 26 2013 Ralph Bean <rbean@redhat.com> - 0.2.3-2
- Remove old patch.

* Wed Jun 26 2013 Ralph Bean <rbean@redhat.com> - 0.2.3-1
- Latest upstream with fixes to the model.

* Sun Jun 23 2013 Ralph Bean <rbean@redhat.com> - 0.2.2-1
- Add alembic upgrade scripts.
- Add check section with tests.

* Sun Jun 23 2013 Ralph Bean <rbean@redhat.com> - 0.2.1-1
- Bugfix - stop leaking sqlalchemy sessions.
- API enhancement - can query for user by username, id, or email now.

* Thu Jun 20 2013 Ralph Bean <rbean@redhat.com> - 0.2.0-1
- API enhancements.

* Thu Jun 13 2013 Ralph Bean <rbean@redhat.com> - 0.1.8-6
- Use paste-deploy1.5 forward compat package.
- Use zope-interface4 forward compat package.

* Thu Jun 13 2013 Ralph Bean <rbean@redhat.com> - 0.1.8-5
- Added dep on zope.interface.

* Thu Jun 13 2013 Ralph Bean <rbean@redhat.com> - 0.1.8-4
- Conditional mako0.4 requirement for epel6.

* Thu Jun 13 2013 Ralph Bean <rbean@redhat.com> - 0.1.8-3
- More epel6 fixes.

* Thu Jun 13 2013 Ralph Bean <rbean@redhat.com> - 0.1.8-2
- Conditionalize sqlalchemy forward compat package for epel6.

* Fri Jun 07 2013 Ralph Bean <rbean@redhat.com> - 0.1.8-1
- New Invitations API.
- Bugfixes to other API functions.
- Relicense to GPLv3+

* Mon Mar 11 2013 Ralph Bean <rbean@redhat.com> - 0.1.7-3
- Force version of python-webob

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Mon Jul 23 2012 rossdylan <rdelinge@redhat.com> 0.1.7-1
- Lots of misc bug fixes
- consolidated the 2 models back into a single version
- expanded the api to include more ways of interacting with the database
- Removed MySQL-python dependancy since tahrir-api is db agnostic
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.3.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Wed Jun 13 2012 rossdylan <rdelinge@redhat.com> 0.1.3.1-1
- initial package for Fedora