$NetBSD: patch-Makefile,v 1.2 2017/06/21 13:33:48 jnemeth Exp $ --- Makefile.orig 2017-05-30 17:50:46.000000000 +0000 +++ Makefile @@ -139,7 +139,7 @@ DEBUG=-g3 # Asterisk.conf is located in ASTETCDIR or by using the -C flag # when starting Asterisk -ASTCONFPATH=$(ASTETCDIR)/asterisk.conf +ASTCONFPATH=$(ASTEXAMPLEDIR)/asterisk.conf AGI_DIR=$(ASTDATADIR)/agi-bin # If you use Apache, you may determine by a grep 'DocumentRoot' of your httpd.conf file @@ -209,10 +209,6 @@ ifeq ($(AST_DEVMODE),yes) ADDL_TARGETS+=validate-docs endif -ifneq ($(findstring BSD,$(OSARCH)),) - _ASTCFLAGS+=-isystem /usr/local/include -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) @@ -411,7 +407,6 @@ dist-clean: distclean distclean: $(SUBDIRS_DIST_CLEAN) _clean @$(MAKE) -C menuselect dist-clean - @$(MAKE) -C sounds dist-clean rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps rm -f config.log config.status config.cache rm -rf autom4te.cache @@ -526,7 +521,7 @@ update: NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h)) OLDHEADERS=$(filter-out $(NEWHEADERS) $(notdir $(DESTDIR)$(ASTHEADERDIR)),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h))) -INSTALLDIRS="$(ASTLIBDIR)" "$(ASTMODDIR)" "$(ASTSBINDIR)" "$(ASTETCDIR)" "$(ASTVARRUNDIR)" \ +INSTALLDIRS="$(ASTLIBDIR)" "$(ASTMODDIR)" "$(ASTSBINDIR)" "$(ASTEXAMPLEDIR)" "$(ASTVARRUNDIR)" \ "$(ASTSPOOLDIR)" "$(ASTSPOOLDIR)/dictate" "$(ASTSPOOLDIR)/meetme" \ "$(ASTSPOOLDIR)/monitor" "$(ASTSPOOLDIR)/system" "$(ASTSPOOLDIR)/tmp" \ "$(ASTSPOOLDIR)/voicemail" "$(ASTSPOOLDIR)/recording" \ @@ -730,7 +725,7 @@ upgrade: bininstall # (2) the extension to strip off define INSTALL_CONFIGS @for x in configs/$(1)/*$(2); do \ - dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x $(2)`"; \ + dst="$(DESTDIR)$(ASTEXAMPLEDIR)/`$(BASENAME) $$x $(2)`"; \ if [ -f "$${dst}" ]; then \ if [ "$(OVERWRITE)" = "y" ]; then \ if cmp -s "$${dst}" "$$x" ; then \ @@ -759,24 +754,24 @@ 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)" ; \ - rm -f "$(DESTDIR)$(ASTCONFPATH).tmp" ; \ + "$(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf" > "$(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf.tmp" ; \ + $(INSTALL) -m 644 "$(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf.tmp" "$(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf" ; \ + rm -f "$(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf.tmp" ; \ fi endef # XXX why *.adsi is installed first ? adsi: @echo Installing adsi config files... - $(INSTALL) -d "$(DESTDIR)$(ASTETCDIR)" + $(INSTALL) -d "$(DESTDIR)$(ASTEXAMPLEDIR)" @for x in configs/samples/*.adsi; do \ - dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \ + dst="$(DESTDIR)$(ASTEXAMPLEDIR)/`$(BASENAME) $$x`" ; \ if [ -f "$${dst}" ] ; then \ echo "Overwriting $$x" ; \ else \ echo "Installing $$x" ; \ fi ; \ - $(INSTALL) -m 644 "$$x" "$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \ + $(INSTALL) -m 644 "$$x" "$(DESTDIR)$(ASTEXAMPLEDIR)/`$(BASENAME) $$x`" ; \ done samples: adsi @@ -809,7 +804,7 @@ basic-pbx: webvmail: @[ -d "$(DESTDIR)$(HTTP_DOCSDIR)/" ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 ) @[ -d "$(DESTDIR)$(HTTP_CGIDIR)" ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 ) - $(INSTALL) -m 4755 contrib/scripts/vmail.cgi "$(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi" + $(INSTALL) contrib/scripts/vmail.cgi "$(DESTDIR)$(HTTP_CGIDIR)/vmail" $(INSTALL) -d "$(DESTDIR)$(HTTP_DOCSDIR)/_asterisk" for x in images/*.gif; do \ $(INSTALL) -m 644 $$x "$(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/"; \ @@ -859,11 +854,11 @@ endif endif install-logrotate: - if [ ! -d "$(DESTDIR)$(ASTETCDIR)/../logrotate.d" ]; then \ - $(INSTALL) -d "$(DESTDIR)$(ASTETCDIR)/../logrotate.d" ; \ + if [ ! -d "$(DESTDIR)$(ASTEXAMPLEDIR)/../logrotate.d" ]; then \ + $(INSTALL) -d "$(DESTDIR)$(ASTEXAMPLEDIR)/../logrotate.d" ; \ fi sed 's#__LOGDIR__#$(ASTLOGDIR)#g' < contrib/scripts/asterisk.logrotate | sed 's#__SBINDIR__#$(ASTSBINDIR)#g' > contrib/scripts/asterisk.logrotate.tmp - $(INSTALL) -m 0644 contrib/scripts/asterisk.logrotate.tmp "$(DESTDIR)$(ASTETCDIR)/../logrotate.d/asterisk" + $(INSTALL) -m 0644 contrib/scripts/asterisk.logrotate.tmp "$(DESTDIR)$(ASTEXAMPLEDIR)/../logrotate.d/asterisk" rm -f contrib/scripts/asterisk.logrotate.tmp config: @@ -975,7 +970,7 @@ uninstall-all: _uninstall rm -rf "$(DESTDIR)$(ASTVARLIBDIR)" rm -rf "$(DESTDIR)$(ASTDATADIR)" rm -rf "$(DESTDIR)$(ASTSPOOLDIR)" - rm -rf "$(DESTDIR)$(ASTETCDIR)" + rm -rf "$(DESTDIR)$(ASTEXAMPLEDIR)" rm -rf "$(DESTDIR)$(ASTLOGDIR)" menuconfig: menuselect @@ -1063,6 +1058,7 @@ check-alembic: makeopts @ALEMBIC=$(ALEMBIC) build_tools/make_check_alembic config cdr voicemail >&2 .PHONY: menuselect +.PHONY: menuselect.makeopts .PHONY: main .PHONY: sounds .PHONY: clean