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
# 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.*