# Get the tarball
cd
test -f installed/kvazaar-2.2.0.tar.xz &&
mv -f installed/kvazaar-2.2.0.tar.xz .
test ! -f kvazaar-2.2.0.tar.xz &&
wget https://github.com/ultravideo/kvazaar/releases/download/v2.2.0/\
kvazaar-2.2.0.tar.xz
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "kvazaar-*" -exec rm -r {} \;
tar xJvf ~/kvazaar-2.2.0.tar.xz
cd kvazaar-2.2.0
test $UID = 0 && chown -R root:root .
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --docdir=/usr/local/doc/kvazaar --libdir=/usr/local/lib64 \
--mandir=/usr/local/man
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --docdir=/usr/local/doc/kvazaar --mandir=/usr/local/man
# Build it
make
# Check the build
make check
# Become root to install it
su
# Install it
make install
ldconfig
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+rwx .
# Become your non-root user again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/kvazaar-*.tar.*
mv -f kvazaar-2.2.0.tar.xz installed/
# If you ever want to uninstall kvazaar, this should do it:
cd
su
test -d src/kvazaar-* && ( cd src/kvazaar-* ; make uninstall )
test -d /usr/local/doc/kvazaar && rm -r /usr/local/doc/kvazaar
rm -f /usr/local/bin/kvazaar /usr/local/include/kvazaar.h \
/usr/local/lib*/libkvazaar.* /usr/local/lib*/pkgconfig/kvazaar.pc \
/usr/local/man/man1/kvazaar.1
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "kvazaar-*" -exec rm -r {} \;
rm -f ~/installed/kvazaar-*.tar.*