# Get the source
cd
test -f installed/onig-6.9.9.tar.gz &&
mv -f installed/onig-6.9.9.tar.gz .
test ! -f onig-6.9.9.tar.gz &&
wget https://github.com/kkos/oniguruma/releases/download/v6.9.9/\
onig-6.9.9.tar.gz
# Extract the source
mkdir -p -m 0700 ~/src
cd src
find -maxdepth 1 -type d -name "onig-*" -exec rm -r {} \;
tar xzvf ~/onig-6.9.9.tar.gz
cd onig-6.9.9
test $UID = 0 && chown -R root:root .
# Read README.md and if upgrading, read HISTORY for changes
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --libdir=/usr/lib64
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr
# Build it
make
# Become root to clean up old files and to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg onigurama
# 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/onig-*.tar.*
mv onig-6.9.9.tar.gz installed/
# If you ever want to uninstall Onigurama, this should do it:
# ('make uninstall' as root should do it if you still have the source)
cd
su
test -d src/onig-* && ( cd src/onig-* ; make uninstall )
( cd /usr/include ; rm -f oniggnu.h oniguruma.h )
rm -f /usr/bin/onig-config /usr/lib/libonig.* \
/usr/lib/pkgconfig/onigurama.pc
test -d /usr/lib64 &&
( cd /usr/lib64
rm -f libonig.* pkgconfig/onigurama.pc )
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "onig-*" -exec rm -r {} \;
rm -f ~/installed/onig-*.tar.*