[Asterisk-code-review] build: Fix deb build issues with fakeroot (asterisk[13.15])

George Joseph asteriskteam at digium.com
Wed Mar 29 11:27:42 CDT 2017


George Joseph has uploaded a new change for review. ( https://gerrit.asterisk.org/5359 )

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

build: Fix deb build issues with fakeroot

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.

Also suppressed an error message from 'find' in check-old-libdir.

ASTERISK-26705

Change-Id: I51739d4a03e60bff38be719b8d2ead0007afdd51
---
M Makefile
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/59/5359/1

diff --git a/Makefile b/Makefile
index 0487abd..80ab8bc 100644
--- a/Makefile
+++ b/Makefile
@@ -638,26 +638,28 @@
 
 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)/" ; \
+		$(LDCONFIG) "$(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' " ;\
+		echo "  * Run 'ldconfig $(ASTLIBDIR)' as root. " ;\
+		echo "  * Run asterisk with 'LD_LIBRARY_PATH=$(ASTLIBDIR) asterisk' " ;\
 		echo "" ;\
 		echo " WARNING WARNING WARNING" ;\
 	fi
+endif
 endif
 
 ifeq ($(and $(findstring 64,$(HOST_CPU)),$(findstring lib64,$(DESTDIR)$(ASTLIBDIR))),lib64)
 _oldlibdir = $(subst lib64,lib,$(DESTDIR)$(ASTLIBDIR))
 
 check-old-libdir:
-	@oldfiles=`find "$(_oldlibdir)" -name libasterisk* -print -quit -o \( -path *asterisk/modules/* -a -name *.so \) -print -quit` ;\
+	@oldfiles=`find "$(_oldlibdir)" -name libasterisk* -print -quit -o \( -path *asterisk/modules/* -a -name *.so \) -print -quit 2>/dev/null` ;\
 	if [ "x$$oldfiles" != "x" ] ; then \
 		echo " WARNING WARNING WARNING" ;\
 		echo "" ;\

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I51739d4a03e60bff38be719b8d2ead0007afdd51
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13.15
Gerrit-Owner: George Joseph <gjoseph at digium.com>



More information about the asterisk-code-review mailing list