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