Blob Blame Raw
%global srcname neomodel
%global sum A Python OGM for Neo4j
%global desc A Python Object Graph Mapper (OGM) for the Neo4j graph database

Name:           python-%{srcname}
Version:        3.2.8
Release:        3%{?dist}
Summary:        %{sum}

License:        MIT
URL:            https://pypi.python.org/pypi/%{srcname}
Source0:        https://files.pythonhosted.org/packages/source/n/%{srcname}/%{srcname}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools
%endif


%description
%{desc}

%if 0%{?fedora} || 0%{?rhel} > 7
%package -n python%{python3_pkgversion}-%{srcname}
Summary:        %{sum}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
Requires:       python3-neo4j-driver >= 1.5.0, python3-neo4j-driver < 1.6.0
Requires:       python3-pytz

%description -n python%{python3_pkgversion}-%{srcname}
%{desc}
%endif


%package -n python2-%{srcname}
Summary:        %{sum}
%{?python_provide:%python_provide python2-%{srcname}}
Requires:       python2-neo4j-driver >= 1.5.0, python2-neo4j-driver < 1.6.0
%if 0%{?fedora} || 0%{?rhel} > 7
Requires:       python2-pytz
%else
Requires:       pytz
%endif

%description -n python2-%{srcname}
%{desc}


%prep
%autosetup -p1 -n %{srcname}-%{version}


%build
%if 0%{?fedora} || 0%{?rhel} > 7
%py3_build
%endif

%py2_build

%install
%if 0%{?fedora} || 0%{?rhel} > 7
%py3_install
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

%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}


%if 0%{?fedora} || 0%{?rhel} > 7
%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/*
%{_bindir}/neomodel_install_labels-3
%{_bindir}/neomodel_install_labels-%{python3_version}
%{_bindir}/neomodel_remove_labels-3
%{_bindir}/neomodel_remove_labels-%{python3_version}
%endif

%files -n python2-%{srcname}
%license LICENSE
%doc README.rst
%{python2_sitelib}/*
%{_bindir}/neomodel_install_labels
%{_bindir}/neomodel_install_labels-2
%{_bindir}/neomodel_install_labels-%{python2_version}
%{_bindir}/neomodel_remove_labels
%{_bindir}/neomodel_remove_labels-2
%{_bindir}/neomodel_remove_labels-%{python2_version}


%changelog
* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 3.2.8-3
- Rebuilt for Python 3.7

* Thu Jun 14 2018 mprahl <mprahl@redhat.com> - 3.2.8-2
- pin the python-neo4j-driver version

* Tue May 01 2018 mprahl <mprahl@redhat.com> - 3.2.8-1
- new version

* Thu Apr 26 2018 mprahl <mprahl@redhat.com> - 3.2.7-1
- new version

* Mon Apr 02 2018 mprahl <mprahl@redhat.com> - 3.2.5.1
- Initial release