%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{expand:%%define frel %(test -e /etc/fedora-release && perl -p -e 's@\D+([0-9\.]+)\D+@$1@' /etc/fedora-release || echo 0)} %{expand:%%define atleastf8 %(expr %{frel} \>= 8)} %{expand:%%define atleastfc5 %(expr %{frel} \>= 5)} %define srcname textile Name: python-%{srcname} Version: 2.0.11 Release: 4%{?dist} Summary: A Humane Web Text Generator Group: Development/Languages License: BSD URL: http://code.google.com/p/pytextile/ Source0: http://pytextile.googlecode.com/files/%{srcname}-%{version}.tar.gz BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildArch: noarch BuildRequires: python-devel %if %{atleastf8} BuildRequires: python-setuptools-devel %else BuildRequires: python-setuptools %endif # for htmlizer: %if %{atleastfc5} Requires(missingok): python-twisted-core %else Requires: python-twisted %endif # FIXME: no package currently provides tidy, # could be mx (experimental) or uTidyLib. %description Textile is a XHTML generator using a simple markup developed by Dean Allen. This is a Python port with support for code validation, itex to MathML translation, Python code coloring and much more. %prep %setup -q -n %{srcname}-%{version} # small fixes: # - toggle import statement for htmlizer # - remove the shebang sed -i -e 's/^\( *\)\(import htmlizer\)/\1#\2/' \ -e 's/^\( *\)#\(from twisted.python import htmlizer\)/\1\2/' \ -e '/#! *\/usr\/bin\/.*python.*/{1D}' textile.py %build %{__python} setup.py build # calling textile directly yields a single overview page %{__python} textile.py > overview.html %install rm -rf %{buildroot} %{__python} setup.py install --skip-build --root %{buildroot} %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc overview.html %{python_sitelib}/* %changelog * Sun Oct 26 2008 Thomas Vander Stichele - 2.0.11-4 - backported to FC-4 * Sat Apr 5 2008 Thomas Moschny - 2.0.11-4 - Simplify BR. * Mon Jan 28 2008 Thomas Moschny - 2.0.11-3 - As the license text in the main source file is unchanged, revert the license tag back to BSD. * Fri Jan 18 2008 Thomas Moschny - 2.0.11-2 - Updated main and source urls. The website states that the package is now under the MIT License. * Tue Sep 8 2007 Thomas Moschny - 2.0.11-1 - Initial version.