%{!?dotests: %define dotests 1} %define name python3-pygments %define srcname Pygments %define version 2.4.2 %define release 1 %define is_python %(test -e /usr/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python3_32 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /usr/bin/python3 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %endif Summary: Syntax highlighting engine written in Python Name: %{name} Version: %{version} Release: %{release} Source0: http://pypi.python.org/packages/source/P/%{srcname}/%{srcname}-%{version}.tar.gz Url: http://pygments.org License: BSD Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildRequires: python3 >= 3.7.3 BuildRequires: python3-devel >= 3.7.3 BuildRequires: python3-nose >= 1.3.7 BuildArch: noarch %description Pygments is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code. Highlights are: * a wide range of common languages and markup formats is supported * special attention is paid to details that increase highlighting quality * support for new languages and formats are added easily; most languages use a simple regex-based lexing mechanism * a number of output formats is available, among them HTML, RTF, LaTeX and ANSI sequences * it is usable as a command-line tool and as a library * ... and it highlights even Brainf*ck! The `Pygments tip`_ is installable with ``easy_install Pygments==dev``. .. _Pygments tip: http://bitbucket.org/birkenfeld/pygments-main/get/default.zip#egg=Pygments-dev :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details %prep %setup -q -n %{srcname}-%{version} %build export OBJECT_MODE=64 python3 setup.py build if [ "%{dotests}" == 1 ] then gmake test PYTHON=/opt/freeware/bin/python3 fi %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} install -d %{buildroot}%{_mandir}/man1 pwd mv doc/pygmentize.1 $RPM_BUILD_ROOT%{_mandir}/man1/pygmentize.1 #Renaming binaries to avoid conflict with python-pygments mv $RPM_BUILD_ROOT%{_bindir}/pygmentize $RPM_BUILD_ROOT%{_bindir}/pygmentize-3 cd ${RPM_BUILD_ROOT} mkdir -p usr/bin cd usr/bin ln -sf ../..%{_bindir}/* . %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc AUTHORS CHANGES doc LICENSE TODO /usr/bin/* %{_bindir}/* %{python_sitelib}/* %changelog * Mon Nov 18 2019 Reshma V Kumar - 2.4.2-1 - Update to latest version - Build with python3 * Thu Sep 21 2017 Ravi Hirekurabar -2.2.0-1 - Updated to 2.2.0-1 * Thu Oct 30 2014 Gerard Visiedo - 2.0rc1-1 - first version for AIX V6.1 and higher