From f1eb06f2d15be98cc7c39b517b441b12bfa1adf9 Mon Sep 17 00:00:00 2001 From: mprahl Date: Jul 22 2019 16:46:59 +0000 Subject: Stop building Python 2 packages for F31+ --- diff --git a/python-neomodel.spec b/python-neomodel.spec index 328ca27..68e9c38 100644 --- a/python-neomodel.spec +++ b/python-neomodel.spec @@ -1,10 +1,12 @@ %global srcname neomodel %global sum A Python OGM for Neo4j %global desc A Python Object Graph Mapper (OGM) for the Neo4j graph database +%define _build_python2 (0%{?fedora} && 0%{?fedora} < 31) || (0%{?rhel} && 0%{?rhel} < 8) +%define _build_python3 0%{?fedora} || 0%{?rhel} > 7 Name: python-%{srcname} Version: 3.3.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: %{sum} License: MIT @@ -12,9 +14,11 @@ URL: https://pypi.python.org/pypi/%{srcname} Source0: https://files.pythonhosted.org/packages/source/n/%{srcname}/%{srcname}-%{version}.tar.gz BuildArch: noarch +%if %{_build_python2} BuildRequires: python2-devel BuildRequires: python2-setuptools -%if 0%{?fedora} || 0%{?rhel} > 7 +%endif +%if %{_build_python3} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %endif @@ -23,7 +27,7 @@ BuildRequires: python%{python3_pkgversion}-setuptools %description %{desc} -%if 0%{?fedora} || 0%{?rhel} > 7 +%if %{_build_python3} %package -n python%{python3_pkgversion}-%{srcname} Summary: %{sum} %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} @@ -39,7 +43,7 @@ Requires: python3-pytz Summary: %{sum} %{?python_provide:%python_provide python2-%{srcname}} Requires: python2-neo4j-driver -%if 0%{?fedora} || 0%{?rhel} > 7 +%if %{_build_python3} Requires: python2-pytz %else Requires: pytz @@ -54,29 +58,44 @@ Requires: pytz %build -%if 0%{?fedora} || 0%{?rhel} > 7 +%if %{_build_python3} %py3_build %endif +%if %{_build_python2} %py2_build +%endif + %install -%if 0%{?fedora} || 0%{?rhel} > 7 +%if %{_build_python3} %py3_install + +%if !%{_build_python2} +ln -s %{_bindir}/neomodel_install_labels %{buildroot}/%{_bindir}/neomodel_install_labels-3 +ln -s %{_bindir}/neomodel_install_labels %{buildroot}/%{_bindir}/neomodel_install_labels-%{python3_version} +ln -s %{_bindir}/neomodel_remove_labels %{buildroot}/%{_bindir}/neomodel_remove_labels-3 +ln -s %{_bindir}/neomodel_remove_labels %{buildroot}/%{_bindir}/neomodel_remove_labels-%{python3_version} +%else mv %{buildroot}/%{_bindir}/neomodel_install_labels %{buildroot}/%{_bindir}/neomodel_install_labels-3 ln -s %{_bindir}/neomodel_install_labels-3 %{buildroot}/%{_bindir}/neomodel_install_labels-%{python3_version} mv %{buildroot}/%{_bindir}/neomodel_remove_labels %{buildroot}/%{_bindir}/neomodel_remove_labels-3 ln -s %{_bindir}/neomodel_remove_labels-3 %{buildroot}/%{_bindir}/neomodel_remove_labels-%{python3_version} %endif +%endif + + +%if %{_build_python2} %py2_install ln -s %{_bindir}/neomodel_install_labels %{buildroot}/%{_bindir}/neomodel_install_labels-2 ln -s %{_bindir}/neomodel_install_labels %{buildroot}/%{_bindir}/neomodel_install_labels-%{python2_version} ln -s %{_bindir}/neomodel_remove_labels %{buildroot}/%{_bindir}/neomodel_remove_labels-2 ln -s %{_bindir}/neomodel_remove_labels %{buildroot}/%{_bindir}/neomodel_remove_labels-%{python2_version} +%endif -%if 0%{?fedora} || 0%{?rhel} > 7 +%if %{_build_python3} %files -n python%{python3_pkgversion}-%{srcname} %license LICENSE %doc README.rst @@ -85,8 +104,15 @@ ln -s %{_bindir}/neomodel_remove_labels %{buildroot}/%{_bindir}/neomodel_remove_ %{_bindir}/neomodel_install_labels-%{python3_version} %{_bindir}/neomodel_remove_labels-3 %{_bindir}/neomodel_remove_labels-%{python3_version} + +%if !%{_build_python2} +%{_bindir}/neomodel_install_labels +%{_bindir}/neomodel_remove_labels %endif +%endif + +%if %{_build_python2} %files -n python2-%{srcname} %license LICENSE %doc README.rst @@ -97,9 +123,13 @@ ln -s %{_bindir}/neomodel_remove_labels %{buildroot}/%{_bindir}/neomodel_remove_ %{_bindir}/neomodel_remove_labels %{_bindir}/neomodel_remove_labels-2 %{_bindir}/neomodel_remove_labels-%{python2_version} +%endif %changelog +* Mon Jul 22 2019 mprahl - 3.3.1-2 +- Stop building Python 2 packages for F31+ + * Tue Apr 09 2019 mprahl - 3.3.1-1 - new version