-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathpython-sbank.spec
149 lines (125 loc) · 4.21 KB
/
python-sbank.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
%define srcname sbank
%define version 1.0.6
%define release 1
# -- src.rpm metadata -------
Name: python-%{srcname}
Version: %{version}
Release: %{release}%{?dist}
Summary: A stochastic gravitational-wave template bank placement library
License: GPLv2+
Url: https://github.com/gwastro/sbank
Source0: %pypi_source
Packager: Duncan Macleod <duncan.macleod@ligo.org>
Vendor: Duncan Macleod <duncan.macleod@ligo.org>
Prefix: %{_prefix}
# -- requirements -----------
# build dependencies
BuildRequires: gcc
BuildRequires: liblal-devel
BuildRequires: python3-devel
BuildRequires: python3-Cython
BuildRequires: python3dist(numpy)
BuildRequires: python3dist(setuptools) >= 30.3.0
# runtime dependencies (required for %check and help2man)
BuildRequires: help2man
BuildRequires: lalapps
BuildRequires: python3-lal
BuildRequires: python3-lalsimulation
BuildRequires: python3-ligo-lw-bin
BuildRequires: python3dist(h5py)
BuildRequires: python3dist(lscsoft-glue)
BuildRequires: python3dist(matplotlib)
BuildRequires: python3dist(scipy)
BuildRequires: python3dist(six)
# testing dependencies (required for %check)
%if 0%{?rhel} == 0 || 0%{?rhel} >= 9
BuildRequires: python3dist(pytest) >= 3.9.1
%endif
# -- src rpm ----------------
%description
Sbank is a library for generating a template bank for compact binary searches
covering a given region of mass and spin parameter space.
The program can support all waveform approximants available in the
lalsimulation suite. Currently implemented waveforms can be found with
`sbank --help` and others added with only minor additions.
Sbank has been developed collaboratively by a diverse group of LIGO scientists
starting in 2012, and has been split off from the larger `lalsuite` package as
a standalone module in 2021.
Sbank has been used to generate template banks for the separate GstLAL, MBTA,
PyCBC and SPIIR analysis codes.
Sbank also offers support for generating precessing and/or higher-order mode
template banks.
# -- packages ---------------
%package -n %{srcname}
Summary: Command-line utilities for Sbank
BuildArch: noarch
Requires: lalapps
Requires: python3-%{srcname} = %{version}-%{release}
Requires: python3-lal
Requires: python3-lalsimulation
Requires: python3-ligo-lw-bin
Requires: python3dist(h5py)
Requires: python3dist(lscsoft-glue)
Requires: python3dist(matplotlib)
Requires: python3dist(numpy)
Requires: python3dist(scipy)
Requires: python3dist(six)
%description -n %{srcname}
Sbank provides a library for generating template banks of compact binary
mergers for gravitational-wave searches using the "stochastic" placement
algorithm.
The package provides the command-line utilities.
%package -n python3-%{srcname}
Summary: Python %{python3_version} library for Sbank
Requires: python3-lal
Requires: python3-lalsimulation
Requires: python3dist(lscsoft-glue)
Requires: python3dist(numpy)
Requires: python3dist(six)
%description -n python3-%{srcname}
Sbank provides a library for generating template banks of compact binary
mergers for gravitational-wave searches using the "stochastic" placement
algorithm.
The package provides the Python %{python3_version} library.
# -- build steps ------------
%prep
%autosetup -n %{srcname}-%{version}
%build
%py3_build
%check
mkdir -p _tests
cd _tests
export PATH="%{buildroot}%{_bindir}:${PATH}"
export PYTHONPATH="%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}:${PYTHONPATH}"
%if 0%{?rhel} == 0 || 0%{?rhel} >= 9
%{__python3} -m pytest --color=yes --pyargs %{srcname}
%endif
sbank --help
%install
%py3_install
# generate man pages with help2man
mkdir -p %{buildroot}%{_mandir}/man1
export PYTHONPATH="%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}:${PYTHONPATH}"
ls %{buildroot}%{_bindir}/ | xargs --verbose -I @ \
help2man \
--output %{buildroot}%{_mandir}/man1/@.1 \
--no-info \
--no-discard-stderr \
--section 1 \
--source %{srcname} \
--version-string %{version} \
%{buildroot}%{_bindir}/@
# -- files ------------------
%files -n %{srcname}
%license COPYING
%doc README.md
%{_bindir}/*
%{_mandir}/man1/*
%files -n python3-%{srcname}
%license COPYING
%doc README.md
%{python3_sitearch}/*
# -- changelog --------------
%changelog
* Fri May 21 2021 Duncan Macleod <duncan.macleod@ligo.org> - 0.0.2-1
- first build for 0.0.2