]>
Commit | Line | Data |
---|---|---|
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 | ||
5e69ef1a MT |
21 | include Config |
22 | ||
e65da0a8 | 23 | VER = 11.10.0 |
5e69ef1a MT |
24 | |
25 | THISAPP = asterisk-$(VER) | |
26 | DL_FILE = $(THISAPP).tar.gz | |
1751628e | 27 | DL_FROM = $(URL_IPFIRE) |
5e69ef1a MT |
28 | DIR_APP = $(DIR_SRC)/$(THISAPP) |
29 | TARGET = $(DIR_INFO)/$(THISAPP) | |
a8b159e7 | 30 | PROG = asterisk |
e65da0a8 | 31 | PAK_VER = 11 |
5e69ef1a | 32 | |
83167e38 | 33 | DEPS = "sqlite" |
3489ebac | 34 | |
5e69ef1a MT |
35 | ############################################################################### |
36 | # Top-level Rules | |
37 | ############################################################################### | |
38 | ||
39 | objects = $(DL_FILE) \ | |
5e55b70d | 40 | libsrtp-1.4.5-99426a54.tar.gz \ |
980245eb | 41 | asterisk-1.4-de-prompts.tar.gz \ |
ae77e0ba DW |
42 | asterisk-extra-sounds-en-gsm-1.4.14.tar.gz \ |
43 | asterisk-moh-opsound-gsm-2.03.tar.gz | |
5e69ef1a MT |
44 | |
45 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
5e55b70d | 46 | libsrtp-1.4.5-99426a54.tar.gz = $(URL_IPFIRE)/libsrtp-1.4.5-99426a54.tar.gz |
ae77e0ba | 47 | asterisk-extra-sounds-en-gsm-1.4.14.tar.gz = $(URL_IPFIRE)/asterisk-extra-sounds-en-gsm-1.4.14.tar.gz |
eb5b3f95 | 48 | asterisk-moh-opsound-gsm-2.03.tar.gz = $(URL_IPFIRE)/asterisk-moh-opsound-gsm-2.03.tar.gz |
61d0d586 | 49 | asterisk-1.4-de-prompts.tar.gz = $(URL_IPFIRE)/asterisk-1.4-de-prompts.tar.gz |
5e69ef1a | 50 | |
e65da0a8 | 51 | $(DL_FILE)_MD5 = 47384cd1ff48b306dca6e03027b023bd |
5e55b70d | 52 | libsrtp-1.4.5-99426a54.tar.gz_MD5 = 05bfbe63a2a27343889c2436c836110a |
ae77e0ba | 53 | asterisk-extra-sounds-en-gsm-1.4.14.tar.gz_MD5 = ffc2e0ffd783c03fef5b75277dba0896 |
eb5b3f95 | 54 | asterisk-moh-opsound-gsm-2.03.tar.gz_MD5 = 09066f55f1358f298bc1a6e4678a3ddf |
61d0d586 | 55 | asterisk-1.4-de-prompts.tar.gz_MD5 = 626a2b95071a5505851e43874dfbfd5c |
5e69ef1a MT |
56 | |
57 | install : $(TARGET) | |
58 | ||
59 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
60 | ||
61 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
62 | ||
63 | md5 : $(subst %,%_MD5,$(objects)) | |
64 | ||
65 | dist: | |
61d0d586 | 66 | $(PAK) |
5e69ef1a MT |
67 | |
68 | ############################################################################### | |
69 | # Downloading, checking, md5sum | |
70 | ############################################################################### | |
71 | ||
72 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
73 | @$(CHECK) | |
74 | ||
75 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
76 | @$(LOAD) | |
77 | ||
78 | $(subst %,%_MD5,$(objects)) : | |
79 | @$(MD5) | |
80 | ||
81 | ############################################################################### | |
82 | # Installation Details | |
83 | ############################################################################### | |
84 | ||
85 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
86 | @$(PREBUILD) | |
b6541fec | 87 | |
351aba94 | 88 | # build srtp |
5e55b70d DW |
89 | @rm -rf $(DIR_SRC)/srtp && cd $(DIR_SRC) && tar zxf $(DIR_DL)/libsrtp-1.4.5-99426a54.tar.gz |
90 | cd $(DIR_SRC)/libsrtp-1.4.5 && ./configure --prefix=/usr && make uninstall && make && make install | |
351aba94 | 91 | |
b6541fec | 92 | # remove old directories and extract asterisk |
83167e38 | 93 | @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) |
b6541fec | 94 | |
83167e38 DW |
95 | # patch asterisk |
96 | cd $(DIR_APP) && patch -p4 < $(DIR_SRC)/src/patches/asterisk-no-ffmpeg.patch | |
5e55b70d DW |
97 | cd $(DIR_APP) && patch -p1 < $(DIR_SRC)/src/patches/asterisk-ssl-reader-should-block.patch |
98 | ||
ae77e0ba | 99 | # configure asterisk |
f1d418f5 DW |
100 | cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire \ |
101 | --without-oss \ | |
102 | --without-sdl \ | |
103 | --without-SDL_image \ | |
104 | --without-netsnmp \ | |
83167e38 DW |
105 | --without-avcodec \ |
106 | --without-vorbis \ | |
107 | --without-ogg \ | |
108 | --without-spandsp \ | |
f1d418f5 | 109 | --disable-xmldoc |
b6541fec AF |
110 | |
111 | # enable additional features (include following sound-tars) | |
f1d418f5 DW |
112 | cd $(DIR_APP) && make menuselect.makeopts && menuselect/menuselect \ |
113 | --enable res_srtp \ | |
114 | --enable app_mysql \ | |
115 | --enable cdr_mysql \ | |
116 | --enable res_config_mysql \ | |
117 | --enable EXTRA-SOUNDS-EN-GSM \ | |
118 | --enable MOH-OPSOUND-GSM \ | |
119 | menuselect.makeopts | |
b6541fec AF |
120 | |
121 | # add additional sounds | |
ae77e0ba | 122 | cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-extra-sounds-en-gsm-1.4.14.tar.gz $(DIR_APP)/sounds/ |
eb5b3f95 | 123 | cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-moh-opsound-gsm-2.03.tar.gz $(DIR_APP)/sounds/ |
b6541fec | 124 | |
eb5b3f95 AF |
125 | # Fix wrong cpu optimization (march=armv5tel) |
126 | cd $(DIR_APP) && sed -i -e "s|^PROC=armv5te.*|PROC=armv5te|g" makeopts | |
127 | ||
128 | # Add armv5te to gsm codecs | |
129 | cd $(DIR_APP) && sed -i -e "s|armv5b |*armv5te |g" codecs/gsm/Makefile | |
821f9f50 | 130 | |
b6541fec | 131 | # compile and install |
6f61f8c6 MT |
132 | cd $(DIR_APP) && make $(MAKETUNING) all |
133 | cd $(DIR_APP) && make install | |
134 | cd $(DIR_APP) && make samples | |
b6541fec | 135 | |
b6541fec | 136 | # add german sounds and remove README.txt |
61d0d586 MT |
137 | tar xfz $(DIR_DL)/asterisk-1.4-de-prompts.tar.gz -C /var/lib/asterisk/sounds/ |
138 | -rm -f /var/lib/asterisk/sounds/README.txt | |
b6541fec AF |
139 | |
140 | # remove build directories | |
61d0d586 | 141 | @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* |
b6541fec AF |
142 | |
143 | # copy additional ipfire scripts for asterisk | |
42dc0090 CS |
144 | -mkdir -p /var/ipfire/asterisk |
145 | cp -vrf $(DIR_SRC)/config/asterisk/* /var/ipfire/asterisk/ | |
146 | chmod o+w /var/ipfire/asterisk | |
6257cba2 | 147 | chown nobody:nobody -R /var/ipfire/asterisk |
28b8e0ec | 148 | chown nobody:nobody -R /var/lib/asterisk |
42dc0090 | 149 | ln -f -s /var/ipfire/asterisk/wakeup/wakeup.sh /etc/fcron.minutely/wakeup.sh |
b6541fec | 150 | |
b6541fec | 151 | # be sure all source is removed |
5e55b70d | 152 | @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* $(DIR_SRC)/libsrtp* |
b6541fec AF |
153 | |
154 | # remember backup-location | |
ef3002be | 155 | install -v -m 644 $(DIR_SRC)/config/backup/includes/asterisk /var/ipfire/backup/addons/includes/asterisk |
b6541fec AF |
156 | |
157 | # generate softlink (or asterisk will not work properly) | |
158 | ln -sf /var/ipfire/asterisk /etc/asterisk | |
159 | ||
160 | # make asterisk start with reboot | |
161 | ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc0.d/K30asterisk | |
162 | ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc6.d/K30asterisk | |
163 | ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc3.d/S30asterisk | |
164 | ||
165 | # all done | |
5e69ef1a | 166 | @$(POSTBUILD) |