%global srcname jats %if ( 0%{?rhel} && 0%{?rhel} == 6 ) || ( 0%{?centos} && 0%{?centos} == 6 ) %bcond_with python3 %bcond_without python2 %endif %if ( 0%{?rhel} && 0%{?rhel} == 7 ) || ( 0%{?centos} && 0%{?centos} == 7 ) %bcond_without python3 %bcond_without python2 %endif %if ( 0%{?rhel} && 0%{?rhel} > 7 ) || ( 0%{?centos} && 0%{?centos} > 7 ) %bcond_without python3 %bcond_with python2 %endif %if 0%{?fedora} %bcond_without python3 %bcond_with python2 %endif %if %{with python2} %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?pyver: %global pyver %(%{__python} -c "import sys ; print sys.version[:3]")} %global mkit_safever %(sh -c 'echo -n "0.3.7" | tr -c "a-zA-Z0-9._" _') %endif Name: python-jats Version: 0.3.7 Release: 1%{?dist} Summary: jats - Python API for JATS. URL: https://gitlab.com/vornet/jats/python-jats License: LGPLv2 Source0: %{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: make %description Python API for JATS. %if %{with python2} %package -n python2-%{srcname} Summary: %{summary} BuildRequires: python2-devel Requires: PyYAML %description -n python2-%{srcname} Python API for JATS. %endif %if %{with python3} %package -n python3-%{srcname} Summary: %{summary} BuildRequires: python3-devel BuildRequires: python3-setuptools Requires: python3-pyyaml %description -n python3-%{srcname} Python API for JATS. %endif %prep %setup -q %build make %{?_smp_mflags} PREFIX=/usr build_pystuff %if %{with python2} %{__python} setup.py build %endif %if %{with python3} %py3_build %endif %install %if %{with python2} %{__python} setup.py install \ -O1 \ --skip-build \ --root $RPM_BUILD_ROOT \ --install-data=%{_datadir} %endif %if %{with python3} %py3_install %endif %if %{with python2} %files -n python2-%{srcname} %{python_sitelib}/%{srcname}-%{mkit_safever}-py%{pyver}.egg-info %{python_sitelib}/%{srcname} %endif %if %{with python3} %files -n python3-%{srcname} %{python3_sitelib}/%{srcname}-*.egg-info %{python3_sitelib}/%{srcname}/ %endif %changelog # specfile built with MKit 0.0.50