[Asterisk-code-review] build: Fix deb build issues with fakeroot and lib64. (asterisk[14])

Walter Doekes asteriskteam at digium.com
Tue Mar 28 11:25:58 CDT 2017


Walter Doekes has uploaded a new change for review. ( https://gerrit.asterisk.org/5348 )

Change subject: build: Fix deb build issues with fakeroot and lib64.
......................................................................

build: Fix deb build issues with fakeroot and lib64.

If DESTDIR is set, don't call ldconfig. Assume that DESTDIR is used to
create a binary archive. The ldconfig call should be delegated to the
archive postinst script. This fixes the case where fakeroot wraps 'make
install' causing $EUID to be 0 even though it doesn't have permission to
call ldconfig.

Further, the existence of /usr/lib64 on the build OS should not be taken
into account when creating a deb package.

ASTERISK-26705

Change-Id: I51739d4a03e60bff38be719b8d2ead0007afdd51
---
M Makefile
M configure.ac
2 files changed, 17 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/48/5348/1

diff --git a/Makefile b/Makefile
index 2c7f925..6ab1623 100644
--- a/Makefile
+++ b/Makefile
@@ -637,13 +637,14 @@
 
 ld-cache-update:
 ifneq ($(LDCONFIG),)
+ifeq ($(DESTDIR),)  # DESTDIR means binary archive creation; ldconfig should be run on postinst
 	@if [ $${EUID} -eq 0 ] ; then \
 		$(LDCONFIG) "$(DESTDIR)$(ASTLIBDIR)/" ; \
 	else \
 		echo " WARNING WARNING WARNING" ;\
 		echo "" ;\
 		echo " You cannot rebuild the system linker cache unless you are root. " ;\
-		echo " You MUST do one of the follwing..." ;\
+		echo " You MUST do one of the following..." ;\
 		echo "  * Re-run 'make install' as root. " ;\
 		echo "  * Run 'ldconfig $(DESTDIR)$(ASTLIBDIR)' as root. " ;\
 		echo "  * Run asterisk with 'LD_LIBRARY_PATH=$(DESTDIR)$(ASTLIBDIR) asterisk' " ;\
@@ -651,6 +652,7 @@
 		echo " WARNING WARNING WARNING" ;\
 	fi
 endif
+endif
 
 ifeq ($(and $(findstring 64,$(HOST_CPU)),$(findstring lib64,$(DESTDIR)$(ASTLIBDIR))),lib64)
 _oldlibdir = $(subst lib64,lib,$(DESTDIR)$(ASTLIBDIR))
diff --git a/configure.ac b/configure.ac
index d9a800a..52f06c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,15 +135,22 @@
      fi
 fi
 
-#
-# The following code for detecting lib64 was taken from Fedora's
-# /usr/share/config.site with a modification to check that the
-# /usr/lib64 directory actually exists.  This prevents libdir from
-# being set to /usr/lib64 on 64-bit systems that still use /usr/lib.
-#
-if test "$prefix" = /usr ||\
+if test -n "$DEB_HOST_MULTIARCH"
+then
+     # This is a debian/ubuntu build. *If* we were to change
+     # directories, we'd use $DEB_HOST_MULTIARCH and not hardcode
+     # /lib64/. Do nothing for now, and default to /lib/.
+     # Check added to ignore stray lib64 dirs on the build OS.
+     true
+elif test "$prefix" = /usr ||\
      { test "$prefix" = NONE && test "$ac_default_prefix" = /usr ; }
 then
+     #
+     # The following code for detecting lib64 was taken from Fedora's
+     # /usr/share/config.site with a modification to check that the
+     # /usr/lib64 directory actually exists.  This prevents libdir from
+     # being set to /usr/lib64 on 64-bit systems that still use /usr/lib.
+     #
      for i in x86_64 ppc64 s390x aarch64; do
         if test $host_cpu = $i; then
            if test "$libdir" = '${exec_prefix}/lib' &&\

-- 
To view, visit https://gerrit.asterisk.org/5348
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I51739d4a03e60bff38be719b8d2ead0007afdd51
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Walter Doekes <walter+asterisk at wjd.nu>



More information about the asterisk-code-review mailing list