Name: kaldi-lookahead Version: 1.8.0 Release: 1%{?dist} Summary: Speech Recognition Toolkit License: ASL 2.0 URL: https://github.com/alphacep/kaldi Source0: kaldi-lookahead-1.8.0.tar.gz Group: System/Libraries %define libname %mklibname %{name} %define develname %mklibname %{name} -d %global __brp_check_rpaths %nil BuildRequires: openfst-devel BuildRequires: openblas-devel Requires: openfst Requires: openblas Patch0: kaldi-avoid-failing-check-on-openfst-version.patch Patch1: kaldi-allow-standard-libs-not-openfst.patch %description Kaldi is a toolkit for speech recognition, intended for use by speech recognition researchers and professionals. %package -n %{libname} Summary: Main library for kaldi Group: System/Libraries Provides: %{name} = %{version}-%{release} %description -n %{libname} This package contains the library needed to run programs dynamically linked with kaldi %package -n %{develname} Summary: Headers for kaldi Group: Development/C++ Requires: %{libname} = %{version} Provides: %{name}-devel = %{version}-%{release} %description -n %{develname} This package contains headers for developing programs that will use kaldi %prep %autosetup -p1 %build pushd src %ifarch x86_64 aarch64 sed -i -e "s/OPENFSTLIBS=\"\$FSTROOT\/lib\/libfst.a\"/OPENFSTLIBS=\"\$FSTROOT\/%{_lib}\/libfst.a\"/g" configure sed -i -e "s/OPENFSTLIBS=\"\$FSTROOT\/lib\/libfst.so\"/OPENFSTLIBS=\"\$FSTROOT\/%{_lib}\/libfst.so\"/g" configure sed -i -e "s/CXXFLAGS = -std=c++17 -I.. -isystem \$(OPENFSTINC)/CXXFLAGS = -std=c++17 -I.. -idirafter \$(OPENFSTINC)/g" makefiles/linux_openblas_aarch64.mk %endif ./configure --mathlib=OPENBLAS --shared --use-cuda=no --openblas-root=/usr --fst-root=/usr %ifarch %ix86 sed -i 's:-msse -msse2:-msse -msse2 -mfpmath=sse:g' kaldi.mk %endif sed -i 's: -O1 : -O3 :g' kaldi.mk %make_build online2 lm rnnlm popd %install mkdir -p %{buildroot}/%{_libdir} cp src/base/libkaldi-base.so %{buildroot}/%{_libdir}/libkaldi-base.so cp src/chain/libkaldi-chain.so %{buildroot}/%{_libdir}/libkaldi-chain.so cp src/cudamatrix/libkaldi-cudamatrix.so %{buildroot}/%{_libdir}/libkaldi-cudamatrix.so cp src/decoder/libkaldi-decoder.so %{buildroot}/%{_libdir}/libkaldi-decoder.so cp src/feat/libkaldi-feat.so %{buildroot}/%{_libdir}/libkaldi-feat.so cp src/fstext/libkaldi-fstext.so %{buildroot}/%{_libdir}/libkaldi-fstext.so cp src/gmm/libkaldi-gmm.so %{buildroot}/%{_libdir}/libkaldi-gmm.so cp src/hmm/libkaldi-hmm.so %{buildroot}/%{_libdir}/libkaldi-hmm.so cp src/ivector/libkaldi-ivector.so %{buildroot}/%{_libdir}/libkaldi-ivector.so cp src/lat/libkaldi-lat.so %{buildroot}/%{_libdir}/libkaldi-lat.so cp src/lm/libkaldi-lm.so %{buildroot}/%{_libdir}/libkaldi-lm.so cp src/matrix/libkaldi-matrix.so %{buildroot}/%{_libdir}/libkaldi-matrix.so cp src/nnet2/libkaldi-nnet2.so %{buildroot}/%{_libdir}/libkaldi-nnet2.so cp src/nnet3/libkaldi-nnet3.so %{buildroot}/%{_libdir}/libkaldi-nnet3.so cp src/online2/libkaldi-online2.so %{buildroot}/%{_libdir}/libkaldi-online2.so cp src/rnnlm/libkaldi-rnnlm.so %{buildroot}/%{_libdir}/libkaldi-rnnlm.so cp src/transform/libkaldi-transform.so %{buildroot}/%{_libdir}/libkaldi-transform.so cp src/tree/libkaldi-tree.so %{buildroot}/%{_libdir}/libkaldi-tree.so cp src/util/libkaldi-util.so %{buildroot}/%{_libdir}/libkaldi-util.so mkdir -p %{buildroot}/%{_includedir} mkdir -p %{buildroot}/%{_includedir}/base mkdir -p %{buildroot}/%{_includedir}/chain mkdir -p %{buildroot}/%{_includedir}/cudamatrix mkdir -p %{buildroot}/%{_includedir}/decoder mkdir -p %{buildroot}/%{_includedir}/feat mkdir -p %{buildroot}/%{_includedir}/fstext mkdir -p %{buildroot}/%{_includedir}/gmm mkdir -p %{buildroot}/%{_includedir}/hmm mkdir -p %{buildroot}/%{_includedir}/ivector mkdir -p %{buildroot}/%{_includedir}/lat mkdir -p %{buildroot}/%{_includedir}/lm mkdir -p %{buildroot}/%{_includedir}/matrix mkdir -p %{buildroot}/%{_includedir}/nnet2 mkdir -p %{buildroot}/%{_includedir}/nnet3 mkdir -p %{buildroot}/%{_includedir}/online2 mkdir -p %{buildroot}/%{_includedir}/rnnlm mkdir -p %{buildroot}/%{_includedir}/transform mkdir -p %{buildroot}/%{_includedir}/tree mkdir -p %{buildroot}/%{_includedir}/util mkdir -p %{buildroot}/%{_includedir}/itf cp src/base/*.h %{buildroot}/%{_includedir}/base/ cp src/chain/*.h %{buildroot}/%{_includedir}/chain/ cp src/cudamatrix/*.h %{buildroot}/%{_includedir}/cudamatrix/ cp src/decoder/*.h %{buildroot}/%{_includedir}/decoder/ cp src/feat/*.h %{buildroot}/%{_includedir}/feat/ cp src/fstext/*.h %{buildroot}/%{_includedir}/fstext/ cp src/gmm/*.h %{buildroot}/%{_includedir}/gmm/ cp src/hmm/*.h %{buildroot}/%{_includedir}/hmm/ cp src/ivector/*.h %{buildroot}/%{_includedir}/ivector/ cp src/lat/*.h %{buildroot}/%{_includedir}/lat/ cp src/lm/*.h %{buildroot}/%{_includedir}/lm/ cp src/matrix/*.h %{buildroot}/%{_includedir}/matrix/ cp src/nnet2/*.h %{buildroot}/%{_includedir}/nnet2/ cp src/nnet3/*.h %{buildroot}/%{_includedir}/nnet3/ cp src/online2/*.h %{buildroot}/%{_includedir}/online2/ cp src/rnnlm/*.h %{buildroot}/%{_includedir}/rnnlm/ cp src/transform/*.h %{buildroot}/%{_includedir}/transform/ cp src/tree/*.h %{buildroot}/%{_includedir}/tree/ cp src/util/*.h %{buildroot}/%{_includedir}/util/ cp src/itf/*.h %{buildroot}/%{_includedir}/itf %files -n %{libname} %license COPYING %doc README.md %{_libdir}/libkaldi-base.so %{_libdir}/libkaldi-chain.so %{_libdir}/libkaldi-cudamatrix.so %{_libdir}/libkaldi-decoder.so %{_libdir}/libkaldi-feat.so %{_libdir}/libkaldi-fstext.so %{_libdir}/libkaldi-gmm.so %{_libdir}/libkaldi-hmm.so %{_libdir}/libkaldi-ivector.so %{_libdir}/libkaldi-lat.so %{_libdir}/libkaldi-lm.so %{_libdir}/libkaldi-matrix.so %{_libdir}/libkaldi-nnet2.so %{_libdir}/libkaldi-nnet3.so %{_libdir}/libkaldi-online2.so %{_libdir}/libkaldi-rnnlm.so %{_libdir}/libkaldi-transform.so %{_libdir}/libkaldi-tree.so %{_libdir}/libkaldi-util.so %files -n %{develname} %{_includedir}/*/*.h %changelog * Sun Jul 18 10:10:03 CEST 2021 Papoteur - first submission