]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - lfs/asterisk
Merge branch 'next' into arm-port
[people/teissler/ipfire-2.x.git] / lfs / asterisk
CommitLineData
5e69ef1a 1###############################################################################
5e69ef1a 2# #
70df8302
MT
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
5# #
6# This program is free software: you can redistribute it and/or modify #
5e69ef1a 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
5e69ef1a
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
5e69ef1a
MT
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
5e69ef1a
MT
18# #
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
980245eb 27VER = 1.4.28
5e69ef1a
MT
28
29THISAPP = asterisk-$(VER)
30DL_FILE = $(THISAPP).tar.gz
1751628e 31DL_FROM = $(URL_IPFIRE)
5e69ef1a
MT
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33TARGET = $(DIR_INFO)/$(THISAPP)
846e756e 34SUP_ARCH = i586
a8b159e7 35PROG = asterisk
b6541fec 36PAK_VER = 5
5e69ef1a 37
b6541fec 38CHAN_CAPI = chan_capi-1.1.4
83bac7f3 39
980245eb 40DEPS = "libpri libtiff libvorbis libogg spandsp netsnmpd"
3489ebac 41
5e69ef1a
MT
42###############################################################################
43# Top-level Rules
44###############################################################################
45
46objects = $(DL_FILE) \
980245eb
AF
47 asterisk-1.4-de-prompts.tar.gz \
48 asterisk-core-sounds-en-gsm-1.4.16.tar.gz \
49 asterisk-extra-sounds-en-gsm-1.4.9.tar.gz \
50 asterisk-moh-opsound-gsm.tar.gz \
51 asterisk-addons-1.4.9.tar.gz \
52 agx-ast-addons-svn65.tgz \
53 $(CHAN_CAPI).tar.gz
5e69ef1a
MT
54
55$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
980245eb
AF
56asterisk-core-sounds-en-gsm-1.4.16.tar.gz = $(URL_IPFIRE)/asterisk-core-sounds-en-gsm-1.4.16.tar.gz
57asterisk-extra-sounds-en-gsm-1.4.9.tar.gz = $(URL_IPFIRE)/asterisk-extra-sounds-en-gsm-1.4.9.tar.gz
58asterisk-moh-opsound-gsm.tar.gz = $(URL_IPFIRE)/asterisk-moh-opsound-gsm.tar.gz
61d0d586 59asterisk-1.4-de-prompts.tar.gz = $(URL_IPFIRE)/asterisk-1.4-de-prompts.tar.gz
b6541fec
AF
60asterisk-addons-1.4.9.tar.gz = $(URL_IPFIRE)/asterisk-addons-1.4.9.tar.gz
61agx-ast-addons-svn65.tgz = $(URL_IPFIRE)/agx-ast-addons-svn65.tgz
83bac7f3 62$(CHAN_CAPI).tar.gz = $(URL_IPFIRE)/$(CHAN_CAPI).tar.gz
5e69ef1a 63
980245eb
AF
64$(DL_FILE)_MD5 = e8006ce319e18ce07ce1335ad583330a
65asterisk-core-sounds-en-gsm-1.4.16.tar.gz_MD5 = 87145c1775141613d1471864dae12bdd
66asterisk-extra-sounds-en-gsm-1.4.9.tar.gz_MD5 = ffa11b9d0128735425c43b9ce445dedf
67asterisk-moh-opsound-gsm.tar.gz_MD5 = 1fa8246f532a08ecc359f5e428bd7f60
61d0d586 68asterisk-1.4-de-prompts.tar.gz_MD5 = 626a2b95071a5505851e43874dfbfd5c
b6541fec
AF
69asterisk-addons-1.4.9.tar.gz_MD5 = 0c0ddf2386a9541e416e122ca082e611
70agx-ast-addons-svn65.tgz_MD5 = 9372d818cc68337658110f793d0fd8e0
71$(CHAN_CAPI).tar.gz_MD5 = 18fa835e724b7814deafbfa5b8cb01eb
5e69ef1a
MT
72
73install : $(TARGET)
74
75check : $(patsubst %,$(DIR_CHK)/%,$(objects))
76
77download :$(patsubst %,$(DIR_DL)/%,$(objects))
78
79md5 : $(subst %,%_MD5,$(objects))
80
81dist:
61d0d586 82 $(PAK)
5e69ef1a
MT
83
84###############################################################################
85# Downloading, checking, md5sum
86###############################################################################
87
88$(patsubst %,$(DIR_CHK)/%,$(objects)) :
89 @$(CHECK)
90
91$(patsubst %,$(DIR_DL)/%,$(objects)) :
92 @$(LOAD)
93
94$(subst %,%_MD5,$(objects)) :
95 @$(MD5)
96
97###############################################################################
98# Installation Details
99###############################################################################
100
101$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
102 @$(PREBUILD)
b6541fec
AF
103
104 # remove old directories and extract asterisk
105 @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* $(DIR_SRC)/$(CHAN_CAPI) $(DIR_SRC)/agx-ast-addons && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
106
107 # confiure asterisk
6f61f8c6 108 cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire
b6541fec
AF
109
110 # enable additional features (include following sound-tars)
111 cd $(DIR_APP) && cp -fv $(DIR_SRC)/config/asterisk/asterisk.makeopts menuselect.makeopts
112
113 # add additional sounds
980245eb
AF
114 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-core-sounds-en-gsm-1.4.16.tar.gz $(DIR_APP)/sounds/
115 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-extra-sounds-en-gsm-1.4.9.tar.gz $(DIR_APP)/sounds/
116 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-moh-opsound-gsm.tar.gz $(DIR_APP)/sounds/
b6541fec
AF
117
118 # compile and install
6f61f8c6
MT
119 cd $(DIR_APP) && make $(MAKETUNING) all
120 cd $(DIR_APP) && make install
121 cd $(DIR_APP) && make samples
b6541fec
AF
122
123 # extract and configure asterisk-addons
124 cd $(DIR_SRC) && tar zxf $(DIR_DL)/asterisk-addons-1.4.9.tar.gz
125 cd $(DIR_SRC)/asterisk-addons-* && ./configure --prefix=/usr --sysconfdir=/var/ipfire
126 # enable additional features (--> NOT NEEDED, DEFAULT CONFIG INCLUDES ALL)
127 #cd $(DIR_SRC)/asterisk-addons-* && cp -f $(DIR_SRC)/config/asterisk/addons.makeopts menuselect.makeopts
128 # make and install asterisk-addons
129 cd $(DIR_SRC)/asterisk-addons-* && make $(MAKETUNING) all
130 cd $(DIR_SRC)/asterisk-addons-* && make install
131 cd $(DIR_SRC)/asterisk-addons-* && make samples
132
133 # add german sounds and remove README.txt
61d0d586
MT
134 tar xfz $(DIR_DL)/asterisk-1.4-de-prompts.tar.gz -C /var/lib/asterisk/sounds/
135 -rm -f /var/lib/asterisk/sounds/README.txt
b6541fec
AF
136
137 # remove build directories
61d0d586 138 @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-*
b6541fec
AF
139
140 # copy additional ipfire scripts for asterisk
42dc0090
CS
141 -mkdir -p /var/ipfire/asterisk
142 cp -vrf $(DIR_SRC)/config/asterisk/* /var/ipfire/asterisk/
143 chmod o+w /var/ipfire/asterisk
6257cba2 144 chown nobody:nobody -R /var/ipfire/asterisk
42dc0090 145 ln -f -s /var/ipfire/asterisk/wakeup/wakeup.sh /etc/fcron.minutely/wakeup.sh
b6541fec
AF
146
147 # build and install chan capi (needed for isdn)
83bac7f3
MT
148 cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(CHAN_CAPI).tar.gz
149 cd $(DIR_SRC)/$(CHAN_CAPI) && make $(MAKETUNING)
150 cd $(DIR_SRC)/$(CHAN_CAPI) && make install
b6541fec
AF
151 @rm -rf $(DIR_SRC)/$(CHAN_CAPI)
152
153 # build FAX stuff (TODO: get newer version... where to download source?)
154 cd $(DIR_SRC) && tar zxf $(DIR_DL)/agx-ast-addons-svn65.tgz
155 # bugfix: disable app_confcall (not supported with dahdi, but we can take meetme)
156 cd $(DIR_SRC)/agx-ast-addons && echo "project (agx-ast-addons-zaptel)" > ./app-dahdi/CMakeLists.txt
157 cd $(DIR_SRC)/agx-ast-addons && echo >> ./app-dahdi/CMakeLists.txt
158 # end bugfix
159 cd $(DIR_SRC)/agx-ast-addons && ./configure.sh
3926e90d 160 cd $(DIR_SRC)/agx-ast-addons && ./build.sh
b6541fec
AF
161 @rm -rf $(DIR_SRC)/agx-ast-addons
162
163 # be sure all source is removed
164 @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-*
165
166 # remember backup-location
ef3002be 167 install -v -m 644 $(DIR_SRC)/config/backup/includes/asterisk /var/ipfire/backup/addons/includes/asterisk
b6541fec
AF
168
169 # generate softlink (or asterisk will not work properly)
170 ln -sf /var/ipfire/asterisk /etc/asterisk
171
172 # make asterisk start with reboot
173 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc0.d/K30asterisk
174 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc6.d/K30asterisk
175 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc3.d/S30asterisk
176
177 # all done
5e69ef1a 178 @$(POSTBUILD)