%bcond_without tests %global debug_package %{nil} %global pypi_name dcmstack %global _description %{expand: The dcmstack software allows series of DICOM images to be stacked into multi-dimensional arrays. These arrays can be written out as Nifti files with an optional header extension (the DcmMeta extension) containing a summary of all the meta data from the source DICOM files. The meta data can be injected it into a Nifti header extension or written out as a JSON formatted text file.} Name: %{pypi_name} Version: 0.8.0 Release: 1%{?dist} Summary: DICOM to Nifti conversion with meta data preservation License: MIT URL: https://github.com/moloney/dcmstack Source0: https://github.com/moloney/%{pypi_name}/archive/v0.8/%{pypi_name}-%{version}.tar.gz BuildRequires: python3-devel BuildRequires: %{py3_dist pydicom} BuildRequires: %{py3_dist nibabel} # For docs BuildRequires: %{py3_dist sphinx} BuildRequires: %{py3_dist mock} BuildRequires: %{py3_dist numpydoc} %if %{with tests} BuildRequires: %{py3_dist nose} %endif %{?python_enable_dependency_generator} %description %_description %package doc Summary: %{summary} %description doc Documentation for %{name}. %{?python_provide:%python_provide %{pypi_name}} %prep %autosetup -n %{pypi_name}-%{version} rm -rf %{pypi_name}.egg-info find . -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';' %build %py3_build # Build docs pushd doc rm -rf _build _static _templates make html popd %install %py3_install %check %if %{with tests} # Test not working: https://github.com/moloney/dcmstack/issues/67 # Disabled the test sed -i '8ifrom nose.tools import nottest' test/test_dcmmeta.py sed -i '991i\ \ \ \ @nottest' test/test_dcmmeta.py export PYTHONPATH=%{buildroot}%{python3_sitelib} nosetests-%{python3_version} %endif %files %doc README.rst %license COPYING %{_bindir}/%{pypi_name} %{_bindir}/nitool %{python3_sitelib}/%{pypi_name}/ %{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/ %files doc %license COPYING %doc README.rst %doc doc/_build/html %changelog * Thu Jun 18 2020 Aniket Pradhan - 0.8.0-1 - Initial build