install_prereq: Build jansson from source, when necessary
authorDavid M. Lee <dlee@digium.com>
Mon, 1 Apr 2013 20:10:47 +0000 (20:10 +0000)
committerDavid M. Lee <dlee@digium.com>
Mon, 1 Apr 2013 20:10:47 +0000 (20:10 +0000)
commitd4e25a456e73189044927d96f2bc26a7e4b96a50
tree14c2532b69adc2ee2ef596c6a4f00fea6c542eb6
parent8c5367226baa1e24f4440da6aed1ce84b65a58ac
install_prereq: Build jansson from source, when necessary

When r383579 was committed, it made Jansson a required dependency.

While libjansson-dev and jansson-devel are available on recent
distros, some older (but still supported) distros don't have
it. There's a pull request[1] to get it into repoforge, but that still
doesn't help everyone. (And helps no one until the pull request is
merged and packages are built).

This patch adds Jansson install from source to the install_unpackaged()
function. There are a few gotcha's, which makes this change not
completely trivial.

 * Since Jansson may be installed by a package, don't install from
   source if a package installation can be found
   * libresample may also be installed via package, so I added a
     similar check to that.
 * Since Jansson installs into /usr/local, this patch also adds
   /usr/local/lib to /etc/ld.so.conf.d so that the library can be
   found.
   * The alternative was to install into /usr, but then it gets
     complicated having to deal with EL's /usr/lib{32,64} shenanigans.

 [1]: https://github.com/repoforge/rpms/pull/250

Review: https://reviewboard.asterisk.org/r/2414/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
contrib/scripts/install_prereq