Blob Blame History Raw
%bcond_without check
# https://bitbucket.org/glotzer/gsd/issues/11/
%bcond_with docs

%global pname gsd

%global desc \
GSD (General Simulation Data) is a file format specification and a library\
to read and write it. The package also contains a python module that reads\
and writes hoomd schema gsd files with an easy to use syntax.\
\
* Efficiently store many frames of data from simulation runs.\
* High performance file read and write.\
* Support arbitrary chunks of data in each frame (position, orientation,\
  type, etc...).\
* Append frames to an existing file with a monotonically increasing frame\
  number.\
* Resilient to job kills.\
* Variable number of named chunks in each frame.\
* Variable size of chunks in each frame.\
* Each chunk identifies data type.\
* Common use cases: NxM arrays in double, float, int, char types.\
* Generic use case: binary blob of N bytes.\
* Easy to integrate into other tools with python, or a C API (< 1k lines).\
* Fast random access to frames.

Name: python-gsd
Version: 1.5.0
Release: 1%{?dist}
Summary: Read and write hoomd schema gsd files with an easy to use syntax 
License: BSD
URL: https://bitbucket.org/glotzer/gsd
Source0: https://glotzerlab.engin.umich.edu/Downloads/%{pname}/%{pname}-v%{version}.tar.gz
BuildRequires: gcc
%if %{with docs}
BuildRequires: python3-ipython-sphinx
%endif

%description
%{desc}

%package -n python2-%{pname}
Summary: %{summary}
BuildRequires: python2-Cython
BuildRequires: python2-devel
BuildRequires: python2-numpy
%if %{with check}
BuildRequires: python2-nose
%endif
%{?python_provide:%python_provide python2-%{pname}}

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

%package -n python3-%{pname}
Summary: %{summary}
BuildRequires: python3-Cython
BuildRequires: python3-devel
BuildRequires: python3-numpy
%if %{with check}
BuildRequires: python3-nose
%endif
%{?python_provide:%python_provide python3-%{pname}}

%description -n python3-%{pname}
%{desc}

%prep
%setup -q -n %{pname}-v%{version}

%build
# rebuild C bindings with system Cython
pushd gsd
./generate_code.sh
popd
%py2_build
%py3_build
%if %{with docs}
PYTHONPATH=%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}:$PWD \
  %{__python3} setup.py develop -d $PWD
make -C doc html
%endif

%install
%py2_install
%py3_install

%if %{with check}
%check
# tests only work with python 3.2+ https://bitbucket.org/glotzer/gsd/issues/10/
#PYTHONPATH=%{buildroot}%{python2_sitearch} nosetests-%{python2_version}
PYTHONPATH=%{buildroot}%{python3_sitearch} nosetests-%{python3_version}
%endif

%files -n python2-%{pname}
%license LICENSE
%doc ChangeLog.md README.md
%{python2_sitearch}/%{pname}-%{version}-py%{python2_version}.egg-info
%{python2_sitearch}/%{pname}

%files -n python3-%{pname}
%license LICENSE
%doc ChangeLog.md README.md
%{python3_sitearch}/%{pname}-%{version}-py%{python3_version}.egg-info
%{python3_sitearch}/%{pname}

%changelog
* Fri Feb 23 2018 Dominik Mierzejewski <dominik@greysector.net> 1.5.0-1
- initial build