python-markupsafe-vl.spec 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. %global with_python3 0
  2. %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
  3. Name: python-markupsafe
  4. Version: 0.9.2
  5. Release: 1%{?_dist_release}
  6. Summary: Implements a XML/HTML/XHTML Markup safe string for Python
  7. Group: Development/Languages
  8. License: BSD
  9. URL: http://pypi.python.org/pypi/MarkupSafe
  10. Source0: http://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz
  11. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  12. BuildRequires: python-devel python-setuptools
  13. %if 0%{?with_python3}
  14. BuildRequires: python3-devel python3-setuptools
  15. # For /usr/bin/2to3
  16. BuildRequires: python-tools
  17. %endif # if with_python3
  18. %description
  19. A library for safe markup escaping.
  20. %if 0%{?with_python3}
  21. %package -n python3-markupsafe
  22. Summary: Implements a XML/HTML/XHTML Markup safe string for Python
  23. Group: Development/Languages
  24. %description -n python3-markupsafe
  25. A library for safe markup escaping.
  26. %endif #if with_python3
  27. %prep
  28. %setup -q -n MarkupSafe-%{version}
  29. %if 0%{?with_python3}
  30. %__rm -rf %{py3dir}
  31. %__cp -a . %{py3dir}
  32. 2to3 --write --nobackups %{py3dir}
  33. %endif # with_python3
  34. %build
  35. CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
  36. %if 0%{?with_python3}
  37. pushd %{py3dir}
  38. CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
  39. popd
  40. %endif # with_python3
  41. %install
  42. %__rm -rf $RPM_BUILD_ROOT
  43. %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
  44. # C code errantly gets installed
  45. %__rm $RPM_BUILD_ROOT/%{python_sitearch}/markupsafe/*.c
  46. %if 0%{?with_python3}
  47. pushd %{py3dir}
  48. %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
  49. %__rm $RPM_BUILD_ROOT/%{python3_sitearch}/markupsafe/*.c
  50. popd
  51. %endif # with_python3
  52. %check
  53. %{__python} setup.py test
  54. %if 0%{?with_python3}
  55. pushd %{py3dir}
  56. %{__python3} setup.py test
  57. popd
  58. %endif # with_python3
  59. %clean
  60. %__rm -rf $RPM_BUILD_ROOT
  61. %files
  62. %defattr(-,root,root,-)
  63. %doc AUTHORS LICENSE README.rst
  64. %{python_sitearch}/*
  65. %if 0%{?with_python3}
  66. %files -n python3-markupsafe
  67. %defattr(-,root,root,-)
  68. %doc AUTHORS LICENSE README.rst
  69. %{python3_sitearch}/*
  70. %endif # with_python3
  71. %changelog
  72. * Mon Aug 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 0.9.2-1
  73. - initial build based on Fedora development
  74. * Fri Jul 23 2010 David Malcolm <dmalcolm@redhat.com> - 0.9.2-4
  75. - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
  76. * Thu Jun 24 2010 Kyle VanderBeek <kylev@kylev.com> - 0.9.2-3
  77. - Fix missing setuptools BuildRequires.
  78. * Thu Jun 24 2010 Kyle VanderBeek <kylev@kylev.com> - 0.9.2-2
  79. - Fixed sitearch and python3 definitions to work better with older Fedora/RHEL.
  80. * Wed Jun 23 2010 Kyle VanderBeek <kylev@kylev.com> - 0.9.2-1
  81. - Initial version.