Building opus-tools from git on Fedora

I put together a quick SRPM for building opus-tools from the github master. The source RPM is here: opus-tools-master-git.src.rpm. To use:

    # Unpack the sources
    rpm -ihv opus-tools-master-git.src.rpm
    
    # Optionally update to the latest from github
    cd ~/rpmbuild/SOURCES
    wget https://github.com/xiph/opus-tools/archive/refs/heads/master.zip
    
    # Build the rpms
    cd ~/rpmbuild/SPECS
    rpmbuild -ba opus-tools.spec
    
    # Install the generated rpm
    sudo dnf install ~/rpmbuild/RPMS/$(arch)/opus-tools-master-git.$(arch).rpm

Additionally, you’ll probably want to add exclude=opus-tools to /etc/dnf/dnf.conf to prevent dnf from trying to “upgrade” you back to the system-provided opus-tools.

There’s a small change to the .spec file to use the latest source download from github, and there’s a small patch to configure.ac to correctly find libm. That’s it!