# Get it
cd
test -f installed/CUnit-2.1-3.tar.bz2 && mv -f CUnit-2.1-3.tar.bz2 .
test ! -f CUnit-2.1-3.tar.bz2 &&
wget http://downloads.sf.net/cunit/CUnit-2.1-3.tar.bz2
# Extract the source
mkdir -p 0700 src
cd src
find -maxdepth 1 -type d -name "CUnit-*" -exec rm -r {} \;
tar xjvf ~/CUnit-2.1-3.tar.bz2
cd CUnit-2.1-3
test $UID = 0 && chown -R root:root .
# Generate the necessary files to be able to run configure
autoreconf -f -i
# Configure the build
test $(uname -m) = 'x86_64' &&
./configure --libdir=/usr/local/lib64 --mandir=/usr/local/man
test $(uname -m) != 'x86_64' && ./configure --mandir=/usr/local/man
# Build it
make
# 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/CUnit-*.tar.*
mv CUnit-2.1-3.tar.bz2 installed/
# If you ever want to uninstall CUnit, this should do it:
cd
su
test -d src/CUnit-* && ( cd src/CUnit-* ; make uninstall )
test -d /usr/local/doc/CUnit && rm -r /usr/local/doc/CUnit
test -d /usr/local/include/CUnit && rm -r /usr/local/include/CUnit
( cd /usr/local/lib
rm -f libcunit.* pkgconfig/cunit.pc )
test -d /usr/local/lib64 &&
( cd /usr/local/lib64
rm -f libcunit.* pkgconfig/cunit.pc )
rm -f /usr/local/man/man3/CUnit.3 /usr/local/share/man/man3/CUnit.3
test -d /usr/local/share/CUnit && rm -r /usr/local/share/CUnit
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "CUnit-*" -exec rm -r {} \;
rm -f ~/installed/CUnit-*.tar.*