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.

The previous logic in configure.ac to detect and correct libdir
has been removed as it was not completely accurate.  CentOS 64-bit
users should again specifiy --libdir=/usr/lib64 when configuring
to prevent install to /usr/lib.

Updated Makefile:check-old-libdir to check for orphans in
lib64 when installing to lib as well as orphans in lib when installing
to lib64.

Updated Makefile and main/Makefile uninstall targets to remove the
orphans using the new logic.

ASTERISK-26705

Change-Id: I51739d4a03e60bff38be719b8d2ead0007afdd51
This commit is contained in:
Walter Doekes
2017-03-28 20:01:16 +02:00
committed by George Joseph
parent 7898aad02d
commit a7d94f504f
4 changed files with 40 additions and 57 deletions

View File

@@ -351,7 +351,7 @@ binuninstall:
rm -f "$(DESTDIR)$(ASTSBINDIR)/$(MAIN_TGT)"
rm -f "$(DESTDIR)$(ASTSBINDIR)/rasterisk"
rm -f "$(DESTDIR)$(ASTLIBDIR)/libasterisk"* || :
rm -f "$(subst lib64,lib,$(DESTDIR)$(ASTLIBDIR))/libasterisk"* || :
test -n "$(_oldlibdir)" -a -d "$(_oldlibdir)" && rm -f "$(_oldlibdir)/libasterisk"* || :
clean::
rm -f asterisk libasteriskssl.o