]>
Commit | Line | Data |
---|---|---|
5e69ef1a | 1 | ############################################################################### |
5e69ef1a | 2 | # # |
70df8302 MT |
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 # | |
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 | ||
b6541fec | 27 | VER = 1.4.26.3 |
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 |
b6541fec | 35 | PAK_VER = 5 |
5e69ef1a | 36 | |
b6541fec | 37 | CHAN_CAPI = chan_capi-1.1.4 |
83bac7f3 | 38 | |
b6541fec AF |
39 | DEPS = "libpri spandsp sox dahdi" |
40 | # | |
41 | # TODO: checked all needed dependencies for asterisk 1.4.26 | |
42 | # started from clean system, checked all libs with ldd and | |
43 | # found this ones: | |
44 | # "libpri dahdi-tools dahdi-linux alsa cyrus-sasl libogg libtiff libvorbis netsnmpd spandsp" | |
45 | # | |
3489ebac | 46 | |
5e69ef1a MT |
47 | ############################################################################### |
48 | # Top-level Rules | |
49 | ############################################################################### | |
50 | ||
51 | objects = $(DL_FILE) \ | |
61d0d586 | 52 | asterisk-1.4-de-prompts.tar.gz \ |
b6541fec AF |
53 | asterisk-core-sounds-en-alaw-1.4.15.tar.gz \ |
54 | asterisk-extra-sounds-en-alaw-1.4.9.tar.gz \ | |
55 | asterisk-addons-1.4.9.tar.gz \ | |
56 | agx-ast-addons-svn65.tgz \ | |
83bac7f3 | 57 | $(CHAN_CAPI).tar.gz |
5e69ef1a MT |
58 | |
59 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
b6541fec AF |
60 | asterisk-core-sounds-en-alaw-1.4.15.tar.gz = $(URL_IPFIRE)/asterisk-core-sounds-en-alaw-1.4.15.tar.gz |
61 | asterisk-extra-sounds-en-alaw-1.4.9.tar.gz = $(URL_IPFIRE)/asterisk-extra-sounds-en-alaw-1.4.9.tar.gz | |
61d0d586 | 62 | asterisk-1.4-de-prompts.tar.gz = $(URL_IPFIRE)/asterisk-1.4-de-prompts.tar.gz |
b6541fec AF |
63 | asterisk-addons-1.4.9.tar.gz = $(URL_IPFIRE)/asterisk-addons-1.4.9.tar.gz |
64 | agx-ast-addons-svn65.tgz = $(URL_IPFIRE)/agx-ast-addons-svn65.tgz | |
83bac7f3 | 65 | $(CHAN_CAPI).tar.gz = $(URL_IPFIRE)/$(CHAN_CAPI).tar.gz |
5e69ef1a | 66 | |
b6541fec AF |
67 | $(DL_FILE)_MD5 = 04017dfdc8caeb8f4663b5dc4a9e1019 |
68 | asterisk-core-sounds-en-alaw-1.4.15.tar.gz_MD5 = e9531e871d5b24e7b83d3ef946390d40 | |
69 | asterisk-extra-sounds-en-alaw-1.4.9.tar.gz_MD5 = 4fa1b8d096a66b3a39b6d0e52fe3f1ad | |
61d0d586 | 70 | asterisk-1.4-de-prompts.tar.gz_MD5 = 626a2b95071a5505851e43874dfbfd5c |
b6541fec AF |
71 | asterisk-addons-1.4.9.tar.gz_MD5 = 0c0ddf2386a9541e416e122ca082e611 |
72 | agx-ast-addons-svn65.tgz_MD5 = 9372d818cc68337658110f793d0fd8e0 | |
73 | $(CHAN_CAPI).tar.gz_MD5 = 18fa835e724b7814deafbfa5b8cb01eb | |
5e69ef1a MT |
74 | |
75 | install : $(TARGET) | |
76 | ||
77 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
78 | ||
79 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
80 | ||
81 | md5 : $(subst %,%_MD5,$(objects)) | |
82 | ||
83 | dist: | |
61d0d586 | 84 | $(PAK) |
5e69ef1a MT |
85 | |
86 | ############################################################################### | |
87 | # Downloading, checking, md5sum | |
88 | ############################################################################### | |
89 | ||
90 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
91 | @$(CHECK) | |
92 | ||
93 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
94 | @$(LOAD) | |
95 | ||
96 | $(subst %,%_MD5,$(objects)) : | |
97 | @$(MD5) | |
98 | ||
99 | ############################################################################### | |
100 | # Installation Details | |
101 | ############################################################################### | |
102 | ||
103 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
104 | @$(PREBUILD) | |
b6541fec AF |
105 | |
106 | # remove old directories and extract asterisk | |
107 | @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) | |
108 | ||
109 | # confiure asterisk | |
6f61f8c6 | 110 | cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire |
b6541fec AF |
111 | |
112 | # enable additional features (include following sound-tars) | |
113 | cd $(DIR_APP) && cp -fv $(DIR_SRC)/config/asterisk/asterisk.makeopts menuselect.makeopts | |
114 | ||
115 | # add additional sounds | |
116 | cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-core-sounds-en-alaw-1.4.15.tar.gz $(DIR_APP)/sounds/asterisk-core-sounds-en-alaw-1.4.15.tar.gz | |
117 | cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-extra-sounds-en-alaw-1.4.9.tar.gz $(DIR_APP)/sounds/asterisk-extra-sounds-en-alaw-1.4.9.tar.gz | |
118 | ||
119 | # compile and install | |
6f61f8c6 MT |
120 | cd $(DIR_APP) && make $(MAKETUNING) all |
121 | cd $(DIR_APP) && make install | |
122 | cd $(DIR_APP) && make samples | |
b6541fec AF |
123 | |
124 | # extract and configure asterisk-addons | |
125 | cd $(DIR_SRC) && tar zxf $(DIR_DL)/asterisk-addons-1.4.9.tar.gz | |
126 | cd $(DIR_SRC)/asterisk-addons-* && ./configure --prefix=/usr --sysconfdir=/var/ipfire | |
127 | # enable additional features (--> NOT NEEDED, DEFAULT CONFIG INCLUDES ALL) | |
128 | #cd $(DIR_SRC)/asterisk-addons-* && cp -f $(DIR_SRC)/config/asterisk/addons.makeopts menuselect.makeopts | |
129 | # make and install asterisk-addons | |
130 | cd $(DIR_SRC)/asterisk-addons-* && make $(MAKETUNING) all | |
131 | cd $(DIR_SRC)/asterisk-addons-* && make install | |
132 | cd $(DIR_SRC)/asterisk-addons-* && make samples | |
133 | ||
134 | # add german sounds and remove README.txt | |
61d0d586 MT |
135 | tar xfz $(DIR_DL)/asterisk-1.4-de-prompts.tar.gz -C /var/lib/asterisk/sounds/ |
136 | -rm -f /var/lib/asterisk/sounds/README.txt | |
b6541fec AF |
137 | |
138 | # remove build directories | |
61d0d586 | 139 | @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* |
b6541fec AF |
140 | |
141 | # copy additional ipfire scripts for asterisk | |
42dc0090 CS |
142 | -mkdir -p /var/ipfire/asterisk |
143 | cp -vrf $(DIR_SRC)/config/asterisk/* /var/ipfire/asterisk/ | |
144 | chmod o+w /var/ipfire/asterisk | |
6257cba2 | 145 | chown nobody:nobody -R /var/ipfire/asterisk |
42dc0090 | 146 | ln -f -s /var/ipfire/asterisk/wakeup/wakeup.sh /etc/fcron.minutely/wakeup.sh |
b6541fec AF |
147 | |
148 | # build and install chan capi (needed for isdn) | |
83bac7f3 MT |
149 | cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(CHAN_CAPI).tar.gz |
150 | cd $(DIR_SRC)/$(CHAN_CAPI) && make $(MAKETUNING) | |
151 | cd $(DIR_SRC)/$(CHAN_CAPI) && make install | |
b6541fec AF |
152 | @rm -rf $(DIR_SRC)/$(CHAN_CAPI) |
153 | ||
154 | # build FAX stuff (TODO: get newer version... where to download source?) | |
155 | cd $(DIR_SRC) && tar zxf $(DIR_DL)/agx-ast-addons-svn65.tgz | |
156 | # bugfix: disable app_confcall (not supported with dahdi, but we can take meetme) | |
157 | cd $(DIR_SRC)/agx-ast-addons && echo "project (agx-ast-addons-zaptel)" > ./app-dahdi/CMakeLists.txt | |
158 | cd $(DIR_SRC)/agx-ast-addons && echo >> ./app-dahdi/CMakeLists.txt | |
159 | # end bugfix | |
160 | cd $(DIR_SRC)/agx-ast-addons && ./configure.sh | |
3926e90d | 161 | cd $(DIR_SRC)/agx-ast-addons && ./build.sh |
b6541fec AF |
162 | @rm -rf $(DIR_SRC)/agx-ast-addons |
163 | ||
164 | # be sure all source is removed | |
165 | @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* | |
166 | ||
167 | # remember backup-location | |
ef3002be | 168 | install -v -m 644 $(DIR_SRC)/config/backup/includes/asterisk /var/ipfire/backup/addons/includes/asterisk |
b6541fec AF |
169 | |
170 | # generate softlink (or asterisk will not work properly) | |
171 | ln -sf /var/ipfire/asterisk /etc/asterisk | |
172 | ||
173 | # make asterisk start with reboot | |
174 | ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc0.d/K30asterisk | |
175 | ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc6.d/K30asterisk | |
176 | ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc3.d/S30asterisk | |
177 | ||
178 | # all done | |
5e69ef1a | 179 | @$(POSTBUILD) |