Linux HOWTOs

About | Home | Search


ERROR: Slooooow dooooown... this page load was delayed.

HOWTO: lame
Description: LAME Ain't an Mp3 Encoder
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# lame 3.97
# =========
# Prerequisites:
# ncurses
# libsndfile
# GTK+ >= 1.2.0 (for mp3x)
# mpg123 or mpg321
# nasm (optional)

cd
test -f installed/lame-3.97.tar.gz && mv installed/lame-3.97.tar.gz .
test ! -f lame-3.97.tar.gz &&
 wget http://download.sf.net/lame/lame-3.97.tar.gz
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "lame-*" -exec rm -r {} \;
tar xzvf ~/lame-3.97.tar.gz
cd lame-3.97
test $UID = 0 && chown -R root:root .

# Apply this patch so you can use recent versions of libsndfile.  AFAIK,
# without the patch, you'd have to use one that is at least a few years old.
wget -nc http://englanders.cc/pub/linux/patches/lame-3.97-sndfile.patch &&
 patch -p1 < lame-3.97-sndfile.patch
autoreconf -f -i

# If you want to build the GTK+-based frame analyzer (mp3x), pass
# --enable-mp3x to configure

./configure
make

# Become root to install it
su

# As configured above, the docs will go into /usr/local/share/doc
# If you don't want this, either start over again and pass --datadir=/usr
# to configure (making them go into /usr/doc), or do what I do and create
# a /usr/local/share/doc symlink that points to /usr/local/doc:
mkdir -p /usr/local/doc /usr/local/share
test -d /usr/local/share/doc && test ! -L /usr/local/share/doc &&
 mv -f /usr/local/share/doc/* /usr/local/doc/
test ! -L /usr/local/share/doc &&
 ln -sf /usr/local/doc /usr/local/share/doc

# Remove old shared libraries and install it
rm -f /usr/local/lib/libmp3lame.*
make install
ldconfig

# Become yourself again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/lame-*.tar.*
mv lame-3.97.tar.gz installed/


# If you ever need to uninstall lame, this should do it:
cd
su
test -d src/lame-3.97 && ( cd src/lame-3.97 ; make uninstall )
rm -f /usr/local/lib/libmp3lame.* /usr/local/man/man1/lame.1
( cd /usr/local/bin ; rm -f lame mp3x )
test -d /usr/doc/lame && rm -r /usr/doc/lame
test -d /usr/local/include/lame && rm -r /usr/local/include/lame
test -d /usr/local/share/doc/lame && rm -r /usr/local/share/doc/lame
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "lame-*" -exec rm -r {} \;
rm -f ~/installed/lame-*.tar.*

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>