Skip to main content

Build libopus RPMs for CentOS 7

This procedure will build RPMs for both libopus and libopus-devel. This was initially written for version 1.1.1 but in fact by updating the version number has been tested until 1.1.3.

Use a opus.spec file like (note the version appears twice):

Name:          opus
Version: 1.1.1
Release: 2%{?dist}
Summary: An audio codec for use in low-delay speech and audio communication
Group: System Environment/Libraries
License: BSD
Source0: opus-1.1.1.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

The Opus codec is designed for interactive speech and audio transmission over
the Internet. It is designed by the IETF Codec Working Group and incorporates
technology from Skype's SILK codec and Xiph.Org's CELT codec.

%package devel
Summary: Development package for opus
Group: Development/Libraries
Requires: libogg-devel
Requires: opus = %{version}-%{release}

%description devel
Files for development with opus.


%setup -q -n %{name}-%{version}


%configure --enable-custom-modes --disable-static
make %{?_smp_mflags} V=1

rm -rf %{buildroot}
make install DESTDIR=%{buildroot}

# Remove libtool archives and static libs
find %{buildroot} -type f -name "*.la" -delete
rm -rf %{buildroot}%{_datadir}/doc/opus/html

make check

rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files devel



yum install -y rpmdevtools libogg-devel gcc make wget
cd ~/rpmbuild/SOURCES
# Check the right version
# Check the right version
cp opus.spec ~/rpmbuild/SPECS/opus.spec
cd ~/rpmbuild/SPECS
rpmbuild -v -bb opus.spec

RPMs will be in ~/rpmbuild/RPMS/x86_64/

Have libopus-devel installed where FreeSWITCH is built, and only libopus outside of a development environment.