]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame_incremental - lfs/asterisk
Merge remote-tracking branch 'origin/master' into kernel-update
[people/teissler/ipfire-2.x.git] / lfs / asterisk
... / ...
CommitLineData
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
5# #
6# This program is free software: you can redistribute it and/or modify #
7# it under the terms of the GNU General Public License as published by #
8# the Free Software Foundation, either version 3 of the License, or #
9# (at your option) any later version. #
10# #
11# This program is distributed in the hope that it will be useful, #
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 #
17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
18# #
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
27VER = 1.8.13.0
28
29THISAPP = asterisk-$(VER)
30DL_FILE = $(THISAPP).tar.gz
31DL_FROM = $(URL_IPFIRE)
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33TARGET = $(DIR_INFO)/$(THISAPP)
34PROG = asterisk
35PAK_VER = 7
36
37CHAN_CAPI = chan_capi-20120614
38
39DEPS = "libpri libtiff libvorbis libogg spandsp netsnmpd"
40
41###############################################################################
42# Top-level Rules
43###############################################################################
44
45objects = $(DL_FILE) \
46 asterisk-1.4-de-prompts.tar.gz \
47 asterisk-core-sounds-en-gsm-1.4.22.tar.gz \
48 asterisk-extra-sounds-en-gsm-1.4.11.tar.gz \
49 asterisk-moh-opsound-gsm-2.03.tar.gz \
50 $(CHAN_CAPI).tgz
51
52$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
53asterisk-core-sounds-en-gsm-1.4.22.tar.gz = $(URL_IPFIRE)/asterisk-core-sounds-en-gsm-1.4.22.tar.gz
54asterisk-extra-sounds-en-gsm-1.4.11.tar.gz = $(URL_IPFIRE)/asterisk-extra-sounds-en-gsm-1.4.11.tar.gz
55asterisk-moh-opsound-gsm-2.03.tar.gz = $(URL_IPFIRE)/asterisk-moh-opsound-gsm-2.03.tar.gz
56asterisk-1.4-de-prompts.tar.gz = $(URL_IPFIRE)/asterisk-1.4-de-prompts.tar.gz
57$(CHAN_CAPI).tgz = $(URL_IPFIRE)/$(CHAN_CAPI).tgz
58
59$(DL_FILE)_MD5 = e7f2cb19068c1211c907062f9e96c47a
60asterisk-core-sounds-en-gsm-1.4.22.tar.gz_MD5 = 2a99a45c0675135255bc65796b12f7c6
61asterisk-extra-sounds-en-gsm-1.4.11.tar.gz_MD5 = 5479cb4cb81d678304d96f35e4933a11
62asterisk-moh-opsound-gsm-2.03.tar.gz_MD5 = 09066f55f1358f298bc1a6e4678a3ddf
63asterisk-1.4-de-prompts.tar.gz_MD5 = 626a2b95071a5505851e43874dfbfd5c
64$(CHAN_CAPI).tgz_MD5 = c190f44eb362bf258b27f92c3458e4bf
65
66install : $(TARGET)
67
68check : $(patsubst %,$(DIR_CHK)/%,$(objects))
69
70download :$(patsubst %,$(DIR_DL)/%,$(objects))
71
72md5 : $(subst %,%_MD5,$(objects))
73
74dist:
75 $(PAK)
76
77###############################################################################
78# Downloading, checking, md5sum
79###############################################################################
80
81$(patsubst %,$(DIR_CHK)/%,$(objects)) :
82 @$(CHECK)
83
84$(patsubst %,$(DIR_DL)/%,$(objects)) :
85 @$(LOAD)
86
87$(subst %,%_MD5,$(objects)) :
88 @$(MD5)
89
90###############################################################################
91# Installation Details
92###############################################################################
93
94$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
95 @$(PREBUILD)
96
97 # remove old directories and extract asterisk
98 @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)
99
100 # confiure asterisk
101 cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire
102
103 # enable additional features (include following sound-tars)
104 cd $(DIR_APP) && cp -fv $(DIR_SRC)/config/asterisk/asterisk.makeopts menuselect.makeopts
105
106 # add additional sounds
107 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-core-sounds-en-gsm-1.4.22.tar.gz $(DIR_APP)/sounds/
108 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-extra-sounds-en-gsm-1.4.11.tar.gz $(DIR_APP)/sounds/
109 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-moh-opsound-gsm-2.03.tar.gz $(DIR_APP)/sounds/
110
111 # Fix wrong cpu optimization (march=armv5tel)
112 cd $(DIR_APP) && sed -i -e "s|^PROC=armv5te.*|PROC=armv5te|g" makeopts
113
114 # Add armv5te to gsm codecs
115 cd $(DIR_APP) && sed -i -e "s|armv5b |*armv5te |g" codecs/gsm/Makefile
116
117 # compile and install
118 cd $(DIR_APP) && make $(MAKETUNING) all
119 cd $(DIR_APP) && make install
120 cd $(DIR_APP) && make samples
121
122 # add german sounds and remove README.txt
123 tar xfz $(DIR_DL)/asterisk-1.4-de-prompts.tar.gz -C /var/lib/asterisk/sounds/
124 -rm -f /var/lib/asterisk/sounds/README.txt
125
126 # remove build directories
127 @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-*
128
129 # copy additional ipfire scripts for asterisk
130 -mkdir -p /var/ipfire/asterisk
131 cp -vrf $(DIR_SRC)/config/asterisk/* /var/ipfire/asterisk/
132 chmod o+w /var/ipfire/asterisk
133 chown nobody:nobody -R /var/ipfire/asterisk
134 ln -f -s /var/ipfire/asterisk/wakeup/wakeup.sh /etc/fcron.minutely/wakeup.sh
135
136 # build and install chan capi (needed for isdn)
137 cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(CHAN_CAPI).tgz
138 cd $(DIR_SRC)/chan-capi-HEAD && sed -i -e 's/^CFLAGS+=-Wno-unused-but-set-variable$$//' Makefile
139 cd $(DIR_SRC)/chan-capi-HEAD && make $(MAKETUNING)
140 cd $(DIR_SRC)/chan-capi-HEAD && make install
141 @rm -rf $(DIR_SRC)/chan-capi-HEAD
142
143 # be sure all source is removed
144 @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-*
145
146 # remember backup-location
147 install -v -m 644 $(DIR_SRC)/config/backup/includes/asterisk /var/ipfire/backup/addons/includes/asterisk
148
149 # generate softlink (or asterisk will not work properly)
150 ln -sf /var/ipfire/asterisk /etc/asterisk
151
152 # make asterisk start with reboot
153 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc0.d/K30asterisk
154 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc6.d/K30asterisk
155 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc3.d/S30asterisk
156
157 # all done
158 @$(POSTBUILD)