%global srcname textile %define backport %{nil} %define backport 0 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} <= 7 %define backport 1 %endif %else %if 0%{?fedora} <= 25 %define backport 1 %endif %endif %endif %define support_regex %{nil} %define support_regex 1 %define support_pillow %{nil} %define support_pillow 1 %define support_pytest %{nil} %define support_pytest 1 %define support_nose %{nil} %define support_nose 0 %define support_coverage %{nil} %define support_coverage 0 %if 0%{?backport} %define support_regex 0 %define support_pillow 0 %define support_pytest 0 #%%define support_nose 1 #%%define support_coverage 1 %endif %define doc_license %{nil} %define doc_license 1 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} < 7 %define doc_license 0 %endif %else %if 0%{?fedora} < 19 %define doc_license 0 %endif %endif %endif %define license_files LICENSE.txt %define python2_package python2 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} <= 7 %define python2_package python %endif %else %if 0%{?fedora} <= 25 %define python2_package python %endif %endif %endif %define python3_package python%{python3_pkgversion} %define with_python3 %{nil} %define with_python3 1 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} <= 5 %define with_python3 0 %endif %else %if 0%{?fedora} <= 12 %define with_python3 0 %endif %endif %endif %if 0%{?with_python3} %else %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} %endif Name: %{srcname}-python Version: 2.3.16 Release: 2%{?dist} Summary: A Humane Web Text Generator License: BSD URL: https://pypi.python.org/pypi/%{srcname} Source0: https://pypi.io/packages/source/t/%{srcname}/%{srcname}-%{version}.tar.gz BuildArch: noarch %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. %package -n %{python2_package}-%{srcname} Summary: A Humane Web Text Generator BuildRequires: %{python2_package}-devel BuildRequires: %{python2_package}-setuptools %if 0%{?support_pytest} BuildRequires: %{python2_package}-pytest BuildRequires: %{python2_package}-pytest-cov BuildRequires: %{python2_package}-pytest-runner %endif %if 0%{?support_regex} BuildRequires: %{python2_package}-regex %endif BuildRequires: %{python2_package}-six %if 0%{?support_pillow} BuildRequires: %{python2_package}-pillow %endif %if 0%{?support_nose} BuildRequires: %{python2_package}-nose %endif %if 0%{?support_coverage} BuildRequires: %{python2_package}-coverage %endif Requires: %{python2_package} %if 0%{?support_regex} Requires: %{python2_package}-regex %endif Requires: %{python2_package}-six %if 0%{?support_pillow} Requires: %{python2_package}-pillow %endif %{?python_provide:%python_provide %{python2_package}-%{srcname}} %if "%{python2_package}" != "python2" #%{?python_provide:%python_provide python2-%{srcname}} Provides: python2-%{srcname} = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: python2-%{srcname} < %{?epoch:%{epoch}:}%{version}-%{release} %endif %if "%{python2_package}" != "python" #%{?python_provide:%python_provide python-%{srcname}} Provides: python-%{srcname} = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: python-%{srcname} < %{?epoch:%{epoch}:}%{version}-%{release} %endif %description -n %{python2_package}-%{srcname} 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. %if 0%{?with_python3} %package -n %{python3_package}-%{srcname} Summary: A Humane Web Text Generator BuildRequires: %{python3_package}-devel BuildRequires: %{python3_package}-setuptools %if 0%{?support_pytest} BuildRequires: %{python3_package}-pytest BuildRequires: %{python3_package}-pytest-cov BuildRequires: %{python3_package}-pytest-runner %endif %if 0%{?support_regex} BuildRequires: %{python3_package}-regex %endif BuildRequires: %{python3_package}-six %if 0%{?support_pillow} BuildRequires: %{python3_package}-pillow %endif %if 0%{?support_nose} BuildRequires: %{python3_package}-nose %endif %if 0%{?support_coverage} BuildRequires: %{python3_package}-coverage %endif Requires: %{python3_package} %if 0%{?support_regex} Requires: %{python3_package}-regex %endif Requires: %{python3_package}-six %if 0%{?support_pillow} Requires: %{python3_package}-pillow %endif %{?python_provide:%python_provide %{python3_package}-%{srcname}} %if "%{python3_package}" != "python3" #%{?python_provide:%python_provide python3-%{srcname}} Provides: python3-%{srcname} = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: python3-%{srcname} < %{?epoch:%{epoch}:}%{version}-%{release} %endif %description -n %{python3_package}-%{srcname} 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. %endif %prep %setup -qc -n "%{srcname}-%{version}" rm -rf "python2" || : rm -rf "python3" || : mv "%{srcname}-%{version}" "python2" %if 0%{?with_python3} cp -a "python2" "python3" %endif pushd "python2" %if 0%{?license_files:1} && "%{license_files}" != "" cp %{?license_files} .. %endif popd %build pushd "python2" %{py2_build} popd %if 0%{?with_python3} pushd "python3" %{py3_build} popd %endif %install %if 0%{?with_python3} pushd "python3" %{py3_install} mv "%{buildroot}%{_bindir}/pytextile" "%{buildroot}%{_bindir}/pytextile-%{python3_version}" ln -snf "pytextile-%{python3_version}" "%{buildroot}%{_bindir}/pytextile-3" for f in "README" "CHANGELOG" ; do PYTHONPATH="%{buildroot}%{python3_sitelib}" \ PATH="%{buildroot}%{_bindir}:${PATH}" \ pytextile-3 < "${f}.textile" > "${f}.html" done popd %endif pushd "python2" %{py2_install} mv "%{buildroot}%{_bindir}/pytextile" "%{buildroot}%{_bindir}/pytextile-%{python2_version}" ln -snf "pytextile-%{python2_version}" "%{buildroot}%{_bindir}/pytextile-2" for f in "README" "CHANGELOG" ; do PYTHONPATH="%{buildroot}%{python2_sitelib}" \ PATH="%{buildroot}%{_bindir}:${PATH}" \ pytextile-2 < "${f}.textile" > "${f}.html" done popd # remove shebangs find "%{buildroot}%{python2_sitelib}" -name '*.py' \ -exec sed -i -e '1{/^#!/d}' {} \; %if 0%{?with_python3} find "%{buildroot}%{python3_sitelib}" -name '*.py' \ -exec sed -i -e '1{/^#!/d}' {} \; %endif # use 2.x per default ln -snf "pytextile-%{python2_version}" "%{buildroot}%{_bindir}/pytextile" %check # run the testsuite and log results, but do not fail the build pushd "python2" %{__python2} ./setup.py test || : %if 0%{?support_nose} nosetests-%{python2_version}" || : %endif popd %if 0%{?with_python3} pushd "python3" %{__python3} ./setup.py test || : %if 0%{?support_nose} nosetests-%{python3_version}" || : %endif popd %endif %files -n %{python2_package}-%{srcname} %doc python2/README.* %doc python2/CONTRIBUTORS.txt %doc python2/CHANGELOG.* %if 0%{?doc_license} %license %{license_files} %else %doc %{license_files} %endif %{python2_sitelib}/* %{_bindir}/pytextile-%{python2_version} %{_bindir}/pytextile-2 %{_bindir}/pytextile %if 0%{?with_python3} %files -n %{python3_package}-%{srcname} %doc python3/README.* %doc python3/CONTRIBUTORS.txt %doc python3/CHANGELOG.* %if 0%{?doc_license} %license %{license_files} %else %doc %{license_files} %endif %{python3_sitelib}/* %{_bindir}/pytextile-%{python3_version} %{_bindir}/pytextile-3 %endif %changelog * Sat Nov 04 2017 Tomasz Tomasik - 2.3.16-2 - Add support for EL7. - Rebuilt for EL7. * Wed Aug 16 2017 Thomas Moschny - 2.3.16-1 - Update to 2.3.16. * Thu Jul 27 2017 Fedora Release Engineering - 2.3.15-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Sun Jul 23 2017 Thomas Moschny - 2.3.15-1 - Update to 2.3.15. * Thu Jul 20 2017 Thomas Moschny - 2.3.14-1 - Update to 2.3.14. * Sun Jun 4 2017 Thomas Moschny - 2.3.12-1 - Update to 2.3.12. * Mon May 1 2017 Thomas Moschny - 2.3.11-1 - Update to 2.3.11. * Sat Apr 22 2017 Thomas Moschny - 2.3.10-1 - Update to 2.3.10. * Mon Apr 10 2017 Thomas Moschny - 2.3.9-1 - Update to 2.3.9. * Sun Apr 9 2017 Thomas Moschny - 2.3.8-1 - Update to 2.3.8. * Sun Mar 19 2017 Thomas Moschny - 2.3.7-1 - Update to 2.3.7. * Sat Feb 11 2017 Fedora Release Engineering - 2.3.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Mon Dec 19 2016 Miro HronĨok - 2.3.6-2 - Rebuild for Python 3.6 * Wed Nov 9 2016 Thomas Moschny - 2.3.6-1 - Update to 2.3.6. * Tue Nov 1 2016 Thomas Moschny - 2.3.4-1 - Update to 2.3.4. * Sun Sep 25 2016 Thomas Moschny - 2.3.3-1 - Update to 2.3.3. - Follow updated Python packaging guidelines. - Update Requires and BuildRequires. * Tue Jul 19 2016 Fedora Release Engineering - 2.2.2-5 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages * Thu Feb 04 2016 Fedora Release Engineering - 2.2.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Tue Nov 10 2015 Fedora Release Engineering - 2.2.2-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Thu Jun 18 2015 Fedora Release Engineering - 2.2.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Fri May 29 2015 Thomas Moschny - 2.2.2-1 - Update to 2.2.2. - Apply updated Python packaging guidelines. - Mark LICENSE with %%license. * Thu Jan 8 2015 Thomas Moschny - 2.2.1-1 - Update to 2.2.1. * Fri Jun 13 2014 Thomas Moschny - 2.1.8-1 - Update to 2.1.8. - Update upstream URLs. - Provide a Python3 subpackage. * Sat Jun 07 2014 Fedora Release Engineering - 2.1.5-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Sun Aug 04 2013 Fedora Release Engineering - 2.1.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Wed Jan 30 2013 Thomas Moschny - 2.1.5-2 - Add patch to support pillow (bz 896295). * Fri Nov 23 2012 Thomas Moschny - 2.1.5-1 - Update to 2.1.5. - Include LICENSE.txt. - Spec file cleanups. - Disable tests for now. * Sat Jul 21 2012 Fedora Release Engineering - 2.1.4-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Sat Jan 14 2012 Fedora Release Engineering - 2.1.4-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Wed Feb 09 2011 Fedora Release Engineering - 2.1.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Thu Jul 22 2010 David Malcolm - 2.1.4-4 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild * Fri Apr 16 2010 Thomas Moschny - 2.1.4-3 - Simplify %%check. * Fri Apr 16 2010 Thomas Moschny - 2.1.4-2 - Add missing BR python-nose for the tests. - Actually run the tests in %%check. - Remove obsolete comment about tidy. * Fri Apr 16 2010 Thomas Moschny - 2.1.4-1 - Update to 2.1.4. - Use %%global instead of %%define. - README is missing in the tarfile. * Sun Jul 26 2009 Fedora Release Engineering - 2.1.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Wed Mar 11 2009 Thomas Moschny - 2.1.3-1 - Upstream and upstream URLs changed. - Update to 2.1.3. - Remove now obsolete tweak for enabling import of htmlizer. - Process README.textile provided in the package. - Run test.py in %%check section. * Thu Feb 26 2009 Fedora Release Engineering - 2.0.11-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Nov 29 2008 Ignacio Vazquez-Abrams - 2.0.11-5 - Rebuild for Python 2.6 * 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. * Sat Sep 8 2007 Thomas Moschny - 2.0.11-1 - Initial version.