Linux HOWTOs

About | Home | Search


HOWTO: libmicrohttpd
Description: C library for running an HTTP server
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# GNU Libmicrohttpd 0.9.62
# ========================
# Prerequisites:
# curl >= 7.16.4
# pkg-config >= 0.9.0
# GnuTLS (for HTTPS)

# Get it
cd
test -f installed/libmicrohttpd-0.9.62.tar.gz &&
 mv -f installed/libmicrohttpd-0.9.62.tar.gz .
test ! -f libmicrohttpd-0.9.62.tar.gz &&
 wget https://ftpmirror.gnu.org/libmicrohttpd/libmicrohttpd-0.9.62.tar.gz

# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball)
echo "bd3e097d703f5091a6a01b56c0464a90fdd17f5d50478cea50a346b25c88db\
49  libmicrohttpd-0.9.62.tar.gz" | sha256sum -c

# Verify tarball w/ gpg:
( gpg --list-keys E29FC3CC > /dev/null 2>&1 || gpg --recv-keys E29FC3CC ) &&
 wget -nc https://ftpmirror.gnu.org/libmicrohttpd/\
libmicrohttpd-0.9.62.tar.gz.sig &&
  gpg --verify libmicrohttpd-0.9.62.tar.gz.sig &&
   rm libmicrohttpd-0.9.62.tar.gz.sig

# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "libmicrohttpd-*" -exec rm -r {} \;
tar xzvf ~/libmicrohttpd-0.9.62.tar.gz
cd libmicrohttpd-0.9.62
test $UID = 0 && chown -R root:root .

# Read ./README, INSTALL (generic autoconf), and if upgrading, ChangeLog

# Configure the build 64-bit
test $(uname -m) = 'x86_64' &&
 ./configure --infodir=/usr/local/info --libdir=/usr/local/lib64 \
  -mandir=/usr/local/man

# Configure the build anything else
test $(uname -m) != 'x86_64' &&
 ./configure --infodir=/usr/local/info --mandir=/usr/local/man

# Build it
make

# Become root to install it
su

# 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/libmicrohttpd-*.tar.*
mv -f libmicrohttpd-0.9.62.tar.gz installed/


# If you ever want to uninstall libmicrohttpd, this should do it:
cd
su
test -d src/libmicrohttpd-* && ( cd src/libmicrohttpd-* ; make uninstall )
find /usr/local/share/locale -type f -name libmicrohttpd.mo -exec rm {} \;
test -d /usr/local/info &&
 ( cd /usr/local/info ; rm -f libmicrohttpd_performance_data.png \
    libmicrohttpd.info libmicrohttpd-tutorial.info )
test -d /usr/local/share/info &&
 ( /usr/local/share/info ; rm -f libmicrohttpd_performance_data.png \
    libmicrohttpd.info libmicrohttpd-tutorial.info )
rm -f /usr/local/man/man3/libmicrohttpd.3 \
 /usr/local/share/man/man3/libmicrohttpd.3
rm -f /usr/local/include/microhttpd.h /usr/local/lib*/libmicrohttpd.* \
 /usr/local/lib*/pkgconfig/libmicrohttpd.pc
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "libmicrohttpd-*" -exec rm -r {} \;
rm -f ~/installed/libmicrohttpd-*.tar.*

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>