# Generated by go2rpm 1.19.0 %bcond check 1 # https://git.sr.ht/~geb/numen %global goipath git.sr.ht/~geb/numen %global forgeurl https://git.sr.ht/~geb/numen Version: 0.7 %global tag 0.7 %global commit b5c3976beeb9bc07b668c76373be7af005d937f5 %gometa -L -f Name: numen Release: %autorelease Summary: Voice control for hands-free computing # Generated by go-vendor-tools License: AGPL-3.0-only AND Apache-2.0 AND GPL-3.0-only AND ISC AND MIT URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml # Explanation for this is in the patch description. Patch: 0001-Print-Fedora-specific-error-about-missing-model.patch BuildRequires: go-vendor-tools BuildRequires: scdoc # vendor/github.com/alphacep/vosk-api/go/vosk.go needs it. BuildRequires: vosk-api-devel # handler.go uses dotool. Requires: dotool # audio.go uses arecord from this. Requires: alsa-utils # handler.go uses them but CHANGELOG.md mentions them as optional. Recommends: (xdotool if xorg-x11-server-Xorg) Recommends: (xset if xorg-x11-server-Xorg) # scripts/menu uses it but CHANGELOG.md mentions it as optional. Recommends: (dmenu if xorg-x11-server-Xorg) # phrases/voice.phrases recommends wmenu instead of dmenu. Recommends: (dmenu-wayland if libwayland-client) # scripts use them. Requires: gawk Requires: procps-ng Requires: sed # A vosk model is needed to run numen and this tool allows # to download one to ~/.cache/vosk/ Recommends: ibus-speech-to-text %global _description %{expand: Numen is voice control for hands-free computing, letting you type efficiently by saying syllables and literal words. It works system-wide on Linux and the speech recognition runs locally. There's a short demonstration on: numenvoice.org} %description %{_description} %prep %goprep -p1 tar -xf %{S:1} %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %global gomodulesmode GO111MODULE=on # Following build.sh here. export GO_LDFLAGS="-X main.Version=%version" %gobuild -o %{gobuilddir}/bin/numen %{goipath} %install %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ # Just script, so no-manual-page-for-binary doesn't apply. install -m 0755 -vp numenc %{buildroot}%{_bindir}/ install -m 0755 -vd %{buildroot}%{_libexecdir}/%{name}/scripts install -m 0755 -vp scripts/* %{buildroot}%{_libexecdir}/%{name}/scripts/ install -m 0755 -vd %{buildroot}%{_sysconfdir}/%{name}/phrases install -m 0644 -vp phrases/*.phrases %{buildroot}%{_sysconfdir}/%{name}/phrases/ install -m 0755 -vd %{buildroot}%{_mandir}/man1 scdoc < doc/%{name}.1.scd > %{buildroot}%{_mandir}/man1/%{name}.1 # Following build.sh here. sed -i "s:/etc/numen/scripts:%{_libexecdir}/%{name}/scripts:g" \ "%{buildroot}%{_sysconfdir}/%{name}/phrases"/* \ "%{buildroot}%{_libexecdir}/%{name}/scripts"/* %check %go_vendor_license_check -c %{S:2} %if %{with check} %gotest ./... %endif %files -f %{go_vendor_license_filelist} %doc CHANGELOG.md README.md %config(noreplace) %{_sysconfdir}/%{name}/phrases/*.phrases %{_libexecdir}/%{name}/scripts %{_mandir}/man1/%{name}.1* %{_bindir}/%{name}{,c} %changelog %autochangelog