]>
Commit | Line | Data |
---|---|---|
5e69ef1a | 1 | ############################################################################### |
5e69ef1a | 2 | # # |
70df8302 | 3 | # IPFire.org - A linux based firewall # |
821f9f50 | 4 | # Copyright (C) 2007-2011 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 | ||
25 | include Config | |
26 | ||
e659ba5b | 27 | VER = 1.8.13.0 |
5e69ef1a MT |
28 | |
29 | THISAPP = asterisk-$(VER) | |
30 | DL_FILE = $(THISAPP).tar.gz | |
1751628e | 31 | DL_FROM = $(URL_IPFIRE) |
5e69ef1a MT |
32 | DIR_APP = $(DIR_SRC)/$(THISAPP) |
33 | TARGET = $(DIR_INFO)/$(THISAPP) | |
a8b159e7 | 34 | PROG = asterisk |
e659ba5b | 35 | PAK_VER = 7 |
5e69ef1a | 36 | |
e659ba5b | 37 | CHAN_CAPI = chan_capi-20120614 |
83bac7f3 | 38 | |
980245eb | 39 | DEPS = "libpri libtiff libvorbis libogg spandsp netsnmpd" |
3489ebac | 40 | |
5e69ef1a MT |
41 | ############################################################################### |
42 | # Top-level Rules | |
43 | ############################################################################### | |
44 | ||
45 | objects = $(DL_FILE) \ | |
980245eb | 46 | asterisk-1.4-de-prompts.tar.gz \ |
eb5b3f95 AF |
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 \ | |
e659ba5b | 50 | $(CHAN_CAPI).tgz |
5e69ef1a MT |
51 | |
52 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
eb5b3f95 AF |
53 | asterisk-core-sounds-en-gsm-1.4.22.tar.gz = $(URL_IPFIRE)/asterisk-core-sounds-en-gsm-1.4.22.tar.gz |
54 | asterisk-extra-sounds-en-gsm-1.4.11.tar.gz = $(URL_IPFIRE)/asterisk-extra-sounds-en-gsm-1.4.11.tar.gz | |
55 | asterisk-moh-opsound-gsm-2.03.tar.gz = $(URL_IPFIRE)/asterisk-moh-opsound-gsm-2.03.tar.gz | |
61d0d586 | 56 | asterisk-1.4-de-prompts.tar.gz = $(URL_IPFIRE)/asterisk-1.4-de-prompts.tar.gz |
e659ba5b | 57 | $(CHAN_CAPI).tgz = $(URL_IPFIRE)/$(CHAN_CAPI).tgz |
5e69ef1a | 58 | |
e659ba5b | 59 | $(DL_FILE)_MD5 = e7f2cb19068c1211c907062f9e96c47a |
eb5b3f95 AF |
60 | asterisk-core-sounds-en-gsm-1.4.22.tar.gz_MD5 = 2a99a45c0675135255bc65796b12f7c6 |
61 | asterisk-extra-sounds-en-gsm-1.4.11.tar.gz_MD5 = 5479cb4cb81d678304d96f35e4933a11 | |
62 | asterisk-moh-opsound-gsm-2.03.tar.gz_MD5 = 09066f55f1358f298bc1a6e4678a3ddf | |
61d0d586 | 63 | asterisk-1.4-de-prompts.tar.gz_MD5 = 626a2b95071a5505851e43874dfbfd5c |
e659ba5b | 64 | $(CHAN_CAPI).tgz_MD5 = c190f44eb362bf258b27f92c3458e4bf |
5e69ef1a MT |
65 | |
66 | install : $(TARGET) | |
67 | ||
68 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
69 | ||
70 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
71 | ||
72 | md5 : $(subst %,%_MD5,$(objects)) | |
73 | ||
74 | dist: | |
61d0d586 | 75 | $(PAK) |
5e69ef1a MT |
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) | |
b6541fec AF |
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 | |
6f61f8c6 | 101 | cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire |
b6541fec AF |
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 | |
eb5b3f95 AF |
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/ | |
b6541fec | 110 | |
eb5b3f95 AF |
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 | |
821f9f50 | 116 | |
b6541fec | 117 | # compile and install |
6f61f8c6 MT |
118 | cd $(DIR_APP) && make $(MAKETUNING) all |
119 | cd $(DIR_APP) && make install | |
120 | cd $(DIR_APP) && make samples | |
b6541fec | 121 | |
b6541fec | 122 | # add german sounds and remove README.txt |
61d0d586 MT |
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 | |
b6541fec AF |
125 | |
126 | # remove build directories | |
61d0d586 | 127 | @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* |
b6541fec AF |
128 | |
129 | # copy additional ipfire scripts for asterisk | |
42dc0090 CS |
130 | -mkdir -p /var/ipfire/asterisk |
131 | cp -vrf $(DIR_SRC)/config/asterisk/* /var/ipfire/asterisk/ | |
132 | chmod o+w /var/ipfire/asterisk | |
6257cba2 | 133 | chown nobody:nobody -R /var/ipfire/asterisk |
42dc0090 | 134 | ln -f -s /var/ipfire/asterisk/wakeup/wakeup.sh /etc/fcron.minutely/wakeup.sh |
b6541fec AF |
135 | |
136 | # build and install chan capi (needed for isdn) | |
e659ba5b JL |
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 | |
b6541fec | 142 | |
b6541fec AF |
143 | # be sure all source is removed |
144 | @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* | |
145 | ||
146 | # remember backup-location | |
ef3002be | 147 | install -v -m 644 $(DIR_SRC)/config/backup/includes/asterisk /var/ipfire/backup/addons/includes/asterisk |
b6541fec AF |
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 | |
5e69ef1a | 158 | @$(POSTBUILD) |