Blob Blame History Raw
%global modname tahrir

Name:             python-tahrir
Version:          0.4.1
Release:          3%{?dist}
Summary:          A pyramid app for issuing your own Open Badges

Group:            Development/Languages
License:          AGPLv3+
URL:              http://pypi.python.org/pypi/%{modname}
Source0:          http://pypi.python.org/packages/source/t/tahrir/%{modname}-%{version}.tar.gz
Patch0:           python-tahrir-cached-rank-in-template.patch
Patch1:           python-tahrir-cached-rank-in-template-more.patch

BuildArch:        noarch

BuildRequires:    python2-devel
BuildRequires:    python-setuptools

Requires:         python-pyramid
Requires:         python-webhelpers
Requires:         python-tahrir-api
Requires:         python-transaction
Requires:         python-pyramid-tm
Requires:         python-zope-sqlalchemy
Requires:         python-weberror
Requires:         python-velruse
Requires:         python-anykeystore
Requires:         python-qrcode
Requires:         python-dogpile-cache
Requires:         python-docutils
Requires:         python-dateutil
Requires:         python-moksha-wsgi
Requires:         python-openid
Requires:         fedmsg

Requires:         httpd
Requires:         mod_wsgi

%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
tahrir is a Pyramid app for issuing your own Open Badges.

https://wiki.mozilla.org/Badges

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

# Fix the leaderboard template
%patch0 -p1
%patch1 -p1

# 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

# Remove upstream egg-info so that it gets rebuilt.
rm -rf *.egg*

%build
%{__python} setup.py build

sed -i 's/%%(here)s/\/var\/lib\/tahrir/' apache/%{modname}.ini

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

%{__mkdir_p} %{buildroot}/%{_datadir}/%{modname}
%{__mkdir_p} %{buildroot}/%{_sysconfdir}/%{modname}
%{__mkdir_p} %{buildroot}/%{_sysconfdir}/httpd/conf.d
%{__mkdir_p} %{buildroot}/%{_var}/lib/%{modname}

%{__install}        apache/%{modname}.wsgi %{buildroot}%{_datadir}/%{modname}/%{modname}.wsgi
%{__install} -m 640 apache/%{modname}.ini  %{buildroot}%{_sysconfdir}/%{modname}/
%{__install} -m 644 apache/%{modname}.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/%{modname}.conf
%{__install} -m 644 -d tahrir/static %{buildroot}%{_datadir}/%{modname}/static
%{__install} -m 644 -d fedora-sitedocs/ %{buildroot}%{_datadir}/%{modname}/sitedocs

%pre
%{_sbindir}/groupadd -r %{modname} &>/dev/null || :
%{_sbindir}/useradd  -r -s /sbin/nologin -d %{_datadir}/%{modname} -M \
            -c 'Tahrir Server' -g %{modname} %{modname} &>/dev/null || :

%files
%doc README.rst LICENSE CHANGELOG.rst

%{python_sitelib}/%{modname}/
%{python_sitelib}/%{modname}-%{version}*

%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{modname}.conf
%dir %{_sysconfdir}/%{modname}/
%attr(-,%{modname},root) %{_datadir}/%{modname}
%attr(-,%{modname},root) %config(noreplace) %{_sysconfdir}/%{modname}/%{modname}.ini
%attr(-,%{modname},root) %config(noreplace) %{_var}/lib/%{modname}

%changelog
* Tue Sep 10 2013 Ralph Bean <rbean@redhat.com> - 0.4.1-3
- More patching of the leaderboard template...

* Tue Sep 10 2013 Ralph Bean <rbean@redhat.com> - 0.4.1-2
- Apply patch to fix leaderboard template.

* Tue Sep 10 2013 Ralph Bean <rbean@redhat.com> - 0.4.1-1
- Latest upstream with various optimizations.

* Wed Aug 28 2013 Ralph Bean <rbean@redhat.com> - 0.4.0-2
- Add dependency on python-webhelpers.

* Mon Aug 26 2013 Ralph Bean <rbean@redhat.com> - 0.4.0-1
- Latest upstream.
- Take advantage of enhanced tahrir-api for fedmsg and rank caching.
- Publish fedmsg messages on rank change.
- More consitent user links.
- Css fixes and style updates.
- RSS feeds per-user and per-badge.
- Temporarily revert the sqlalchemy version requirement.

* Fri Aug 16 2013 Ralph Bean <rbean@redhat.com> - 0.3.5-3
- Copy the fedora-sitedocs contents in /usr/share/

* Thu Aug 15 2013 Ralph Bean <rbean@redhat.com> - 0.3.5-2
- Add requires on python-openid as per
  https://github.com/fedora-infra/tahrir/issues/154

* Thu Aug 15 2013 Ralph Bean <rbean@redhat.com> - 0.3.5-1
- Bugfixes to the about page.
- CSS fixes to the user page.

* Thu Aug 15 2013 Ralph Bean <rbean@redhat.com> - 0.3.4-2
- Update sqlalchemy version in awk statement.

* Thu Aug 15 2013 Ralph Bean <rbean@redhat.com> - 0.3.4-1
- Modern sqlalchemy requirement.
- Social media links.
- First try at FOAF metadata on user pages.
- Added configurable FAQ and footer.
- New default avatar
- Load JS and images over https when appropriate.
- Fix some fatal errors on the leaderboard json api.

* Tue Aug 13 2013 Ralph Bean <rbean@redhat.com> - 0.3.3-1
- Optimizations to the leaderboard.
- Bugfix to 404s for user.
- Ability to edit your profile.
- Default issuer in the badge builder.

* Sun Aug 11 2013 Ralph Bean <rbean@redhat.com> - 0.3.2-1
- Enhancements to the "explore" view.

* Sun Aug 11 2013 Ralph Bean <rbean@redhat.com> - 0.3.1-1
- Some more css and presentation facelifting.
- Make leaderboard respect opt-out
  https://github.com/fedora-infra/tahrir/pull/146
- Consistent user links
  https://github.com/fedora-infra/tahrir/pull/144
- Fix badge links
  https://github.com/fedora-infra/tahrir/pull/145
- JSON api for leaderboard
  https://github.com/fedora-infra/tahrir/pull/147
- User-specific JSON api endpoint
  https://github.com/fedora-infra/tahrir/pull/149

* Fri Aug 09 2013 Ralph Bean <rbean@redhat.com> - 0.3.0-1
- Add JSON API from Ricky Elrod.
- Some CSS fixups.

* Mon Aug 05 2013 Ralph Bean <rbean@redhat.com> - 0.2.9-1
- Limit the relative leaderboard to only 5 people instead of 10.
- Emit fedmsg messages when invitations are claimed.

* Thu Aug 01 2013 Ralph Bean <rbean@redhat.com> - 0.2.8-1
- Fix a login user-creation bug.
- Fix trailing comma on tags.
- Fix trailing slash on emails.

* Thu Aug 01 2013 Ralph Bean <rbean@redhat.com> - 0.2.7-1
- Reorganize avatars around openid identifiers for ease-of-use.

* Tue Jul 30 2013 Ralph Bean <rbean@redhat.com> - 0.2.6-1
- More facelifting.
- Ability for users to opt-out.

* Thu Jul 18 2013 Ralph Bean <rbean@redhat.com> - 0.2.5-3
- Remove version constraint on python-moksha-wsgi.  It is behaving oddly.

* Thu Jul 18 2013 Ralph Bean <rbean@redhat.com> - 0.2.5-2
- python-dateutil is singular, not plural.

* Thu Jul 18 2013 Ralph Bean <rbean@redhat.com> - 0.2.5-1
- More facelifting.
- Websocket updates for the frontpage.

* Tue Jul 16 2013 Ralph Bean <rbean@redhat.com> - 0.2.3-2
- Added requirement on python-docutils.

* Tue Jul 16 2013 Ralph Bean <rbean@redhat.com> - 0.2.3-1
- Latest upstream with more botox.

* Thu Jul 11 2013 Ralph Bean <rbean@redhat.com> - 0.2.2-2
- Added requirement for python-dogpile-cache

* Wed Jul 10 2013 Ralph Bean <rbean@redhat.com> - 0.2.2-1
- Latest upstream with more cosmetic surgery.

* Wed Jul 03 2013 Ralph Bean <rbean@redhat.com> - 0.2.1-1
- Remove old patch (shipped with upstream now).
- More facelift stuff in progress.

* Mon Jul 01 2013 Ralph Bean <rbean@redhat.com> - 0.2.0-2
- Add requirement on python-qrcode.

* Wed Jun 26 2013 Ralph Bean <rbean@redhat.com> - 0.2.0-1
- Massive facelift.

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

* Wed Mar 13 2013 Ralph Bean <rbean@redhat.com> - 0.1.9-2
- Copy static directory as a directory (typofix).

* Wed Mar 13 2013 Ralph Bean <rbean@redhat.com> - 0.1.9-1
- Latest upstream with modernized apache config.

* Mon Mar 11 2013 Ralph Bean <rbean@redhat.com> - 0.1.8-3
- Use modname macro where applicable.
- Add deps on python-velruse and python-anykeystore.
- Also added server deps on httpd and mod_wsgi.
- Install configuration alongside the code.
- Copy static files to /usr/share/

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

* Mon Jul 23 2012 rossdylan <rdelinge@redhat.com> 0.1.8-1
- Versioning typo in rpm fixed
- Misc bug fixes 
- Custom 404 page
- oauth authentication, defaults to FAS
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Wed Jun 20 2012 rossdylan <rossdylan@csh.rit.edu> 0.1.6-1
- initial package for Fedora