]>
Commit | Line | Data |
---|---|---|
5e69ef1a | 1 | ############################################################################### |
5e69ef1a | 2 | # # |
70df8302 | 3 | # IPFire.org - A linux based firewall # |
eee037b8 | 4 | # Copyright (C) 2007-2018 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 | ||
13c5e366 | 23 | VER = 13.18.5 |
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 |
0f75603f | 31 | PAK_VER = 26 |
5e69ef1a | 32 | |
2dc2a278 | 33 | DEPS = libsrtp opus |
3489ebac | 34 | |
5e69ef1a MT |
35 | ############################################################################### |
36 | # Top-level Rules | |
37 | ############################################################################### | |
38 | ||
39 | objects = $(DL_FILE) \ | |
980245eb | 40 | asterisk-1.4-de-prompts.tar.gz \ |
13c5e366 | 41 | asterisk-extra-sounds-en-gsm-1.5.1.tar.gz \ |
ae77e0ba | 42 | asterisk-moh-opsound-gsm-2.03.tar.gz |
5e69ef1a MT |
43 | |
44 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
13c5e366 | 45 | asterisk-extra-sounds-en-gsm-1.5.1.tar.gz = $(URL_IPFIRE)/asterisk-extra-sounds-en-gsm-1.5.1.tar.gz |
eb5b3f95 | 46 | asterisk-moh-opsound-gsm-2.03.tar.gz = $(URL_IPFIRE)/asterisk-moh-opsound-gsm-2.03.tar.gz |
61d0d586 | 47 | asterisk-1.4-de-prompts.tar.gz = $(URL_IPFIRE)/asterisk-1.4-de-prompts.tar.gz |
5e69ef1a | 48 | |
13c5e366 MT |
49 | $(DL_FILE)_MD5 = 4ad2a5ab1dd12cba5f37fca52961aa2a |
50 | asterisk-extra-sounds-en-gsm-1.5.1.tar.gz_MD5 = aa1003ed984239f18e123decc39c2178 | |
eb5b3f95 | 51 | asterisk-moh-opsound-gsm-2.03.tar.gz_MD5 = 09066f55f1358f298bc1a6e4678a3ddf |
61d0d586 | 52 | asterisk-1.4-de-prompts.tar.gz_MD5 = 626a2b95071a5505851e43874dfbfd5c |
5e69ef1a MT |
53 | |
54 | install : $(TARGET) | |
55 | ||
56 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
57 | ||
58 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
59 | ||
60 | md5 : $(subst %,%_MD5,$(objects)) | |
61 | ||
62 | dist: | |
61d0d586 | 63 | $(PAK) |
5e69ef1a MT |
64 | |
65 | ############################################################################### | |
66 | # Downloading, checking, md5sum | |
67 | ############################################################################### | |
68 | ||
69 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
70 | @$(CHECK) | |
71 | ||
72 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
73 | @$(LOAD) | |
74 | ||
75 | $(subst %,%_MD5,$(objects)) : | |
76 | @$(MD5) | |
77 | ||
78 | ############################################################################### | |
79 | # Installation Details | |
80 | ############################################################################### | |
81 | ||
82 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
83 | @$(PREBUILD) | |
83167e38 | 84 | @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) |
fede18c5 | 85 | $(UPDATE_AUTOMAKE) |
b6541fec | 86 | |
ae77e0ba | 87 | # configure asterisk |
f1d418f5 DW |
88 | cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire \ |
89 | --without-oss \ | |
90 | --without-sdl \ | |
91 | --without-SDL_image \ | |
92 | --without-netsnmp \ | |
83167e38 DW |
93 | --without-avcodec \ |
94 | --without-vorbis \ | |
95 | --without-ogg \ | |
f1d418f5 | 96 | --disable-xmldoc |
b6541fec AF |
97 | |
98 | # enable additional features (include following sound-tars) | |
f1d418f5 DW |
99 | cd $(DIR_APP) && make menuselect.makeopts && menuselect/menuselect \ |
100 | --enable res_srtp \ | |
f1d418f5 DW |
101 | --enable EXTRA-SOUNDS-EN-GSM \ |
102 | --enable MOH-OPSOUND-GSM \ | |
04441d8a | 103 | --disable BUILD_NATIVE \ |
f1d418f5 | 104 | menuselect.makeopts |
b6541fec AF |
105 | |
106 | # add additional sounds | |
13c5e366 | 107 | cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-extra-sounds-en-gsm-1.5.1.tar.gz $(DIR_APP)/sounds/ |
eb5b3f95 | 108 | cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-moh-opsound-gsm-2.03.tar.gz $(DIR_APP)/sounds/ |
b6541fec | 109 | |
eb5b3f95 AF |
110 | # Fix wrong cpu optimization (march=armv5tel) |
111 | cd $(DIR_APP) && sed -i -e "s|^PROC=armv5te.*|PROC=armv5te|g" makeopts | |
112 | ||
113 | # Add armv5te to gsm codecs | |
114 | cd $(DIR_APP) && sed -i -e "s|armv5b |*armv5te |g" codecs/gsm/Makefile | |
821f9f50 | 115 | |
b6541fec | 116 | # compile and install |
6f61f8c6 MT |
117 | cd $(DIR_APP) && make $(MAKETUNING) all |
118 | cd $(DIR_APP) && make install | |
119 | cd $(DIR_APP) && make samples | |
b6541fec | 120 | |
b6541fec | 121 | # add german sounds and remove README.txt |
61d0d586 MT |
122 | tar xfz $(DIR_DL)/asterisk-1.4-de-prompts.tar.gz -C /var/lib/asterisk/sounds/ |
123 | -rm -f /var/lib/asterisk/sounds/README.txt | |
b6541fec AF |
124 | |
125 | # remove build directories | |
61d0d586 | 126 | @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* |
b6541fec AF |
127 | |
128 | # copy additional ipfire scripts for asterisk | |
42dc0090 CS |
129 | -mkdir -p /var/ipfire/asterisk |
130 | cp -vrf $(DIR_SRC)/config/asterisk/* /var/ipfire/asterisk/ | |
131 | chmod o+w /var/ipfire/asterisk | |
6257cba2 | 132 | chown nobody:nobody -R /var/ipfire/asterisk |
28b8e0ec | 133 | chown nobody:nobody -R /var/lib/asterisk |
b6541fec | 134 | |
b6541fec | 135 | # remember backup-location |
ef3002be | 136 | install -v -m 644 $(DIR_SRC)/config/backup/includes/asterisk /var/ipfire/backup/addons/includes/asterisk |
b6541fec | 137 | |
13c5e366 MT |
138 | # Logrotate |
139 | mkdir -pv /etc/logrotate.d | |
972f767f DW |
140 | install -v -m 644 $(DIR_SRC)/config/asterisk/asterisk.logrotate /etc/logrotate.d/asterisk |
141 | ||
b6541fec AF |
142 | # generate softlink (or asterisk will not work properly) |
143 | ln -sf /var/ipfire/asterisk /etc/asterisk | |
144 | ||
e7301348 JS |
145 | #install initscripts |
146 | $(call INSTALL_INITSCRIPT,asterisk) | |
147 | ||
b6541fec AF |
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 | ||
13c5e366 | 153 | @rm -rf $(DIR_APP) |
5e69ef1a | 154 | @$(POSTBUILD) |