]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - lfs/asterisk
Update package list.
[people/pmueller/ipfire-2.x.git] / lfs / asterisk
1 ###############################################################################
2 # #
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 #
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
25 include Config
26
27 VER = 1.4.28
28
29 THISAPP = asterisk-$(VER)
30 DL_FILE = $(THISAPP).tar.gz
31 DL_FROM = $(URL_IPFIRE)
32 DIR_APP = $(DIR_SRC)/$(THISAPP)
33 TARGET = $(DIR_INFO)/$(THISAPP)
34 PROG = asterisk
35 PAK_VER = 5
36
37 CHAN_CAPI = chan_capi-1.1.4
38
39 DEPS = "libpri libtiff libvorbis libogg spandsp netsnmpd"
40
41 ###############################################################################
42 # Top-level Rules
43 ###############################################################################
44
45 objects = $(DL_FILE) \
46 asterisk-1.4-de-prompts.tar.gz \
47 asterisk-core-sounds-en-gsm-1.4.16.tar.gz \
48 asterisk-extra-sounds-en-gsm-1.4.9.tar.gz \
49 asterisk-moh-opsound-gsm.tar.gz \
50 asterisk-addons-1.4.9.tar.gz \
51 agx-ast-addons-svn65.tgz \
52 $(CHAN_CAPI).tar.gz
53
54 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
55 asterisk-core-sounds-en-gsm-1.4.16.tar.gz = $(URL_IPFIRE)/asterisk-core-sounds-en-gsm-1.4.16.tar.gz
56 asterisk-extra-sounds-en-gsm-1.4.9.tar.gz = $(URL_IPFIRE)/asterisk-extra-sounds-en-gsm-1.4.9.tar.gz
57 asterisk-moh-opsound-gsm.tar.gz = $(URL_IPFIRE)/asterisk-moh-opsound-gsm.tar.gz
58 asterisk-1.4-de-prompts.tar.gz = $(URL_IPFIRE)/asterisk-1.4-de-prompts.tar.gz
59 asterisk-addons-1.4.9.tar.gz = $(URL_IPFIRE)/asterisk-addons-1.4.9.tar.gz
60 agx-ast-addons-svn65.tgz = $(URL_IPFIRE)/agx-ast-addons-svn65.tgz
61 $(CHAN_CAPI).tar.gz = $(URL_IPFIRE)/$(CHAN_CAPI).tar.gz
62
63 $(DL_FILE)_MD5 = e8006ce319e18ce07ce1335ad583330a
64 asterisk-core-sounds-en-gsm-1.4.16.tar.gz_MD5 = 87145c1775141613d1471864dae12bdd
65 asterisk-extra-sounds-en-gsm-1.4.9.tar.gz_MD5 = ffa11b9d0128735425c43b9ce445dedf
66 asterisk-moh-opsound-gsm.tar.gz_MD5 = 1fa8246f532a08ecc359f5e428bd7f60
67 asterisk-1.4-de-prompts.tar.gz_MD5 = 626a2b95071a5505851e43874dfbfd5c
68 asterisk-addons-1.4.9.tar.gz_MD5 = 0c0ddf2386a9541e416e122ca082e611
69 agx-ast-addons-svn65.tgz_MD5 = 9372d818cc68337658110f793d0fd8e0
70 $(CHAN_CAPI).tar.gz_MD5 = 18fa835e724b7814deafbfa5b8cb01eb
71
72 install : $(TARGET)
73
74 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
75
76 download :$(patsubst %,$(DIR_DL)/%,$(objects))
77
78 md5 : $(subst %,%_MD5,$(objects))
79
80 dist:
81 $(PAK)
82
83 ###############################################################################
84 # Downloading, checking, md5sum
85 ###############################################################################
86
87 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
88 @$(CHECK)
89
90 $(patsubst %,$(DIR_DL)/%,$(objects)) :
91 @$(LOAD)
92
93 $(subst %,%_MD5,$(objects)) :
94 @$(MD5)
95
96 ###############################################################################
97 # Installation Details
98 ###############################################################################
99
100 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
101 @$(PREBUILD)
102
103 # remove old directories and extract asterisk
104 @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)
105
106 # confiure asterisk
107 cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire
108
109 # enable additional features (include following sound-tars)
110 cd $(DIR_APP) && cp -fv $(DIR_SRC)/config/asterisk/asterisk.makeopts menuselect.makeopts
111
112 # add additional sounds
113 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-core-sounds-en-gsm-1.4.16.tar.gz $(DIR_APP)/sounds/
114 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-extra-sounds-en-gsm-1.4.9.tar.gz $(DIR_APP)/sounds/
115 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-moh-opsound-gsm.tar.gz $(DIR_APP)/sounds/
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 # extract and configure asterisk-addons
123 cd $(DIR_SRC) && tar zxf $(DIR_DL)/asterisk-addons-1.4.9.tar.gz
124 cd $(DIR_SRC)/asterisk-addons-* && ./configure --prefix=/usr --sysconfdir=/var/ipfire
125 # enable additional features (--> NOT NEEDED, DEFAULT CONFIG INCLUDES ALL)
126 #cd $(DIR_SRC)/asterisk-addons-* && cp -f $(DIR_SRC)/config/asterisk/addons.makeopts menuselect.makeopts
127 # make and install asterisk-addons
128 cd $(DIR_SRC)/asterisk-addons-* && make $(MAKETUNING) all
129 cd $(DIR_SRC)/asterisk-addons-* && make install
130 cd $(DIR_SRC)/asterisk-addons-* && make samples
131
132 # add german sounds and remove README.txt
133 tar xfz $(DIR_DL)/asterisk-1.4-de-prompts.tar.gz -C /var/lib/asterisk/sounds/
134 -rm -f /var/lib/asterisk/sounds/README.txt
135
136 # remove build directories
137 @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-*
138
139 # copy additional ipfire scripts for asterisk
140 -mkdir -p /var/ipfire/asterisk
141 cp -vrf $(DIR_SRC)/config/asterisk/* /var/ipfire/asterisk/
142 chmod o+w /var/ipfire/asterisk
143 chown nobody:nobody -R /var/ipfire/asterisk
144 ln -f -s /var/ipfire/asterisk/wakeup/wakeup.sh /etc/fcron.minutely/wakeup.sh
145
146 # build and install chan capi (needed for isdn)
147 cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(CHAN_CAPI).tar.gz
148 cd $(DIR_SRC)/$(CHAN_CAPI) && make $(MAKETUNING)
149 cd $(DIR_SRC)/$(CHAN_CAPI) && make install
150 @rm -rf $(DIR_SRC)/$(CHAN_CAPI)
151
152 # build FAX stuff (TODO: get newer version... where to download source?)
153 cd $(DIR_SRC) && tar zxf $(DIR_DL)/agx-ast-addons-svn65.tgz
154 # bugfix: disable app_confcall (not supported with dahdi, but we can take meetme)
155 cd $(DIR_SRC)/agx-ast-addons && echo "project (agx-ast-addons-zaptel)" > ./app-dahdi/CMakeLists.txt
156 cd $(DIR_SRC)/agx-ast-addons && echo >> ./app-dahdi/CMakeLists.txt
157 # end bugfix
158 cd $(DIR_SRC)/agx-ast-addons && ./configure.sh
159 cd $(DIR_SRC)/agx-ast-addons && ./build.sh
160 @rm -rf $(DIR_SRC)/agx-ast-addons
161
162 # be sure all source is removed
163 @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-*
164
165 # remember backup-location
166 install -v -m 644 $(DIR_SRC)/config/backup/includes/asterisk /var/ipfire/backup/addons/includes/asterisk
167
168 # generate softlink (or asterisk will not work properly)
169 ln -sf /var/ipfire/asterisk /etc/asterisk
170
171 # make asterisk start with reboot
172 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc0.d/K30asterisk
173 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc6.d/K30asterisk
174 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc3.d/S30asterisk
175
176 # all done
177 @$(POSTBUILD)