|
@@ -1,36 +1,9 @@
|
|
-%{!?__python3:%global __python3 /usr/bin/python3}
|
|
|
|
-%{!?python3_inc:%global python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(1))")}
|
|
|
|
-%{!?python3_sitearch: %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))")}
|
|
|
|
-%{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
|
|
|
|
-%{!?python3_version: %global python3_version %(python3 -c "import sys; sys.stdout.write(sys.version[:3])")}
|
|
|
|
-%{!?__python2: %global __python2 /usr/bin/python2}
|
|
|
|
-%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
|
|
|
|
-%define py2_setup setup.py
|
|
|
|
-%define py2_shbang_opts -s
|
|
|
|
-%define py2_build() %{expand:\
|
|
|
|
- CFLAGS="%{optflags}" %{__python2} %{py2_setup} %{?py2_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?1}\
|
|
|
|
-}
|
|
|
|
-%define py2_install() %{expand:\
|
|
|
|
- CFLAGS="%{optflags}" %{__python2} %{py2_setup} %{?py2_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\
|
|
|
|
-}
|
|
|
|
-%define py3_setup setup.py
|
|
|
|
-%define py3_shbang_opts -s
|
|
|
|
-%define py3_build() %{expand:\
|
|
|
|
- CFLAGS="%{optflags}" %{__python3} %{py3_setup} %{?py3_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?1}\
|
|
|
|
-}
|
|
|
|
-%define py3_install() %{expand:\
|
|
|
|
- CFLAGS="%{optflags}" %{__python3} %{py3_setup} %{?py3_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\
|
|
|
|
-}
|
|
|
|
-%define py3dir %{_builddir}/python3-%{name}-%{version}-%{release}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
%global with_python3 1
|
|
%global with_python3 1
|
|
-
|
|
|
|
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
|
|
|
%global upstream_name Pygments
|
|
%global upstream_name Pygments
|
|
|
|
+%global srcname pygments
|
|
|
|
|
|
Name: python-pygments
|
|
Name: python-pygments
|
|
-Version: 2.1.3
|
|
|
|
|
|
+Version: 2.3.0
|
|
Release: 1%{?_dist_release}
|
|
Release: 1%{?_dist_release}
|
|
Summary: A syntax highlighting engine written in Python
|
|
Summary: A syntax highlighting engine written in Python
|
|
|
|
|
|
@@ -38,14 +11,18 @@ Group: Development/Libraries
|
|
License: BSD
|
|
License: BSD
|
|
URL: http://pygments.org/
|
|
URL: http://pygments.org/
|
|
Source0: http://pypi.python.org/packages/source/P/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
|
|
Source0: http://pypi.python.org/packages/source/P/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
|
|
|
|
+
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
|
|
|
BuildArch: noarch
|
|
BuildArch: noarch
|
|
BuildRequires: python-devel >= 2.4, python-setuptools, python-nose
|
|
BuildRequires: python-devel >= 2.4, python-setuptools, python-nose
|
|
|
|
+BuildRequires: python-sphinx
|
|
|
|
+BuildRequires: python-rpm-macros
|
|
%if 0%{?with_python3}
|
|
%if 0%{?with_python3}
|
|
-BuildRequires: python3-devel, python3-setuptools
|
|
|
|
|
|
+BuildRequires: python3-devel, python3-setuptools, python3-nose
|
|
|
|
+BuildRequires: python3-rpm-macros
|
|
%endif # if with_python3
|
|
%endif # if with_python3
|
|
-Requires: python-setuptools, python-imaging
|
|
|
|
|
|
+Requires: python-setuptools
|
|
|
|
|
|
Vendor: Project Vine
|
|
Vendor: Project Vine
|
|
Distribution: Vine Linux
|
|
Distribution: Vine Linux
|
|
@@ -89,79 +66,68 @@ need to prettify source code. Highlights are:
|
|
|
|
|
|
|
|
|
|
%prep
|
|
%prep
|
|
-%setup -q -n Pygments-%{version}
|
|
|
|
-
|
|
|
|
-%if 0%{?with_python3}
|
|
|
|
-%__rm -rf %{py3dir}
|
|
|
|
-%__cp -a . %{py3dir}
|
|
|
|
-find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
|
|
|
-%endif # with_python3
|
|
|
|
-
|
|
|
|
|
|
+%setup -q -n %{upstream_name}-%{version}
|
|
|
|
|
|
%build
|
|
%build
|
|
-%{__python} setup.py build
|
|
|
|
%{__sed} -i 's/\r//' LICENSE
|
|
%{__sed} -i 's/\r//' LICENSE
|
|
|
|
+%py_build
|
|
|
|
|
|
%if 0%{?with_python3}
|
|
%if 0%{?with_python3}
|
|
-pushd %{py3dir}
|
|
|
|
-%{__python3} setup.py build
|
|
|
|
-popd
|
|
|
|
-%endif # with_python3
|
|
|
|
-
|
|
|
|
|
|
+%py3_build
|
|
|
|
+%endif
|
|
|
|
|
|
%install
|
|
%install
|
|
%__rm -rf $RPM_BUILD_ROOT
|
|
%__rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
-# Run the Python 3 build first so that the Python 2 version of
|
|
|
|
-# /usr/bin/pygmentize "wins":
|
|
|
|
-%if 0%{?with_python3}
|
|
|
|
-pushd %{py3dir}
|
|
|
|
-%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
|
|
|
|
-popd
|
|
|
|
-%endif # with_python3
|
|
|
|
-
|
|
|
|
-%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
|
|
|
|
|
|
+# Python 2 install
|
|
|
|
+# NOTE: sphinx is built on Python2 and packages with python2 and python3
|
|
|
|
+%py_install
|
|
|
|
+%{__python} setup.py build_sphinx
|
|
pushd doc
|
|
pushd doc
|
|
-%__install -d %{buildroot}%{_mandir}/man1
|
|
|
|
-%__mv pygmentize.1 $RPM_BUILD_ROOT%{_mandir}/man1/pygmentize.1
|
|
|
|
|
|
+install -d %{buildroot}%{_mandir}/man1
|
|
|
|
+mv pygmentize.1 $RPM_BUILD_ROOT%{_mandir}/man1/pygmentize.1
|
|
popd
|
|
popd
|
|
cp -r doc/docs doc/reST
|
|
cp -r doc/docs doc/reST
|
|
|
|
|
|
|
|
+%if 0%{?with_python3}
|
|
|
|
+# Python 3 install
|
|
|
|
+%py3_install
|
|
|
|
+%endif
|
|
|
|
|
|
%clean
|
|
%clean
|
|
%__rm -rf $RPM_BUILD_ROOT
|
|
%__rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
-
|
|
|
|
%check
|
|
%check
|
|
-%__make test
|
|
|
|
-
|
|
|
|
-# nose is not Python3 ready yet
|
|
|
|
|
|
+make test PYTHON=%{__python}
|
|
%if 0%{?with_python3}
|
|
%if 0%{?with_python3}
|
|
-pushd %{py3dir}
|
|
|
|
-make test
|
|
|
|
-popd
|
|
|
|
-%endif # with_python3
|
|
|
|
-
|
|
|
|
|
|
+make test PYTHON=%{__python3}
|
|
|
|
+%endif
|
|
|
|
|
|
%files
|
|
%files
|
|
%defattr(-,root,root,-)
|
|
%defattr(-,root,root,-)
|
|
|
|
+%doc AUTHORS CHANGES build/sphinx/html doc/reST TODO
|
|
%license LICENSE
|
|
%license LICENSE
|
|
-%doc AUTHORS CHANGES doc/reST TODO
|
|
|
|
# For noarch packages: sitelib
|
|
# For noarch packages: sitelib
|
|
%{python_sitelib}/*
|
|
%{python_sitelib}/*
|
|
%{_bindir}/pygmentize
|
|
%{_bindir}/pygmentize
|
|
-%lang(en) %{_mandir}/man1/pygmentize.1.gz
|
|
|
|
|
|
+%lang(en) %{_mandir}/man1/pygmentize.1*
|
|
|
|
|
|
%if 0%{?with_python3}
|
|
%if 0%{?with_python3}
|
|
%files -n python3-pygments
|
|
%files -n python3-pygments
|
|
%defattr(-,root,root,-)
|
|
%defattr(-,root,root,-)
|
|
|
|
+%doc AUTHORS CHANGES build/sphinx/html doc/reST TODO
|
|
%license LICENSE
|
|
%license LICENSE
|
|
-%doc AUTHORS CHANGES doc/reST TODO
|
|
|
|
%{python3_sitelib}/*
|
|
%{python3_sitelib}/*
|
|
|
|
+#{_bindir}/pygmentize
|
|
|
|
+#lang(en) %{_mandir}/man1/pygmentize.1*
|
|
%endif # with_python3
|
|
%endif # with_python3
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
%changelog
|
|
|
|
+* Tue Nov 27 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.3.0-1
|
|
|
|
+- new upstream release.
|
|
|
|
+- added python3 support.
|
|
|
|
+
|
|
* Tue Jul 12 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.1.3-1
|
|
* Tue Jul 12 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.1.3-1
|
|
- new upstream release.
|
|
- new upstream release.
|
|
|
|
|