Linux HOWTOs

About | Home | Search


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

HOWTO: flac
Description: Free lossless audio codec
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


# FLAC 1.2.1
# ==========
# Some apps/libs (that I have howtos for) that use FLAC are:
# audacity
# gstreamer
# muine
# rhythmbox
# SDL
# xine

# Slackware 9.0, 9.1, and 10.0's 'flac' packages include version 1.1.0,
# 10.1's includes 1.1.1, 10.2, 11.0, and 12.0's include 1.1.2

# If you ever want to uninstall FLAC, or just remove files from an old
# version before installing a new one, skip down to the bottom for
# instructions.

# Prerequisites:
# doxygen
# xmms >= 0.9.5.1
# libogg
# iconv
# docbook2man (Slackware includes this in sgml-tools/linuxdoc-tools)
# nasm

# Below, I blow away any files that may be left over from previous versions.
# If you run a multi-user system where an application that is linked against
# one of the libraries, you may want to skip that part and clean up old
# files manually.
#
# Also, if you do this and you upgrade a major version, and libFLAC.so.4
# used to be there, but libFLAC.so.7 is what's there now, anything that was
# dynamically linked against .4 will stop working until you rebuild it (or
# symlink .7 to .4, which isn't always good enough).

cd
test -f installed/flac-1.2.1.tar.gz && mv installed/flac-1.2.1.tar.gz .
test ! -f flac-1.2.1.tar.gz &&
 wget http://download.sf.net/flac/flac-1.2.1.tar.gz

# Verify tarball w/ md5sum:
echo "153c8b15a54da428d1f0fadc756c22c7  flac-1.2.1.tar.gz" | md5sum -c

# Verify tarball w/ sha1sum:
echo "bd54354900181b59db3089347cc84ad81e410b38  flac-1.2.1.tar.gz" | \
 sha1sum -c

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "flac-*" -exec rm -r {} \;
tar xzvf ~/flac-1.2.1.tar.gz
cd flac-1.2.1
test $UID = 0 && chown -R root:root .
chmod -R u+w .
./configure --prefix=/usr
make

# Become root to install it
su

# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg flac

find /usr/doc /usr/share/doc -maxdepth 1 -type d -name "flac-*" \
 -exec rm -r {} \;
test -d /usr/include/FLAC && rm -r /usr/include/FLAC
test -d /usr/include/FLAC++ && rm -r /usr/include/FLAC++
( cd /usr/lib ; rm -f libFLAC++.* libFLAC.* libOggFLAC++.* libOggFLAC.* )
make install
ldconfig
chmod -R u+w .

# Become yourself again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/flac-*.tar.*
mv flac-1.2.1.tar.gz installed/


# If you ever want to uninstall FLAC, this should do it:
cd
su
test -d src/flac-* && ( cd src/flac-* ; make uninstall )
find /usr/doc /usr/share/doc -maxdepth 1 -type d -name "flac-*" \
 -exec rm -r {} \;
( cd /usr/bin ; rm -f flac metaflac )
test -d /usr/include/FLAC && rm -r /usr/include/FLAC
test -d /usr/include/FLAC++ && rm -r /usr/include/FLAC++
( cd /usr/lib ; rm -f libFLAC.* libFLAC++.* )
( cd /usr/lib/pkgconfig ; rm -f flac.pc flac++.pc )
( cd /usr/man/man1 ; rm -f flac.1 metaflac.1 )
( cd /usr/share/aclocal ; libFLAC.m4 libFLAC++.m4 )
rm -f /usr/lib/xmms/Input/libxmms-flac.*
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "flac-*" -exec rm -r {} \;
rm -f ~/installed/flac-*.tar.*

Back to the list


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