Linux HOWTOs

About | Home | Search


HOWTO: c-ares
Description: C library for asynchronous DNS requests
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


# c-ares 1.15.0
# =============
# 1.15.0 Changelog

# Get it
cd
test -f installed/c-ares-1.15.0.tar.gz &&
 mv -f installed/c-ares-1.15.0.tar.gz .
test ! -f c-ares-1.15.0.tar.gz &&
 wget https://c-ares.haxx.se/download/c-ares-1.15.0.tar.gz

# Verify tarball w/ sha256sum:
echo "6cdb97871f2930530c97deb7cf5c8fa4be5a0b02c7cea6e7c7667672a39d68\
52  c-ares-1.15.0.tar.gz" | sha256sum -c

# Verify tarball w/ gpg:
( gpg --list-keys B71E12C2 > /dev/null 2>&1 || gpg --recv-keys B71E12C2 ) &&
 wget -nc https://c-ares.haxx.se/download/c-ares-1.15.0.tar.gz.asc
  gpg --verify c-ares-1.15.0.tar.gz.asc &&
   rm c-ares-1.15.0.tar.gz.asc

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

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

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

# Build it
make

# Become root to install it
su

# Install it
make install
ldconfig

# Become yourself again
exit

# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/c-ares-*.tar.*
mv c-ares-1.15.0.tar.gz installed/


# If you ever want to uninstall c-ares, this should do it:
cd
su
test -d src/c-ares-* && ( cd src/c-ares-* ; make uninstall )

/usr/local/include/
ares.h
ares_*.h

/usr/local/lib*/
libcares.*

/usr/local/lib*/pkgconfig/
libcares.pc

/usr/local/man/man3/
ares_*.3

ldconfig
exit
find ~/src -maxdepth 1 -type d -name "c-ares-*" -exec rm -r {} \;
rm -f ~/installed/c-ares-*.tar.*

Back to the list


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