From 0ba52ce3cfac546d2e44785c9b11ee74b1784a53 Mon Sep 17 00:00:00 2001
From: George Joseph <gjoseph@digium.com>
Date: Wed, 19 Jun 2019 10:58:39 -0600
Subject: [PATCH] CI:  New way to determnine libdir

We were using the presence of /usr/lib64 to determine where
shared libraries should be installed.  This only existed on
Redhat based systems and was safe.  If it existed, use it,
otherwise use /usr/lib.

Unfortunately, Ubuntu 19 decided to create a /usr/lib64 BUT
NOT INCLUDE IT IN THE DEFAULT ld.so.conf.  So if anything is
installed there, it won't work.

The new method, just looks for $ID in /etc/os-release and if it's
centos or fedora, uses /usr/lib64 and if ubuntu, uses /usr/lib.

NOTE:  This applies only to the CI scripts.  Normal asterisk
build and install is not affected.

Change-Id: Iad66374b550fd89349bedbbf2b93f8edd195a7c3
---
 tests/CI/buildAsterisk.sh |  2 +-
 tests/CI/findLibdir.sh    | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100755 tests/CI/findLibdir.sh

diff --git a/tests/CI/buildAsterisk.sh b/tests/CI/buildAsterisk.sh
index 064cdbc6e1..17bb53c03d 100755
--- a/tests/CI/buildAsterisk.sh
+++ b/tests/CI/buildAsterisk.sh
@@ -89,7 +89,7 @@ runner ulimit -a
 
 MAKE=`which make`
 PKGCONFIG=`which pkg-config`
-[ -d /usr/lib64 ] && _libdir=/usr/lib64
+_libdir=`${CIDIR}/findLibdir.sh`
 
 common_config_args="--prefix=/usr ${_libdir:+--libdir=${_libdir}} --sysconfdir=/etc --with-pjproject-bundled"
 $PKGCONFIG 'jansson >= 2.11' || common_config_args+=" --with-jansson-bundled"
diff --git a/tests/CI/findLibdir.sh b/tests/CI/findLibdir.sh
new file mode 100755
index 0000000000..ed25ba3d6f
--- /dev/null
+++ b/tests/CI/findLibdir.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+source /etc/os-release
+
+case $ID in
+	centos)
+		echo /usr/lib64
+		;;
+	fedora)
+		echo /usr/lib64
+		;;
+	ubuntu)
+		echo /usr/lib
+esac
-- 
GitLab