2 %define plugin tracvatar
3 Summary: Adds Gravatar icons to Trac
4 Name: trac-plugin-%{plugin}
8 Group: Applications/WWW
9 Source0: https://bitbucket.org/zzzeek/tracvatar/get/rel_1_7.tar.bz2
10 # Source0-md5: 2a9477232efe7af3d6523dc63c57e917
11 URL: https://bitbucket.org/zzzeek/tracvatar
12 BuildRequires: python-devel
13 BuildRequires: python-distribute
14 BuildRequires: python-modules
15 BuildRequires: rpm-pythonprov
16 Requires: trac >= %{trac_ver}
18 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20 %define trac_htdocs /usr/share/trac/htdocs
21 %define plugin_htdocs %{trac_htdocs}/%{plugin}
24 Currently, only Gravatar is supported, but the more open-ended plugin
25 system of Hackergotchi can be re-implemented here if other avatar
28 Ideally, Trac itself would just include support for author avatars as
29 a built in, since this is an extremely common and desirable feature.
31 For now, the approach of the plugin is to filter specific Trac views,
32 gather all the authors found in the "data" hash being passed to
33 Genshi, then using Genshi filters to insert additional Gravatar nodes.
35 Currently supported views are:
38 - Issue change display (i.e. comments, attachments)
39 - Source browser listing (tested for svn and hg so far)
40 - Individual changeset page (tested for svn and hg so far)
41 - User prefs page (includes link to "change your avatar" at
46 mv zzzeek-tracvatar-*/* .
49 %{__python} setup.py build
50 %{__python} setup.py egg_info
52 ver=$(awk '$1 == "Version:" {print $2}' *.egg-info/PKG-INFO)
53 test "$ver" = %{version}
56 rm -rf $RPM_BUILD_ROOT
57 %{__python} setup.py install \
58 --single-version-externally-managed \
60 --root=$RPM_BUILD_ROOT
62 install -d $RPM_BUILD_ROOT%{plugin_htdocs}
63 mv $RPM_BUILD_ROOT{%{py_sitescriptdir}/tracvatar/htdocs/*,%{plugin_htdocs}}
68 rm -rf $RPM_BUILD_ROOT
71 trac-enableplugin tracvatar.web_ui.avatarmodule
74 %defattr(644,root,root,755)
75 %doc README.rst CHANGES LICENSE
76 %dir %{py_sitescriptdir}/tracvatar
77 %{py_sitescriptdir}/tracvatar/*.py[co]
78 %{py_sitescriptdir}/tracvatar-%{version}-*.egg-info