forked from gwastro/sbank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython-sbank.spec
158 lines (132 loc) · 4.93 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
150
151
152
153
154
155
156
157
158
%define srcname sbank
%define version 1.0.1
%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 <[email protected]>
Vendor: Duncan Macleod <[email protected]>
Prefix: %{_prefix}
# -- requirements -----------
# rpmbuild dependencies
BuildRequires: python-srpm-macros
BuildRequires: python-rpm-macros
BuildRequires: python3-rpm-macros
# build dependencies
BuildRequires: gcc
BuildRequires: liblal-devel
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-Cython
BuildRequires: python%{python3_pkgversion}-numpy
BuildRequires: python%{python3_pkgversion}-setuptools >= 30.3.0
# runtime dependencies (required for %check and help2man)
BuildRequires: help2man
BuildRequires: lalapps
BuildRequires: python%{python3_pkgversion}-glue
BuildRequires: python%{python3_pkgversion}-h5py
BuildRequires: python%{python3_pkgversion}-lal
BuildRequires: python%{python3_pkgversion}-lalsimulation
BuildRequires: python%{python3_pkgversion}-ligo-lw-bin
BuildRequires: python%{python3_pkgversion}-matplotlib
BuildRequires: python%{python3_pkgversion}-scipy
BuildRequires: python%{python3_pkgversion}-six
# testing dependencies (required for %check)
%if 0%{?rhel} == 0 || 0%{?rhel} >= 9
BuildRequires: python%{python3_pkgversion}-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: python%{python3_pkgversion}-%{srcname} = %{version}-%{release}
Requires: python%{python3_pkgversion}-glue
Requires: python%{python3_pkgversion}-h5py
Requires: python%{python3_pkgversion}-lal
Requires: python%{python3_pkgversion}-lalsimulation
Requires: python%{python3_pkgversion}-ligo-lw-bin
Requires: python%{python3_pkgversion}-matplotlib
Requires: python%{python3_pkgversion}-numpy
Requires: python%{python3_pkgversion}-scipy
Requires: python%{python3_pkgversion}-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 python%{python3_pkgversion}-%{srcname}
Summary: Python %{python3_version} library for Sbank
Requires: python%{python3_pkgversion}-glue
Requires: python%{python3_pkgversion}-lal
Requires: python%{python3_pkgversion}-lalsimulation
Requires: python%{python3_pkgversion}-numpy
Requires: python%{python3_pkgversion}-six
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
%description -n python%{python3_pkgversion}-%{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 elp2man
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}/@
%clean
rm -rf $RPM_BUILD_ROOT
# -- files ------------------
%files -n %{srcname}
%license COPYING
%doc README.md
%{_bindir}/*
%{_mandir}/man1/*
%files -n python%{python3_pkgversion}-%{srcname}
%license COPYING
%doc README.md
%{python3_sitearch}/*
# -- changelog --------------
%changelog
* Fri May 21 2021 Duncan Macleod <[email protected]> - 0.0.2-1
- first build for 0.0.2