%define srcname PyCifRW %define common_summary CIF/STAR file support for Python %define common_desc PyCIFRW provides support for reading and writing CIF (Crystallographic Information Format) files using Python. %{?!__python2:%global __python2 %{__python}} %{?!python2_sitelib:%global python2_sitelib %{python_sitelib}} %{?!python2_version:%global python2_version %{python_version}} %if 0%{?fedora} >= 13 || 0%{?rhel} >= 7 %global with_py3 1 %endif # 0#{?fedora} >= 13 || 0#{?rhel} >= 7 Name: %{srcname} Version: 4.4.1 Release: 1%{?dist} Summary: %{common_summary} License: Python 2.0 URL: https://bitbucket.org/jamesrhester/pycifrw/overview Source0: https://files.pythonhosted.org/packages/b3/09/7578e066d81ba978b6eefe2330cc80940939ed4be423e1c8ef49181540ca/%{srcname}-%{version}.tar.gz %description %{common_desc} %package -n python2-%{srcname} Summary: %{common_summary} BuildRequires: python-setuptools BuildRequires: python2-devel Requires: python2-numpy %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} %{common_desc} %if 0%{?with_py3} %package -n python%{python3_pkgversion}-%{srcname} Summary: %{common_summary} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools Requires: python%{python3_pkgversion}-numpy %{?python_provide:%python_provide python3-%{srcname}} %description -n python%{python3_pkgversion}-%{srcname} %{common_desc} %endif %prep %{__rm} -rf *.egg-info %autosetup -n %{srcname}-%{version} %build %py2_build %{?with_py3:%py3_build} %install %py2_install %{?with_py3:%py3_install} %files -n python2-%{srcname} %license LICENSE %doc PKG-INFO *.md %{python2_sitearch}/CifFile %{python2_sitearch}/PyCifRW-%{version}-py%{python2_version}.egg-info %if 0%{?with_py3} %files -n python%{python3_pkgversion}-%{srcname} %license LICENSE %doc PKG-INFO *.md %{python3_sitearch}/CifFile %{python3_sitearch}/PyCifRW-%{version}-py%{python3_version}.egg-info %endif %changelog * Mon Jan 13 2020 Martyn Gigg - 4.4.1-1 - Update to 4.4.1 - Enable Python 3 support for RHEL 7 * Wed Feb 01 2017 Stuart Campbell - 4.2.1-1 - Initial package