| |
@@ -12,6 +12,9 @@
|
| |
# https://github.com/chlubba/catch22/wiki/Installation-and-Testing#r says that is to be preferred
|
| |
# https://github.com/hendersontrent/Rcatch22
|
| |
|
| |
+ # Downstream .so version; see comment above Source2, and make sure to increment
|
| |
+ # the following integer each time there is an ABI change upstream.
|
| |
+ %global downstream_so_number 1
|
| |
Name: catch22
|
| |
Version: 0.4.0
|
| |
Release: %autorelease
|
| |
@@ -28,6 +31,10 @@
|
| |
Source1: compare_output
|
| |
# Hand-written for Fedora in groff_man(7) format based on --help text
|
| |
Source2: run_features.1
|
| |
+ # Upstream does not provide any build system at all. This Makefile allows us to
|
| |
+ # build a shared library and link the run_features executable to it. We must
|
| |
+ # therefore use downstream .so versioning.
|
| |
+ Source3: Makefile
|
| |
|
| |
# Backport upstream commit 135fb01bbd71c98fea01a7a2612abdca531b44f6 “Python
|
| |
# version numbering fixed”
|
| |
@@ -38,6 +45,7 @@
|
| |
# https://github.com/DynamicsAndNeuralSystems/catch22/issues/27
|
| |
Patch: %{url}/commit/135fb01bbd71c98fea01a7a2612abdca531b44f6.patch
|
| |
|
| |
+ BuildRequires: make
|
| |
BuildRequires: gcc
|
| |
BuildRequires: python3-devel
|
| |
|
| |
@@ -63,8 +71,35 @@
|
| |
For catch22-related information and resources, including a list of publications
|
| |
using catch22, see the catch22 wiki (https://github.com/chlubba/catch22/wiki).}
|
| |
|
| |
+ Requires: %{name}-libs = %{version}-%{release}
|
| |
+
|
| |
%description %_description
|
| |
|
| |
+ This package contains the command-line tool run_features.
|
| |
+
|
| |
+
|
| |
+ %package libs
|
| |
+ Summary: %{summary}
|
| |
+ # See the comment above the base package License field
|
| |
+ License: GPL-3.0-only
|
| |
+
|
| |
+ %description libs %{_description}
|
| |
+
|
| |
+ This package contains the implementation compiled as a shared library.
|
| |
+
|
| |
+
|
| |
+ %package devel
|
| |
+ Summary: %{summary}
|
| |
+ # See the comment above the base package License field
|
| |
+ License: GPL-3.0-only
|
| |
+
|
| |
+ Requires: %{name}-libs = %{version}-%{release}
|
| |
+
|
| |
+ %description devel %{_description}
|
| |
+
|
| |
+ This package contains headers and other files required for developing
|
| |
+ applications that link against the implementation as a shared library.
|
| |
+
|
| |
|
| |
%if %{with Py}
|
| |
%package -n python3-%{name}
|
| |
@@ -94,6 +129,7 @@
|
| |
|
| |
%prep
|
| |
%autosetup -p1
|
| |
+ cp -p '%{SOURCE3}' C/
|
| |
find . -name ".gitignore" -print -delete
|
| |
|
| |
%if %{with Py}
|
| |
@@ -119,35 +155,8 @@
|
| |
|
| |
|
| |
%build
|
| |
- pushd C
|
| |
%set_build_flags
|
| |
- # https://github.com/chlubba/catch22/wiki/Installation-and-Testing
|
| |
- "${CC-gcc}" ${CFLAGS} -o run_features \
|
| |
- main.c \
|
| |
- CO_AutoCorr.c \
|
| |
- DN_HistogramMode_10.c \
|
| |
- DN_HistogramMode_5.c \
|
| |
- DN_OutlierInclude.c \
|
| |
- FC_LocalSimple.c \
|
| |
- IN_AutoMutualInfoStats.c \
|
| |
- MD_hrv.c \
|
| |
- PD_PeriodicityWang.c \
|
| |
- SB_BinaryStats.c \
|
| |
- SB_CoarseGrain.c \
|
| |
- SB_MotifThree.c \
|
| |
- SB_TransitionMatrix.c \
|
| |
- SC_FluctAnal.c \
|
| |
- SP_Summaries.c \
|
| |
- DN_Mean.c \
|
| |
- DN_Spread_Std.c \
|
| |
- butterworth.c \
|
| |
- fft.c \
|
| |
- helper_functions.c \
|
| |
- histcounts.c \
|
| |
- splinefit.c \
|
| |
- stats.c \
|
| |
- ${LDFLAGS} -lm
|
| |
- popd
|
| |
+ %make_build -C C DOWNSTREAM_SO_NUMBER='%{downstream_so_number}'
|
| |
|
| |
%if %{with Py}
|
| |
pushd wrap_Python
|
| |
@@ -161,9 +170,12 @@
|
| |
|
| |
|
| |
%install
|
| |
- pushd C
|
| |
- install -p -m 0755 run_features -Dt %{buildroot}/%{_bindir}
|
| |
- popd
|
| |
+ %make_install -C C \
|
| |
+ DOWNSTREAM_SO_NUMBER='%{downstream_so_number}' \
|
| |
+ PREFIX='%{_prefix}' \
|
| |
+ INCLUDEDIR='%{_includedir}' \
|
| |
+ LIBDIR='%{_libdir}' \
|
| |
+ BINDIR='%{_bindir}'
|
| |
install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE2}'
|
| |
|
| |
%if %{with Py}
|
| |
@@ -181,7 +193,9 @@
|
| |
%check
|
| |
find testData -type f -name '*_output.txt' \
|
| |
-execdir cp -v -p '{}' '{}.expected' ';'
|
| |
- PATH="${PATH}:%{buildroot}%{_bindir}" ./testData/runtests.sh
|
| |
+ env LD_LIBRARY_PATH='%{buildroot}%{_libdir}' \
|
| |
+ PATH="${PATH}:%{buildroot}%{_bindir}" \
|
| |
+ ./testData/runtests.sh
|
| |
|
| |
for x in testData/*.expected
|
| |
do
|
| |
@@ -213,12 +227,23 @@
|
| |
|
| |
|
| |
%files
|
| |
- %license LICENSE
|
| |
- %doc README.md featureList.txt
|
| |
%{_bindir}/run_features
|
| |
%{_mandir}/man1/run_features.1*
|
| |
|
| |
|
| |
+ %files libs
|
| |
+ %license LICENSE
|
| |
+
|
| |
+ %{_libdir}/lib%{name}.so.0.%{downstream_so_number}
|
| |
+
|
| |
+
|
| |
+ %files devel
|
| |
+ %doc README.md featureList.txt
|
| |
+
|
| |
+ %{_includedir}/%{name}/
|
| |
+ %{_libdir}/lib%{name}.so
|
| |
+
|
| |
+
|
| |
%if %{with Py}
|
| |
%files -n python3-%{name} -f %{pyproject_files}
|
| |
%license LICENSE
|
| |
Upstream has started to maintain the Python bindings as a separate repository, and the Python package name has changed:
https://github.com/DynamicsAndNeuralSystems/pycatch22
https://pypi.org/project/pycatch22/
Building a shared library should allow us to create a new
python-pycatch22
package with the catch22 implementation unbundled.