%global srcname markups %define doc_license %{nil} %define doc_license 1 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} < 7 %define doc_license 0 %endif %else %if 0%{?fedora} < 19 %define doc_license 0 %endif %endif %endif %define license_files LICENSE %define python2_package python2 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} <= 7 %define python2_package python %endif %else %if 0%{?fedora} <= 25 %define python2_package python %endif %endif %endif %define python3_package python%{python3_pkgversion} %define with_python3 %{nil} %define with_python3 1 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} <= 5 %define with_python3 0 %endif %else %if 0%{?fedora} <= 12 %define with_python3 0 %endif %endif %endif %if 0%{?with_python3} %else %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} %endif Name: %{srcname}-python Version: 2.0.0 Release: 7%{?dist} License: BSD Summary: A wrapper around various text markups URL: https://pypi.python.org/pypi/Markups Source0: http://pypi.python.org/packages/source/M/Markups/Markups-%{version}.tar.gz BuildRequires: %{python2_package}-devel BuildRequires: %{python2_package}-docutils BuildRequires: %{python2_package}-markdown BuildRequires: %{python2_package}-setuptools BuildRequires: %{python2_package}-textile %if 0%{?with_python3} BuildRequires: %{python3_package}-devel BuildRequires: %{python3_package}-docutils BuildRequires: %{python3_package}-markdown BuildRequires: %{python3_package}-setuptools BuildRequires: %{python3_package}-textile %endif # if with_python3 BuildArch: noarch %description This module provides a Python wrapper around the various text markup languages, such as Markdown and reStructuredText (these two are supported by default). %package -n %{python2_package}-%{srcname} Summary: %{summary} Requires: %{python2_package} Requires: %{python2_package}-docutils Requires: %{python2_package}-markdown Requires: %{python2_package}-textile %{?python_provide:%python_provide %{python2_package}-%{srcname}} %if "%{python2_package}" != "python2" #%{?python_provide:%python_provide python2-%{srcname}} Provides: python2-%{srcname} = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: python2-%{srcname} < %{?epoch:%{epoch}:}%{version}-%{release} %endif %if "%{python2_package}" != "python" #%{?python_provide:%python_provide python-%{srcname}} Provides: python-%{srcname} = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: python-%{srcname} < %{?epoch:%{epoch}:}%{version}-%{release} %endif %description -n %{python2_package}-%{srcname} This module provides a Python 2 wrapper around the various text markup languages, such as Markdown and reStructuredText (these two are supported by default). %if 0%{?with_python3} %package -n %{python3_package}-%{srcname} Summary: %{summary} Requires: %{python3_package} Requires: %{python3_package}-docutils Requires: %{python3_package}-markdown Requires: %{python3_package}-textile %{?python_provide:%python_provide %{python3_package}-%{srcname}} %if "%{python3_package}" != "python3" #%{?python_provide:%python_provide python3-%{srcname}} Provides: python3-%{srcname} = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: python3-%{srcname} < %{?epoch:%{epoch}:}%{version}-%{release} %endif %description -n %{python3_package}-%{srcname} This module provides a Python 3 wrapper around the various text markup languages, such as Markdown and reStructuredText (these two are supported by default). %endif # with_python3 %prep %setup -qc -n "Markups-%{version}" rm -rf "python2" || : rm -rf "python3" || : mv "Markups-%{version}" "python2" pushd "python2" # The source tarball contains a bundled egg-info. rm -rf "Markups.egg-info" popd %if 0%{?with_python3} cp -a "python2" "python3" %endif pushd "python2" cp changelog README.rst .. %if 0%{?license_files:1} && "%{license_files}" != "" cp %{?license_files} .. %endif popd %build pushd "python2" %{__python2} setup.py build popd %if 0%{?with_python3} pushd "python3" %{__python3} setup.py build popd %endif # with_python3 %install # Must do the python3 install first because the scripts in /usr/bin # (if any) are overwritten with every setup.py install (and we want # the python2 version to be the default for now). %if 0%{?with_python3} pushd "python3" %{__python3} setup.py install --skip-build --root "${RPM_BUILD_ROOT}" popd %endif # with_python3 pushd "python2" %{__python2} setup.py install --skip-build --root "${RPM_BUILD_ROOT}" popd %check #pushd "python2" #%%{__python2} setup.py test || : #popd #%%if 0%%{?with_python3} #pushd "python3" #%%{__python3} setup.py test || : #popd #%%endif # with_python3 %files -n %{python2_package}-%{srcname} %doc changelog README.rst %if 0%{?doc_license} %license %{license_files} %else %doc %{license_files} %endif %{python2_sitelib}/* %if 0%{?with_python3} %files -n %{python3_package}-%{srcname} %doc changelog README.rst %if 0%{?doc_license} %license %{license_files} %else %doc %{license_files} %endif %{python3_sitelib}/* %endif # with_python3 %changelog * Sat Nov 04 2017 Tomasz Tomasik - 2.0.0-7 - Add support for EL7 - Update requirements - Rewrite prep, build and install sections - Rebuilt for EL7 * Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 2.0.0-6 - Python 2 binary package renamed to python2-markups See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 * Thu Jul 27 2017 Fedora Release Engineering - 2.0.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Sat Feb 11 2017 Fedora Release Engineering - 2.0.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Mon Dec 19 2016 Miro Hrončok - 2.0.0-3 - Rebuild for Python 3.6 * Tue Jul 19 2016 Fedora Release Engineering - 2.0.0-2 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages * Fri May 13 2016 Mario Blättermann - 2.0-1 - New upstream version * Thu Feb 04 2016 Fedora Release Engineering - 1.0.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Sat Jan 23 2016 Mario Blättermann - 1.0.1-1 - New upstream version * Tue Nov 10 2015 Fedora Release Engineering - 0.6.3-5 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Sat Sep 26 2015 Mario Blättermann - 0.6.3-4 - Yet some more runtime requirements * Thu Sep 24 2015 Mario Blättermann - 0.6.3-3 - Fix runtime requirements * Tue Sep 22 2015 Mario Blättermann - 0.6.3-2 - Add python-docutils as runtime requirement * Fri Sep 11 2015 Mario Blättermann - 0.6.3-1 - New upstream version - Disable the tests for now * Thu Jun 18 2015 Fedora Release Engineering - 0.5.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Wed Dec 31 2014 Mario Blättermann - 0.5.2-4 - Fix the disttag - Remove LICENSE from %%doc in the python3 package * Tue Dec 30 2014 Mario Blättermann - 0.5.2-3 - Use the %%license macro * Sat Dec 06 2014 Mario Blättermann - 0.5.2-2 - Some cleanup due to rpmlint warnings * Sun Nov 30 2014 Mario Blättermann - 0.5.2-1 - New upstream version - Enable both Python 2 and 3 * Sun May 05 2013 Huaren Zhong - 0.2.4 - Rebuild for Fedora * Wed Feb 6 2013 saschpe@suse.de - Completely redone spec file * Sat Feb 2 2013 i@marguerite.su - initial version 0.2.4