File python-PyCBC.spec of Package python-PyCBC

# spec file for package python-PyCBC
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-PyCBC
Version:        1.14.1
Release:        0
License:        GPL-3.0-or-later
Summary:        Core library to analyze gravitational-wave data
Group:          Development/Languages/Python
# PATCH-FEATURE-OPENSUSE python-PyCBC-work-with-latest-numpy.patch -- Avoid checking for max supported numpy version for python2 to get it building on openSUSE >= 1550 where the current python2-numpy version is 1.16.x
Patch0:         python-PyCBC-work-with-latest-numpy.patch
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module Cython}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  %{python_module numpy}
BuildRequires:  %{python_module numpy-devel}
Requires:       python-numpy


PyCBC is a software package used to explore astrophysical sources of gravitational waves. It contains algorithms to analyze gravitational-wave data from the LIGO and Virgo detectors, detect coalescing compact binaries, and measure the astrophysical parameters of detected sources.

%setup -q -n PyCBC-%{version}
%patch0 -p1


sed -E -i "1 s|^#\!\s*/usr/bin/env\s*bash|#\!/bin/bash|" %{buildroot}%{_bindir}/run_pycbc_inference
%python_expand %fdupes %{buildroot}%{$python_sitearch}

%files %{python_files}
%python2_only %{_bindir}/*