-%define trac_ver 0.11
+%define trac_ver 0.12
%define plugin PLUGIN_NAME
Summary: PLUGIN_NAME Plugin for Trac
Name: trac-plugin-%{plugin}
Version: 0.1
Release: 0.1
-License: BSD-like
+License: BSD-like / GPL / ...
Group: Applications/WWW
-# Source0Download: http://trac-hacks.org/changeset/latest/wikirenameplugin?old_path=/&filename=wikirenameplugin&format=zip
-Source0: %{plugin}plugin.zip
+Source0: http://trac-hacks.org/changeset/latest/tracsqlhelperscript?old_path=/&format=zip#/%{plugin}-%{version}.zip
# Source0-md5: 9f706e733d205d4467ce6534772cb505
URL: http://trac-hacks.org/wiki/PLUGIN_NAME
BuildRequires: python-devel
Requires: trac >= %{trac_ver}
+# for trac 0.11:
+#Requires: trac >= %{trac_ver}.7-3
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%prep
%setup -q -n %{plugin}plugin
+%setup -q -n trac%{plugin}plugin
+%setup -qc
+mv %{plugin}plugin/%{trac_ver}/* .
+mv %{trac_ver}/* .
%build
-cd %{plugin}/%{version}
-cd %{trac_ver}
%{__python} setup.py build
%{__python} setup.py egg_info
+ver=$(awk '$1 == "Version:" {print $2}' *.egg-info/PKG-INFO)
+test "$ver" = %{version}
+
%install
rm -rf $RPM_BUILD_ROOT
-cd %{trac_ver}
-cd %{plugin}/%{version}
%{__python} setup.py install \
--single-version-externally-managed \
--optimize 2 \
rm -rf $RPM_BUILD_ROOT
%post
-if [ "$1" = "1" ]; then
- %banner -e %{name} <<-'EOF'
- To enable the %{plugin} plugin, add to conf/trac.ini:
-
- [components]
- %{plugin}.* = enabled
-EOF
-fi
+# XXX: try to figure out from .egg-info / __init__py at build time
+#trac-enableplugin "%{plugin}.Trac%{plugin}Module"
%files
%defattr(644,root,root,755)