python-pygments-vl.spec 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. %global with_python3 0
  2. %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
  3. %global upstream_name Pygments
  4. Name: python-pygments
  5. Version: 1.3.1
  6. Release: 1%{?_dist_release}
  7. Summary: A syntax highlighting engine written in Python
  8. Group: Development/Libraries
  9. License: BSD
  10. URL: http://pygments.org/
  11. Source0: http://pypi.python.org/packages/source/P/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
  12. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  13. BuildArch: noarch
  14. BuildRequires: python-devel >= 2.4, python-setuptools, python-nose
  15. %if 0%{?with_python3}
  16. BuildRequires: python3-devel, python3-setuptools
  17. %endif # if with_python3
  18. Requires: python-setuptools, python-imaging
  19. %description
  20. Pygments is a generic syntax highlighter for general use in all kinds
  21. of software such as forum systems, wikis or other applications that
  22. need to prettify source code. Highlights are:
  23. * a wide range of common languages and markup formats is supported
  24. * special attention is paid to details that increase highlighting
  25. quality
  26. * support for new languages and formats are added easily; most
  27. languages use a simple regex-based lexing mechanism
  28. * a number of output formats is available, among them HTML, RTF,
  29. LaTeX and ANSI sequences
  30. * it is usable as a command-line tool and as a library
  31. * ... and it highlights even Brainf*ck!
  32. %if 0%{?with_python3}
  33. %package -n python3-pygments
  34. Summary: A syntax highlighting engine written in Python 3
  35. Group: Development/Libraries
  36. Requires: python3-setuptools
  37. %description -n python3-pygments
  38. Pygments is a generic syntax highlighter for general use in all kinds
  39. of software such as forum systems, wikis or other applications that
  40. need to prettify source code. Highlights are:
  41. * a wide range of common languages and markup formats is supported
  42. * special attention is paid to details that increase highlighting
  43. quality
  44. * support for new languages and formats are added easily; most
  45. languages use a simple regex-based lexing mechanism
  46. * a number of output formats is available, among them HTML, RTF,
  47. LaTeX and ANSI sequences
  48. * it is usable as a command-line tool and as a library
  49. * ... and it highlights even Brainf*ck!
  50. %endif # if with_python3
  51. %prep
  52. %setup -q -n Pygments-%{version}
  53. %if 0%{?with_python3}
  54. %__rm -rf %{py3dir}
  55. %__cp -a . %{py3dir}
  56. find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
  57. %endif # with_python3
  58. %build
  59. %{__python} setup.py build
  60. %{__sed} -i 's/\r//' LICENSE
  61. %if 0%{?with_python3}
  62. pushd %{py3dir}
  63. %{__python3} setup.py build
  64. popd
  65. %endif # with_python3
  66. %install
  67. %__rm -rf $RPM_BUILD_ROOT
  68. # Run the Python 3 build first so that the Python 2 version of
  69. # /usr/bin/pygmentize "wins":
  70. %if 0%{?with_python3}
  71. pushd %{py3dir}
  72. %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
  73. popd
  74. %endif # with_python3
  75. %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
  76. pushd docs
  77. %__install -d %{buildroot}%{_mandir}/man1
  78. %__mv pygmentize.1 $RPM_BUILD_ROOT%{_mandir}/man1/pygmentize.1
  79. %__mv build html
  80. %__mv src reST
  81. popd
  82. %clean
  83. %__rm -rf $RPM_BUILD_ROOT
  84. %check
  85. %__make test
  86. # nose is not Python3 ready yet
  87. %if 0%{?with_python3}
  88. pushd %{py3dir}
  89. #make test
  90. popd
  91. %endif # with_python3
  92. %files
  93. %defattr(-,root,root,-)
  94. %doc AUTHORS CHANGES docs/html docs/reST LICENSE TODO
  95. # For noarch packages: sitelib
  96. %{python_sitelib}/*
  97. %{_bindir}/pygmentize
  98. %lang(en) %{_mandir}/man1/pygmentize.1.gz
  99. %if 0%{?with_python3}
  100. %files -n python3-pygments
  101. %defattr(-,root,root,-)
  102. %doc AUTHORS CHANGES docs/html docs/reST LICENSE TODO
  103. %{python3_sitelib}/*
  104. %endif # with_python3
  105. %changelog
  106. * Mon Aug 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 1.3.1-1
  107. - initial build based on Fedora development
  108. * Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.3.1-6
  109. - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
  110. * Thu May 6 2010 Gareth Armstrong <gareth.armstrong@hp.com> - 1.3.1-5
  111. - Enforce that Pygments requires Python 2.4 or later via an explicit BR
  112. - Minor tweaks to spec file
  113. - Deliver html and reST doc files to specifically named directories
  114. - Align description with that of http://pygments.org/
  115. - Add %%check section for Python2 and add BR on python-nose
  116. * Fri Apr 23 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-4
  117. - switched with_python3 back to 1
  118. * Fri Apr 23 2010 David Malcolm <dmalcolm@redhat.com> - 1.3.1-3
  119. - add python3 subpackage (BZ#537244), ignoring soft-dep on imaging for now
  120. * Sat Apr 13 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-2
  121. - added python-imaging as a dependency per BZ#581663.
  122. * Sat Mar 6 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-1
  123. - Updated for release.
  124. * Tue Sep 29 2009 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.1.1-1
  125. - Updated for release.
  126. * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-5
  127. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  128. * Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-4
  129. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  130. * Sun Dec 21 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.0-3
  131. - Updated for release.
  132. * Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.0-2
  133. - Rebuild for Python 2.6
  134. * Fri Nov 27 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.0-1
  135. - Updated for upstream 1.0.
  136. * Sun Sep 14 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.11.1-1
  137. - Updated for upstream 0.11.
  138. * Mon Jul 21 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.10-1
  139. - Updated for upstream 0.10.
  140. * Thu Nov 29 2007 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.9-2
  141. - Added python-setuptools as a Requires per bz#403601.
  142. * Mon Nov 12 2007 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.9-1
  143. - Updated for upstream 0.9.
  144. * Thu Aug 17 2007 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.8.1-2
  145. - Removed the dos2unix build dependency.
  146. * Thu Jun 28 2007 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.8.1-1
  147. - Initial packaging for Fedora.