1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
$NetBSD: patch-aa,v 1.2 2009/07/07 08:14:43 jnemeth Exp $
--- Makefile.orig 2009-02-24 12:44:50.000000000 -0800
+++ Makefile
@@ -122,20 +122,6 @@ DEBUG=-g3
# Define standard directories for various platforms
# These apply if they are not redefined in asterisk.conf
-ifeq ($(OSARCH),SunOS)
- ASTETCDIR=/var/etc/asterisk
- ASTLIBDIR=/opt/asterisk/lib
- ASTVARLIBDIR=/var/opt/asterisk
- ASTDBDIR=$(ASTVARLIBDIR)
- ASTKEYDIR=$(ASTVARLIBDIR)
- ASTSPOOLDIR=/var/spool/asterisk
- ASTLOGDIR=/var/log/asterisk
- ASTHEADERDIR=/opt/asterisk/include
- ASTBINDIR=/opt/asterisk/bin
- ASTSBINDIR=/opt/asterisk/sbin
- ASTVARRUNDIR=/var/run/asterisk
- ASTMANDIR=/opt/asterisk/man
-else
ASTETCDIR=$(sysconfdir)/asterisk
ASTLIBDIR=$(libdir)/asterisk
ASTHEADERDIR=$(includedir)/asterisk
@@ -145,19 +131,12 @@ else
ASTLOGDIR=$(localstatedir)/log/asterisk
ASTVARRUNDIR=$(localstatedir)/run
ASTMANDIR=$(mandir)
-ifneq ($(findstring BSD,$(OSARCH)),)
ASTVARLIBDIR=$(prefix)/share/asterisk
ASTVARRUNDIR=$(localstatedir)/run/asterisk
ASTDBDIR=$(localstatedir)/db/asterisk
-else
- ASTVARLIBDIR=$(localstatedir)/lib/asterisk
- ASTDBDIR=$(ASTVARLIBDIR)
-endif
ASTKEYDIR=$(ASTVARLIBDIR)
-endif
-ifeq ($(ASTDATADIR),)
ASTDATADIR:=$(ASTVARLIBDIR)
-endif
+ ASTEXAMPLEDIR=$(ASTETCDIR)
# Asterisk.conf is located in ASTETCDIR or by using the -C flag
# when starting Asterisk
@@ -243,11 +222,6 @@ ifeq ($(AST_DEVMODE),yes)
ASTCFLAGS+=-Wformat=2
endif
-ifneq ($(findstring BSD,$(OSARCH)),)
- ASTCFLAGS+=-I/usr/local/include
- ASTLDFLAGS+=-L/usr/local/lib
-endif
-
ifeq ($(findstring -march,$(ASTCFLAGS)),)
ifneq ($(PROC),ultrasparc)
ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
@@ -465,7 +439,7 @@ distclean: $(SUBDIRS_DIST_CLEAN) _clean
rm -f build_tools/menuselect-deps
datafiles: _all
- if [ x`$(ID) -un` = xroot ]; then CFLAGS="$(ASTCFLAGS)" sh build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
+ CFLAGS="$(ASTCFLAGS)" build_tools/mkpkgconfig $(DESTDIR)${PREFIX}/lib/pkgconfig
# Should static HTTP be installed during make samples or even with its own target ala
# webvoicemail? There are portions here that *could* be customized but might also be
# improved a lot. I'll put it here for now.
@@ -507,9 +481,10 @@ NEWHEADERS=$(notdir $(wildcard include/a
OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
installdirs:
+ mkdir -p $(DESTDIR)$(AGI_DIR)
mkdir -p $(DESTDIR)$(MODULES_DIR)
mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ mkdir -p $(DESTDIR)$(ASTEXAMPLEDIR)
mkdir -p $(DESTDIR)$(ASTBINDIR)
mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
@@ -518,6 +493,7 @@ installdirs:
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
+ mkdir -p $(DESTDIR)$(ASTDBDIR)
bininstall: _all installdirs $(SUBDIRS_INSTALL)
$(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
@@ -613,22 +589,22 @@ upgrade: bininstall
# XXX why *.adsi is installed first ?
adsi:
@echo Installing adsi config files...
- @mkdir -p $(DESTDIR)$(ASTETCDIR)
+ @mkdir -p $(DESTDIR)$(ASTEXAMPLEDIR)
@for x in configs/*.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
@echo Installing other config files...
- @mkdir -p $(DESTDIR)$(ASTETCDIR)
+ @mkdir -p $(DESTDIR)$(ASTEXAMPLEDIR)
@for x in configs/*.sample; do \
- dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`" ; \
+ dst="$(DESTDIR)$(ASTEXAMPLEDIR)/`$(BASENAME) $$x .sample`" ; \
if [ -f $${dst} ]; then \
if [ "$(OVERWRITE)" = "y" ]; then \
if cmp -s $${dst} $$x ; then \
@@ -644,10 +620,10 @@ samples: adsi
echo "Installing file $$x"; \
$(INSTALL) -m 644 $$x $${dst} ;\
done
- @if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ @if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf ]; then \
echo "Creating asterisk.conf"; \
( \
- echo "[directories](!) ; remove the (!) to enable this" ; \
+ echo "[directories]" ; \
echo "astetcdir => $(ASTETCDIR)" ; \
echo "astmoddir => $(MODULES_DIR)" ; \
echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
@@ -700,7 +676,7 @@ samples: adsi
echo "pbx_realtime=1.6" ; \
echo "res_agi=1.6" ; \
echo "app_set=1.6" ; \
- ) > $(DESTDIR)$(ASTCONFPATH) ; \
+ ) > $(DESTDIR)$(ASTEXAMPLEDIR)/asterisk.conf ; \
else \
echo "Skipping asterisk.conf creation"; \
fi
@@ -834,7 +810,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
|