# Get it
cd
test -f installed/xvidcore-1.3.5.tar.bz2 &&
mv installed/xvidcore-1.3.5.tar.bz2
test ! -f xvidcore-1.3.5.tar.bz2 &&
wget https://downloads.xvid.com/downloads/xvidcore-1.3.5.tar.bz2
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "xvidcore-*" -exec rm -r {} \;
tar xjvf ~/xvidcore-1.3.5.tar.bz2
mv xvidcore xvidcore-1.3.5
cd xvidcore-1.3.5
test $UID = 0 && chown -R root:root .
cd build/generic
# Configure the build for 64-bit
./configure --libdir=/usr/local/lib64
# Configure the build for anything else
./configure
# Build it
make
# Become root to install it
su
# Remove old shared library files
rm -f /usr/local/lib/libxvidcore.*
# Install it
make install
ldconfig
# Become your non-root user again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/xvidcore-*.tar.*
mv xvidcore-1.3.5.tar.bz2 installed/
# If you ever want to uninstall Xvid, this should do it:
su
rm -f /usr/local/lib*/libxvidcore.* \
/usr/local/include/xvid.h
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "xvidcore-*" -exec rm -r {} \;
rm -f ~/installed/xvidcore-*.tar.*