]>
Commit | Line | Data |
---|---|---|
1 | ############################################################################### | |
2 | # # | |
3 | # IPFire.org - A linux based firewall # | |
4 | # Copyright (C) 2007-2012 IPFire Team <info@ipfire.org> # | |
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.8.19.0 | |
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 = 8 | |
36 | ||
37 | CHAN_CAPI = chan_capi-20120614 | |
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-extra-sounds-en-gsm-1.4.11.tar.gz \ | |
48 | asterisk-moh-opsound-gsm-2.03.tar.gz \ | |
49 | $(CHAN_CAPI).tgz | |
50 | ||
51 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
52 | asterisk-extra-sounds-en-gsm-1.4.11.tar.gz = $(URL_IPFIRE)/asterisk-extra-sounds-en-gsm-1.4.11.tar.gz | |
53 | asterisk-moh-opsound-gsm-2.03.tar.gz = $(URL_IPFIRE)/asterisk-moh-opsound-gsm-2.03.tar.gz | |
54 | asterisk-1.4-de-prompts.tar.gz = $(URL_IPFIRE)/asterisk-1.4-de-prompts.tar.gz | |
55 | $(CHAN_CAPI).tgz = $(URL_IPFIRE)/$(CHAN_CAPI).tgz | |
56 | ||
57 | $(DL_FILE)_MD5 = dc98436846cc2de57100d78747b1bdd1 | |
58 | asterisk-extra-sounds-en-gsm-1.4.11.tar.gz_MD5 = 5479cb4cb81d678304d96f35e4933a11 | |
59 | asterisk-moh-opsound-gsm-2.03.tar.gz_MD5 = 09066f55f1358f298bc1a6e4678a3ddf | |
60 | asterisk-1.4-de-prompts.tar.gz_MD5 = 626a2b95071a5505851e43874dfbfd5c | |
61 | $(CHAN_CAPI).tgz_MD5 = c190f44eb362bf258b27f92c3458e4bf | |
62 | ||
63 | install : $(TARGET) | |
64 | ||
65 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
66 | ||
67 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
68 | ||
69 | md5 : $(subst %,%_MD5,$(objects)) | |
70 | ||
71 | dist: | |
72 | $(PAK) | |
73 | ||
74 | ############################################################################### | |
75 | # Downloading, checking, md5sum | |
76 | ############################################################################### | |
77 | ||
78 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
79 | @$(CHECK) | |
80 | ||
81 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
82 | @$(LOAD) | |
83 | ||
84 | $(subst %,%_MD5,$(objects)) : | |
85 | @$(MD5) | |
86 | ||
87 | ############################################################################### | |
88 | # Installation Details | |
89 | ############################################################################### | |
90 | ||
91 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
92 | @$(PREBUILD) | |
93 | ||
94 | # remove old directories and extract asterisk | |
95 | @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) | |
96 | ||
97 | # confiure asterisk | |
98 | cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire | |
99 | ||
100 | # enable additional features (include following sound-tars) | |
101 | cd $(DIR_APP) && cp -fv $(DIR_SRC)/config/asterisk/asterisk.makeopts menuselect.makeopts | |
102 | ||
103 | # add additional sounds | |
104 | cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-extra-sounds-en-gsm-1.4.11.tar.gz $(DIR_APP)/sounds/ | |
105 | cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-moh-opsound-gsm-2.03.tar.gz $(DIR_APP)/sounds/ | |
106 | ||
107 | # Fix wrong cpu optimization (march=armv5tel) | |
108 | cd $(DIR_APP) && sed -i -e "s|^PROC=armv5te.*|PROC=armv5te|g" makeopts | |
109 | ||
110 | # Add armv5te to gsm codecs | |
111 | cd $(DIR_APP) && sed -i -e "s|armv5b |*armv5te |g" codecs/gsm/Makefile | |
112 | ||
113 | # compile and install | |
114 | cd $(DIR_APP) && make $(MAKETUNING) all | |
115 | cd $(DIR_APP) && make install | |
116 | cd $(DIR_APP) && make samples | |
117 | ||
118 | # add german sounds and remove README.txt | |
119 | tar xfz $(DIR_DL)/asterisk-1.4-de-prompts.tar.gz -C /var/lib/asterisk/sounds/ | |
120 | -rm -f /var/lib/asterisk/sounds/README.txt | |
121 | ||
122 | # remove build directories | |
123 | @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* | |
124 | ||
125 | # copy additional ipfire scripts for asterisk | |
126 | -mkdir -p /var/ipfire/asterisk | |
127 | cp -vrf $(DIR_SRC)/config/asterisk/* /var/ipfire/asterisk/ | |
128 | chmod o+w /var/ipfire/asterisk | |
129 | chown nobody:nobody -R /var/ipfire/asterisk | |
130 | ln -f -s /var/ipfire/asterisk/wakeup/wakeup.sh /etc/fcron.minutely/wakeup.sh | |
131 | ||
132 | # build and install chan capi (needed for isdn) | |
133 | cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(CHAN_CAPI).tgz | |
134 | cd $(DIR_SRC)/chan-capi-HEAD && sed -i -e 's/^CFLAGS+=-Wno-unused-but-set-variable$$//' Makefile | |
135 | cd $(DIR_SRC)/chan-capi-HEAD && make $(MAKETUNING) | |
136 | cd $(DIR_SRC)/chan-capi-HEAD && make install | |
137 | @rm -rf $(DIR_SRC)/chan-capi-HEAD | |
138 | ||
139 | # be sure all source is removed | |
140 | @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* | |
141 | ||
142 | # remember backup-location | |
143 | install -v -m 644 $(DIR_SRC)/config/backup/includes/asterisk /var/ipfire/backup/addons/includes/asterisk | |
144 | ||
145 | # generate softlink (or asterisk will not work properly) | |
146 | ln -sf /var/ipfire/asterisk /etc/asterisk | |
147 | ||
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 | ||
153 | # all done | |
154 | @$(POSTBUILD) |