]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - lfs/asterisk
start core80.
[people/teissler/ipfire-2.x.git] / lfs / asterisk
CommitLineData
5e69ef1a 1###############################################################################
5e69ef1a 2# #
70df8302 3# IPFire.org - A linux based firewall #
11b5b85c 4# Copyright (C) 2007-2012 IPFire Team <info@ipfire.org> #
70df8302
MT
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
11b5b85c 27VER = 1.8.19.0
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)
a8b159e7 34PROG = asterisk
11b5b85c 35PAK_VER = 8
5e69ef1a 36
e659ba5b 37CHAN_CAPI = chan_capi-20120614
83bac7f3 38
980245eb 39DEPS = "libpri libtiff libvorbis libogg spandsp netsnmpd"
3489ebac 40
5e69ef1a
MT
41###############################################################################
42# Top-level Rules
43###############################################################################
44
45objects = $(DL_FILE) \
980245eb 46 asterisk-1.4-de-prompts.tar.gz \
eb5b3f95
AF
47 asterisk-extra-sounds-en-gsm-1.4.11.tar.gz \
48 asterisk-moh-opsound-gsm-2.03.tar.gz \
e659ba5b 49 $(CHAN_CAPI).tgz
5e69ef1a
MT
50
51$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
eb5b3f95
AF
52asterisk-extra-sounds-en-gsm-1.4.11.tar.gz = $(URL_IPFIRE)/asterisk-extra-sounds-en-gsm-1.4.11.tar.gz
53asterisk-moh-opsound-gsm-2.03.tar.gz = $(URL_IPFIRE)/asterisk-moh-opsound-gsm-2.03.tar.gz
61d0d586 54asterisk-1.4-de-prompts.tar.gz = $(URL_IPFIRE)/asterisk-1.4-de-prompts.tar.gz
e659ba5b 55$(CHAN_CAPI).tgz = $(URL_IPFIRE)/$(CHAN_CAPI).tgz
5e69ef1a 56
11b5b85c 57$(DL_FILE)_MD5 = dc98436846cc2de57100d78747b1bdd1
eb5b3f95
AF
58asterisk-extra-sounds-en-gsm-1.4.11.tar.gz_MD5 = 5479cb4cb81d678304d96f35e4933a11
59asterisk-moh-opsound-gsm-2.03.tar.gz_MD5 = 09066f55f1358f298bc1a6e4678a3ddf
61d0d586 60asterisk-1.4-de-prompts.tar.gz_MD5 = 626a2b95071a5505851e43874dfbfd5c
e659ba5b 61$(CHAN_CAPI).tgz_MD5 = c190f44eb362bf258b27f92c3458e4bf
5e69ef1a
MT
62
63install : $(TARGET)
64
65check : $(patsubst %,$(DIR_CHK)/%,$(objects))
66
67download :$(patsubst %,$(DIR_DL)/%,$(objects))
68
69md5 : $(subst %,%_MD5,$(objects))
70
71dist:
61d0d586 72 $(PAK)
5e69ef1a
MT
73
74###############################################################################
75# Downloading, checking, md5sum
76###############################################################################
77
78$(patsubst %,$(DIR_CHK)/%,$(objects)) :
79 @$(CHECK)
80
81$(patsubst %,$(DIR_DL)/%,$(objects)) :
82 @$(LOAD)
83
84$(subst %,%_MD5,$(objects)) :
85 @$(MD5)
86
87###############################################################################
88# Installation Details
89###############################################################################
90
91$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
92 @$(PREBUILD)
b6541fec
AF
93
94 # remove old directories and extract asterisk
95 @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)
96
97 # confiure asterisk
6f61f8c6 98 cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire
b6541fec
AF
99
100 # enable additional features (include following sound-tars)
101 cd $(DIR_APP) && cp -fv $(DIR_SRC)/config/asterisk/asterisk.makeopts menuselect.makeopts
102
103 # add additional sounds
eb5b3f95
AF
104 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-extra-sounds-en-gsm-1.4.11.tar.gz $(DIR_APP)/sounds/
105 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-moh-opsound-gsm-2.03.tar.gz $(DIR_APP)/sounds/
b6541fec 106
eb5b3f95
AF
107 # Fix wrong cpu optimization (march=armv5tel)
108 cd $(DIR_APP) && sed -i -e "s|^PROC=armv5te.*|PROC=armv5te|g" makeopts
109
110 # Add armv5te to gsm codecs
111 cd $(DIR_APP) && sed -i -e "s|armv5b |*armv5te |g" codecs/gsm/Makefile
821f9f50 112
b6541fec 113 # compile and install
6f61f8c6
MT
114 cd $(DIR_APP) && make $(MAKETUNING) all
115 cd $(DIR_APP) && make install
116 cd $(DIR_APP) && make samples
b6541fec 117
b6541fec 118 # add german sounds and remove README.txt
61d0d586
MT
119 tar xfz $(DIR_DL)/asterisk-1.4-de-prompts.tar.gz -C /var/lib/asterisk/sounds/
120 -rm -f /var/lib/asterisk/sounds/README.txt
b6541fec
AF
121
122 # remove build directories
61d0d586 123 @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-*
b6541fec
AF
124
125 # copy additional ipfire scripts for asterisk
42dc0090
CS
126 -mkdir -p /var/ipfire/asterisk
127 cp -vrf $(DIR_SRC)/config/asterisk/* /var/ipfire/asterisk/
128 chmod o+w /var/ipfire/asterisk
6257cba2 129 chown nobody:nobody -R /var/ipfire/asterisk
42dc0090 130 ln -f -s /var/ipfire/asterisk/wakeup/wakeup.sh /etc/fcron.minutely/wakeup.sh
b6541fec
AF
131
132 # build and install chan capi (needed for isdn)
e659ba5b
JL
133 cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(CHAN_CAPI).tgz
134 cd $(DIR_SRC)/chan-capi-HEAD && sed -i -e 's/^CFLAGS+=-Wno-unused-but-set-variable$$//' Makefile
135 cd $(DIR_SRC)/chan-capi-HEAD && make $(MAKETUNING)
136 cd $(DIR_SRC)/chan-capi-HEAD && make install
137 @rm -rf $(DIR_SRC)/chan-capi-HEAD
b6541fec 138
b6541fec
AF
139 # be sure all source is removed
140 @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-*
141
142 # remember backup-location
ef3002be 143 install -v -m 644 $(DIR_SRC)/config/backup/includes/asterisk /var/ipfire/backup/addons/includes/asterisk
b6541fec
AF
144
145 # generate softlink (or asterisk will not work properly)
146 ln -sf /var/ipfire/asterisk /etc/asterisk
147
148 # make asterisk start with reboot
149 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc0.d/K30asterisk
150 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc6.d/K30asterisk
151 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc3.d/S30asterisk
152
153 # all done
5e69ef1a 154 @$(POSTBUILD)