# Get the tarball
cd
test -f installed/json-c-0.17.tar.gz &&
mv -f installed/json-c-0.17.tar.gz .
test ! -f json-c-0.17.tar.gz &&
wget https://s3.amazonaws.com/json-c_releases/releases/json-c-0.17.tar.gz
# Configure the build for 64-bit
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib64 \
-DBUILD_STATIC_LIBS=OFF ..
# Configure the build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_STATIC_LIBS=OFF ..
# Build it
make
# Test the build
make test
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg json-c
# 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/json-c-*.tar.gz
mv -f json-c-0.17.tar.gz installed/
# If you ever want to uninstall JSON-C, this should do it:
cd
su
test -d src/json-c-* && ( cd src/json-c-* ; make uninstall )
test -d /usr/include/json-c && rm -r /usr/include/json-c
( cd /usr/lib
rm -f ./libjson-c.* pkgconfig/json-c.pc
test -d ./cmake/json-c && rm -r ./cmake/json-c )
test -d /usr/lib64 &&
( cd /usr/lib64
rm -f ./libjson-c.* pkgconfig/json-c.pc
test -d ./cmake/json-c && rm -r ./cmake/json-c )
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "json-c-*" -exec rm -r {} \;
rm -f ~/installed/json-c-*.tar.*