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.7
Release:        1%{?dist}
Summary:        %{sum}

License:        MIT
URL:            https://github.com/neo4j-contrib/%{srcname}
Source0:        https://github.com/neo4j-contrib/%{srcname}/archive/%{version}.tar.gz
Patch0:         fix-syntax-error.patch

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