python-pygments-vl.spec 6.4 KB

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