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