# libsrs2 1.0.18
# ==============
# Get the source
cd
test -f installed/libsrs2-1.0.18.tar.gz &&
mv -if installed/libsrs2-1.0.18.tar.gz .
test ! -f libsrs2-1.0.18.tar.gz &&
wget https://www.libsrs2.org/srs/libsrs2-1.0.18.tar.gz
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -name "libsrs2-*" -exec rm -r {} \;
tar xzvf ~/libsrs2-1.0.18.tar.gz
cd libsrs2-1.0.18
test $UID = 0 && chown -R root:root .
# Configure it for 64-bit
test $(uname -m) = 'x86_64' && ./configure --libdir=/usr/local/lib64
# Configure it for anything else
test $(uname -m) != 'x86_64' && ./configure
# Build it
make
# Check the build
make check
# Become root to install it
su
# 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/libsrs2-*.tar.gz
mv -f libsrs2-1.0.18.tar.gz installed/
# If you ever want to uninstall libsrs2, this should do it:
cd
su
test -d src/libsrs2-* && ( cd src/libsrs2-* ; make uninstall )
rm -f /usr/local/bin/srs \
/usr/local/include/srs2.h \
/usr/local/lib*/libsrs2.*
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "libsrs2-*" -exec rm -r {} \;
rm -f ~/installed/libsrs2-*.tar.*