# Get it
cd
test -f installed/libssh-0.11.1.tar.xz &&
mv -f installed/libssh-0.11.1.tar.xz .
test ! -f libssh-0.11.1.tar.xz &&
wget https://www.libssh.org/files/0.11/libssh-0.11.1.tar.xz
# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball)
echo "14b7dcc72e91e08151c58b981a7b570ab2663f630e7d2837645d5a9c612c1b\
79 libssh-0.11.1.tar.xz" | sha256sum -c
# Extract the source
mkdir -p -0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "libssh-*" -exec rm -r {} \;
tar xJvf ~/libssh-0.11.1.tar.xz
cd libssh-0.11.1
test $UID = 0 && chown -R root:root .
# Create a build directory
mkdir build && cd build
# List the options
cmake -LH ..
# Configure the build with CMake
# The -D defines override settings in ../DefineOptions.cmake
# To see what settings it is using after running cmake, look at
# CMakeCache.txt
# Configure the build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ..
# Build it
make
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg libssh
# Install it
make install
ldconfig
# Remove old ones, then install docs where Slackware usually does
find /usr/doc -maxdepth 1 -type d -name "libssh-*" \
-exec rm -r {} \;
mkdir /usr/doc/libssh-0.11.1
cd ..
cp -p AUTHORS BSD CHANGELOG COPYING INSTALL README /usr/doc/libssh-0.11.1/
chown -R root:root /usr/doc/libssh-0.11.1
# 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 source for later
cd
mkdir -p -m 0700 installed
rm -f installed/libssh-0.11.1.tar.xz
mv libssh-0.11.1.tar.xz installed/
# If you ever want to uninstall libssh, this should do it:
cd
su
find /usr/doc -maxdepth 1 -type d -name "libssh-*" -exec rm -r {} \;
test -d /usr/include/libssh && rm -r /usr/include/libssh
test -d /usr/lib/cmake &&
( cd /usr/lib/cmake
rm -f libssh-config.cmake libssh-config-version.cmake )
test -d /usr/lib/pkgconfig &&
( cd /usr/lib/pkgconfig
rm -f libssh.pc libssh_threads.pc )
test -d /usr/lib64/cmake &&
( cd /usr/lib64/cmake
rm -f libssh-config.cmake libssh-config-version.cmake )
test -d /usr/lib64/pkgconfig &&
( cd /usr/lib64/pkgconfig
rm -f libssh.pc libssh_threads.pc )
find /usr/share/doc -maxdepth 1 -type d -name "libssh-*" -exec rm -r {} \;
rm -f /usr/lib/libssh.so* /usr/lib/libssh_threads.so*
test -d /usr/lib64 &&
rm -f /usr/lib64/libssh.so* /usr/lib64/libssh_threads.so*
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "libssh-*" -exec rm -r {} \;
rm -f ~/installed/libssh-*.tar.*