Here's how I did it.
Install the source rpm:
Code:
$ yumdownloader --source sox
$ rpm -ivh sox-14.3.1-3.fc14.src.rpm
This will install the contents of the source rpm in %_topdir (which by default, for regular users, is ~/rpmbuild/). It will expand into %{_topdir}/SOURCES,SPECS,BUILD,RPMS,SRPMS (you may not have all these yet).
Open SPECS/sox.spec in a text editor. Change this line:
Code:
CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64" %configure --with-dyn-default --with-gsm --includedir=%{_includedir}/sox --disable-static --with-distro=Fedora
To this:
Code:
CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64" %configure --with-dyn-default --with-mp3 --with-gsm --includedir=%{_includedir}/sox --disable-static --with-distro=Fedora
Notice the addition of --with-mp3.
You'll probably also want to change the Release, to distinguish your rpm from the stock version. For instance:
Code:
Release: 3_1jrummy%{?dist}
Save that file.
Take note of leigh's comment about the devel rpms that need to be installed. The next command will fail without them. In addition, you need these installed:
libvorbis-devel
alsa-lib-devel
libtool-ltdl-devel
libsamplerate-devel
gsm-devel
wavpack-devel
ladspa-devel
libpng-devel
flac-devel
libao-devel
libsndfile-devel
libid3tag-devel
libtool
Now lets build the rpm for your arch (replace x86_64 with yours):
Code:
$ rpmbuild -bb --target=x86_64 SPECS/sox.spec
This will put an rpm in the RPMS directory. Install it, and see if it supports mp3 now.