--- Makefile.orig 2016-03-22 18:32:00 UTC +++ Makefile @@ -131,7 +131,7 @@ ASTTOPDIR:=$(subst $(space),\$(space),$( OVERWRITE=y # Include debug and macro symbols in the executables (-g) and profiling info (-pg) -DEBUG=-g3 +#DEBUG=-g3 # Asterisk.conf is located in ASTETCDIR or by using the -C flag # when starting Asterisk @@ -155,7 +155,7 @@ LINKER_SYMBOL_PREFIX= #_ASTCFLAGS+=-DOLD_DSP_ROUTINES # Default install directory for DAHDI hooks. -DAHDI_UDEV_HOOK_DIR = /usr/share/dahdi/span_config.d +#DAHDI_UDEV_HOOK_DIR = /usr/share/dahdi/span_config.d # This Makefile previously contained a note about the ability to use .asterisk.makeopts # from your home directory or /etc/asterisk.makeopts to set defaults for menuselect. @@ -217,7 +217,7 @@ endif ifeq ($(OSARCH),FreeBSD) # -V is understood by BSD Make, not by GNU make. - BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk) + BSDVERSION=$(OSVERSION) _ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi) # flag to tell 'ldconfig' to only process specified directories LDCONFIG_FLAGS=-m @@ -476,8 +476,12 @@ datafiles: _all doc/core-en_US.xml $(INSTALL) -m 644 $$n "$(DESTDIR)$(ASTDATADIR)/static-http/docs" ; \ done \ fi + if [ ! -d $(DESTDIR)$(DOCSDIR)/images ]; then \ + $(MKDIR) $(DESTDIR)$(DOCSDIR)/images; \ + fi + for x in images/*.jpg; do \ - $(INSTALL) -m 644 $$x "$(DESTDIR)$(ASTDATADIR)/images" ; \ + $(INSTALL) -m 644 $$x "$(DESTDIR)$(DOCSDIR)/images" ; \ done $(MAKE) -C sounds install find rest-api -name "*.json" | while read x; do \ @@ -572,7 +576,7 @@ INSTALLDIRS="$(ASTLIBDIR)" "$(ASTMODDIR) "$(ASTDATADIR)/firmware/iax" "$(ASTDATADIR)/images" "$(ASTDATADIR)/keys" \ "$(ASTDATADIR)/phoneprov" "$(ASTDATADIR)/rest-api" "$(ASTDATADIR)/static-http" \ "$(ASTDATADIR)/sounds" "$(ASTDATADIR)/moh" "$(ASTMANDIR)/man8" "$(AGI_DIR)" "$(ASTDBDIR)" \ - "$(ASTDATADIR)/third-party" + "$(ASTDATADIR)/third-party" "$(ASTSPOOLDIR)/outgoing" installdirs: @for i in $(INSTALLDIRS); do \ @@ -609,10 +613,10 @@ bininstall: _all installdirs $(SUBDIRS_I if [ -f contrib/firmware/iax/iaxy.bin ] ; then \ $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin "$(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin"; \ fi -ifeq ($(HAVE_DAHDI),1) - $(INSTALL) -d $(DESTDIR)/$(DAHDI_UDEV_HOOK_DIR) - $(INSTALL) -m 644 contrib/scripts/dahdi_span_config_hook $(DESTDIR)$(DAHDI_UDEV_HOOK_DIR)/40-asterisk -endif +#ifeq ($(HAVE_DAHDI),1) +# $(INSTALL) -d $(DESTDIR)/$(DAHDI_UDEV_HOOK_DIR) +# $(INSTALL) -m 644 contrib/scripts/dahdi_span_config_hook $(DESTDIR)$(DAHDI_UDEV_HOOK_DIR)/40-asterisk +#endif $(SUBDIRS_INSTALL): +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTDATADIR="$(ASTDATADIR)" $(SUBMAKE) -C $(@:-install=) install @@ -645,7 +649,7 @@ ifneq ($(filter ~%,$(DESTDIR)),) @exit 1 endif -install: badshell bininstall datafiles +install: badshell bininstall datafiles samples @if [ -x /usr/sbin/asterisk-post-install ]; then \ /usr/sbin/asterisk-post-install "$(DESTDIR)" . ; \ fi @@ -688,23 +692,10 @@ upgrade: bininstall # (2) the extension to strip off define INSTALL_CONFIGS @for x in configs/$(1)/*$(2); do \ - dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x $(2)`"; \ - if [ -f "$${dst}" ]; then \ - if [ "$(OVERWRITE)" = "y" ]; then \ - if cmp -s "$${dst}" "$$x" ; then \ - echo "Config file $$x is unchanged"; \ - continue; \ - fi ; \ - mv -f "$${dst}" "$${dst}.old" ; \ - else \ - echo "Skipping config file $$x"; \ - continue; \ - fi ;\ - fi ; \ echo "Installing file $$x"; \ - $(INSTALL) -m 644 "$$x" "$${dst}" ;\ + $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`.sample ; \ done ; \ - if [ "$(OVERWRITE)" = "y" ]; then \ + if true; then \ echo "Updating asterisk.conf" ; \ sed -e 's|^astetcdir.*$$|astetcdir => $(ASTETCDIR)|' \ -e 's|^astmoddir.*$$|astmoddir => $(ASTMODDIR)|' \ @@ -717,8 +708,8 @@ define INSTALL_CONFIGS -e 's|^astrundir.*$$|astrundir => $(ASTVARRUNDIR)|' \ -e 's|^astlogdir.*$$|astlogdir => $(ASTLOGDIR)|' \ -e 's|^astsbindir.*$$|astsbindir => $(ASTSBINDIR)|' \ - "$(DESTDIR)$(ASTCONFPATH)" > "$(DESTDIR)$(ASTCONFPATH).tmp" ; \ - $(INSTALL) -m 644 "$(DESTDIR)$(ASTCONFPATH).tmp" "$(DESTDIR)$(ASTCONFPATH)" ; \ + "$(DESTDIR)$(ASTCONFPATH).sample" > "$(DESTDIR)$(ASTCONFPATH).tmp" ; \ + $(INSTALL) -m 644 "$(DESTDIR)$(ASTCONFPATH).tmp" "$(DESTDIR)$(ASTCONFPATH).sample" ; \ rm -f "$(DESTDIR)$(ASTCONFPATH).tmp" ; \ fi endef @@ -734,7 +725,7 @@ adsi: else \ echo "Installing $$x" ; \ fi ; \ - $(INSTALL) -m 644 "$$x" "$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \ + $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`.sample ; \ done samples: adsi