# Conditionals for different bindings %bcond_without Py # Only supports Matlab at the moment # https://github.com/chlubba/catch22/issues/12 %bcond_with octave # Package native R package separately: # https://github.com/chlubba/catch22/wiki/Installation-and-Testing#r says that is to be preferred # https://github.com/hendersontrent/Rcatch22 %global forgeurl https://github.com/chlubba/catch22 %global _description %{expand: \ catch22 is a collection of 22 time-series features coded in C that can be run from Python, R, Matlab, and Julia. The catch22 features are a high-performing subset of the over 7000 features in hctsa. Features were selected based on their classification performance across a collection of 93 real-world time-series classification problems, as described in our open-access paper: - Lubba et al. (2019). catch22: CAnonical Time-series CHaracteristics (https://doi.org/10.1007/s10618-019-00647-x) The computational pipeline used to generate the catch22 feature set is in the op_importance(https://github.com/chlubba/op_importance) repository. For catch22-related information and resources, including a list of publications using catch22, see the catch22 wiki (https://github.com/chlubba/catch22/wiki).} Version: 0.2.1 %forgemeta Name: catch22 Release: 2%{?dist} Summary: CAnonical Time-series CHaracteristics License: GPLv3 URL: %{forgeurl} Source0: %{forgesource} BuildRequires: gcc BuildRequires: python3-devel BuildRequires: python3-setuptools %description %_description %if %{with Py} %package -n python3-%{name} Summary: catch22 for Python License: GPLv3 %description -n python3-%{name} %_description %endif %if %{with octave} %global octpkg %{name} %package -n octave-%{name} License: GPLv3+ Summary: catch22 for Octave BuildRequires: octave-devel Requires: octave(api) = %{octave_api} Requires(post): octave Requires(postun): octave %description -n octave-%{name} %_description %endif %prep %{forgesetup} find . -name ".gitignore" -delete %if %{with Py} # Python pushd wrap_Python mv setup_P3.py setup.py popd %endif %if %{with octave} # Set up for Octave install echo "Does not yet support Octave." %endif %build pushd C # https://github.com/chlubba/catch22/wiki/Installation-and-Testing %set_build_flags 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 butterworth.c fft.c helper_functions.c histcounts.c splinefit.c stats.c $LDFLAGS -lm popd %if %{with Py} # Python pushd wrap_Python %py3_build popd %endif # octave %if %{with octave} echo "Does not yet support Octave." %endif %install # C pushd C install -p -m 0755 run_features -Dt %{buildroot}/%{_bindir} popd %if %{with Py} # Python pushd wrap_Python %py3_install popd %endif # octave %if %{with octave} echo "Does not yet support Octave." %endif %check pushd testData %{buildroot}/%{_bindir}/run_features test.txt test_output_mock.txt %{buildroot}/%{_bindir}/run_features test2.txt test2_output_mock.txt # Compare first two columns of test{,2}_output_mock.txt with test{,2}_output.txt # https://github.com/chlubba/catch22/wiki/Installation-and-Testing#testing for afile in test{,2}_output{,_mock}.txt do cut -d ',' -f 1,2 "$afile" > "$afile".new done # A few lines differ in the exact values, so we don't make the build fail for these diff -u test_output{,_mock}.txt.new || exit 0 diff -u test2_output{,_mock}.txt.new || exit 0 popd %if %{with Py} pushd wrap_Python PYTHONPATH=%{buildroot}/%{python3_sitearch} %{__python3} testing.py popd %endif %if %{with octave} %post %octave_cmd pkg rebuild %preun %octave_pkg_preun %postun %octave_cmd pkg rebuild %endif %files %license LICENSE %doc README.md featureList.txt %{_bindir}/run_features %if %{with Py} %files -n python3-%{name} %license LICENSE %doc README.md featureList.txt %{python3_sitearch}/%{name}-0.1.0-py%{python3_version}.egg-info %{python3_sitearch}/%{name} %{python3_sitearch}/%{name}_C.cpython-%{python3_version_nodots}-%{python3_platform_triplet}.so %endif %if %{with octave} %files -n octave-%{name} %license LICENSE %doc featureList.txt %{octpkglibdir} %dir %{octpkgdir} %{octpkgdir}/*.m %doc %{octpkgdir}/doc-cache %{octpkgdir}/packinfo %endif %changelog * Wed Jan 19 2022 Fedora Release Engineering - 0.2.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Tue Aug 10 2021 Ankur Sinha - 0.2.1-1 - Correct location of LDFLAGS - Move linker flags to end * Mon Aug 09 2021 Ankur Sinha - 0.2.1-1 - Add sub-package specific licenses - Add LDFLAGS - Preserve time stamps - Remove R sub-package: package Rcatch22 separately - Run python test - Add basic C test * Thu Jul 08 2021 Ankur Sinha - 0.2.1-1 - Initial build