# Get the source tarball
cd
test -f installed/teckit-2.5.12.tar.gz &&
mv -f installed/teckit-2.5.12.tar.gz .
test ! -f teckit-2.5.12.tar.gz &&
wget https://github.com/silnrsi/teckit/releases/download/v2.5.12/\
teckit-2.5.12.tar.gz
# Extract the source
mdkir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "teckit-*" -exec rm -r {} \;
tar xzvf ~/teckit-2.5.12.tar.gz
cd teckit-2.5.12
test $UID = 0 && chown -R root:root .
# Remove old docs from previous source installed versions
test -d /usr/local/doc/teckit && rm -r /usr/local/doc/teckit
find /usr/local/doc -maxdepth 1 -type d -name "teckit-" -exec rm -r {} \;
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure \
--docdir=/usr/local/doc/teckit-2.5.12 \
--libdir=/usr/local/lib64 \
--mandir=/usr/local/man
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure \
--docdir=/usr/local/doc/teckit-2.5.12 \
--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+w .
# Become your non-root user again
exit
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/teckit-*.tar.*
mv teckit-2.5.12.tar.gz installed/
# If you ever want to uninstall TECkit, this should do it:
cd
su
test -d src/teckit-* && ( cd src/teckit-* ; make uninstall )
( cd /usr/local/bin
rm -f sfconv teckit_compile txtconv )
test -d /usr/local/include/teckit && rm -r /usr/local/include/teckit
( cd /usr/local/lib
rm -f libTECkit.* libTECkit_Compiler.* pkgconfig/teckit.pc )
test -d /usr/local/lib64 &&
( cd /usr/local/lib64
rm -f libTECkit.* libTECkit_Compiler.* pkgconfig/teckit.pc )
( cd /usr/local/man/man1
rm -f sfconv.1 teckit_compile.1 txtconv.1 )
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "teckit-*" -exec rm -r {} \;
rm -f ~/installed/teckit-*.tar.*