# Get the source tarball
cd
test -f installed/nghttp3-1.2.0.tar.xz &&
mv -f installed/nghttp3-1.2.0.tar.xz .
test ! -f nghttp3-1.2.0.tar.xz &&
wget https://github.com/ngtcp2/nghttp3/releases/download/v1.2.0/\
nghttp3-1.2.0.tar.xz
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "nghttp2-*" -exec rm -r {} \;
tar xJvf ~/nghttp3-1.2.0.tar.xz
cd nghttp3-1.2.0
test $UID = 0 && chown -R root:root .
# Leave off --enable-lib-only if you want to build the examples
# Configure the library only build - 64-bit
test $(uname -m) = 'x86_64' &&
./configure --enable-lib-only --disable-static \
--libdir=/usr/local/lib64 \
--docdir=/usr/local/doc/nghttp3
# Configure the library only build - anything else
test $(uname -m) != 'x86_64' &&
./configure --enable-lib-only --disable-static \
--docdir=/usr/local/doc/nghttp3
# Build it
make
# Check the build
make check
# Become root to install it
su
# Install it
make install
ldconfig
# You may find, if upgrading, that you have old shared library files in
# /usr/lib*/ or /usr/local/lib*/ (whichever prefix you used). Run lsof to
# see if anything currently running is using one of them. If you care and
# are _sure_they're_not_in_use_, zap them and re-run ldconfig.
# Become your non-root user again
exit
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/nghttp2-*.tar.*
mv nghttp3-1.2.0.tar.xz installed/
# If you ever want to uninstall nghttp3, this should do it:
# (use /usr if you used --prefix=/usr, rather than /usr/local)
cd
su
test -d src/nghttp3-* && ( cd src/nghttp3-* ; make uninstall )
test -d /usr/local/doc/nghttp3 && rm -r /usr/local/doc/nghttp3
test -d /usr/local/include/nghttp3 && rm -r /usr/local/include/nghttp3
rm -f /usr/local/lib64/libnghttp3.* \
/usr/local/lib64/pkgconfig/libnghttp3.pc
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "nghttp3-*" -exec rm -r {} \;
rm -f ~/installed/nghttp3-*.tar.*