# Get the tarball
cd
test -f installed/libx86emu-3.5.tar.gz &&
mv -f installed/libx86emu-3.5.tar.gz .
test ! -f libx86emu-3.5.tar.gz &&
wget -O libx86emu-3.5.tar.gz \
https://github.com/wfeldt/libx86emu/archive/refs/tags/3.5.tar.gz
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "libx86emu-*" -exec rm -r {} \;
tar xzvf ~/libx86emu-3.5.tar.gz
cd libx86emu-3.5
test $UID = 0 && chown -R root:root .
# Read ./README.md
# Tell it what version itself is
echo 3.5 > VERSION
## Build it
# If you use /usr/lib64 it will figure it out by adding the output of:
# ldd /bin/sh | grep -q /lib64/ && echo 64
# ...to /usr/lib
make shared
# Become root to install it
su
# Install it
make install
ldconfig
# Become your non-root user again
exit
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/libx86emu-*.tar.*
mv libx86emu-3.5.tar.gz installed/
# If you ever want to uninstall libx86emu, this should do it:
cd
su
rm -f /usr/include/x86emu.h \
/usr/lib64/libx86emu.so.3.5 /usr/lib64/libx86emu.so.3 \
/usr/lib64/libx86emu.so
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "libx86emu-*" -exec rm -r {} \;
rm -f ~/installed/libx86emu-*.tar.*