[asterisk-commits] dlee: trunk r384488 - /trunk/contrib/scripts/install_prereq

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 1 15:10:50 CDT 2013


Author: dlee
Date: Mon Apr  1 15:10:47 2013
New Revision: 384488

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=384488
Log:
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/

Modified:
    trunk/contrib/scripts/install_prereq

Modified: trunk/contrib/scripts/install_prereq
URL: http://svnview.digium.com/svn/asterisk/trunk/contrib/scripts/install_prereq?view=diff&rev=384488&r1=384487&r2=384488
==============================================================================
--- trunk/contrib/scripts/install_prereq (original)
+++ trunk/contrib/scripts/install_prereq Mon Apr  1 15:10:47 2013
@@ -37,6 +37,8 @@
 PACKAGES_OBSD="popt gmake wget libxml libogg libvorbis curl iksemel spandsp speex iodbc freetds-0.63p1-msdblib mysql-client gmime sqlite sqlite3 jack"
 
 KVERS=`uname -r`
+
+JANSSON_VER=2.4
 
 case "$1" in
 test)    testcmd=echo ;;
@@ -101,11 +103,25 @@
 	make && make install
 	cd ..
 
-	echo "*** Installing libresample ***"
-	svn co http://svn.digium.com/svn/thirdparty/libresample/trunk libresample-trunk
-	cd libresample-trunk
-	./configure && make && make install
-	cd ..
+	# Only install libresample if it wasn't installed via package
+	if ! test -f /usr/include/libresample.h; then
+	    echo "*** Installing libresample ***"
+	    svn co http://svn.digium.com/svn/thirdparty/libresample/trunk libresample-trunk
+	    cd libresample-trunk
+	    ./configure && make && make install
+	    cd ..
+	fi
+
+	# Only install Jansson if it wasn't installed via package
+	if ! test -f /usr/include/jansson.h; then
+		echo "*** Installing jansson ***"
+		wget -O - http://www.digip.org/jansson/releases/jansson-${JANSSON_VER}.tar.gz | zcat | tar -xf -
+		cd jansson-${JANSSON_VER}
+		./configure && make all && make install
+		cd ..
+		echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local.conf
+		/sbin/ldconfig
+	fi
 }
 
 if in_test_mode; then




More information about the asterisk-commits mailing list