]> git.ipfire.org Git - ipfire-2.x.git/blob - lfs/asterisk
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into asterisk-update
[ipfire-2.x.git] / lfs / asterisk
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 include Config
22
23 VER = 11.10.0
24
25 THISAPP = asterisk-$(VER)
26 DL_FILE = $(THISAPP).tar.gz
27 DL_FROM = $(URL_IPFIRE)
28 DIR_APP = $(DIR_SRC)/$(THISAPP)
29 TARGET = $(DIR_INFO)/$(THISAPP)
30 PROG = asterisk
31 PAK_VER = 11
32
33 DEPS = "sqlite"
34
35 ###############################################################################
36 # Top-level Rules
37 ###############################################################################
38
39 objects = $(DL_FILE) \
40 asterisk-1.4-de-prompts.tar.gz \
41 asterisk-extra-sounds-en-gsm-1.4.14.tar.gz \
42 asterisk-moh-opsound-gsm-2.03.tar.gz
43
44 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
45 asterisk-extra-sounds-en-gsm-1.4.14.tar.gz = $(URL_IPFIRE)/asterisk-extra-sounds-en-gsm-1.4.14.tar.gz
46 asterisk-moh-opsound-gsm-2.03.tar.gz = $(URL_IPFIRE)/asterisk-moh-opsound-gsm-2.03.tar.gz
47 asterisk-1.4-de-prompts.tar.gz = $(URL_IPFIRE)/asterisk-1.4-de-prompts.tar.gz
48
49 $(DL_FILE)_MD5 = 47384cd1ff48b306dca6e03027b023bd
50 asterisk-extra-sounds-en-gsm-1.4.14.tar.gz_MD5 = ffc2e0ffd783c03fef5b75277dba0896
51 asterisk-moh-opsound-gsm-2.03.tar.gz_MD5 = 09066f55f1358f298bc1a6e4678a3ddf
52 asterisk-1.4-de-prompts.tar.gz_MD5 = 626a2b95071a5505851e43874dfbfd5c
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:
63 $(PAK)
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)
84
85 # remove old directories and extract asterisk
86 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
87
88 # patch asterisk
89 cd $(DIR_APP) && patch -p4 < $(DIR_SRC)/src/patches/asterisk-no-ffmpeg.patch
90 cd $(DIR_APP) && patch -p1 < $(DIR_SRC)/src/patches/asterisk-ssl-reader-should-block.patch
91
92 # configure asterisk
93 cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire \
94 --without-oss \
95 --without-sdl \
96 --without-SDL_image \
97 --without-netsnmp \
98 --without-avcodec \
99 --without-vorbis \
100 --without-ogg \
101 --without-spandsp \
102 --disable-xmldoc
103
104 # enable additional features (include following sound-tars)
105 cd $(DIR_APP) && make menuselect.makeopts && menuselect/menuselect \
106 --enable res_srtp \
107 --enable app_mysql \
108 --enable cdr_mysql \
109 --enable res_config_mysql \
110 --enable EXTRA-SOUNDS-EN-GSM \
111 --enable MOH-OPSOUND-GSM \
112 menuselect.makeopts
113
114 # add additional sounds
115 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-extra-sounds-en-gsm-1.4.14.tar.gz $(DIR_APP)/sounds/
116 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-moh-opsound-gsm-2.03.tar.gz $(DIR_APP)/sounds/
117
118 # Fix wrong cpu optimization (march=armv5tel)
119 cd $(DIR_APP) && sed -i -e "s|^PROC=armv5te.*|PROC=armv5te|g" makeopts
120
121 # Add armv5te to gsm codecs
122 cd $(DIR_APP) && sed -i -e "s|armv5b |*armv5te |g" codecs/gsm/Makefile
123
124 # compile and install
125 cd $(DIR_APP) && make $(MAKETUNING) all
126 cd $(DIR_APP) && make install
127 cd $(DIR_APP) && make samples
128
129 # add german sounds and remove README.txt
130 tar xfz $(DIR_DL)/asterisk-1.4-de-prompts.tar.gz -C /var/lib/asterisk/sounds/
131 -rm -f /var/lib/asterisk/sounds/README.txt
132
133 # remove build directories
134 @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-*
135
136 # copy additional ipfire scripts for asterisk
137 -mkdir -p /var/ipfire/asterisk
138 cp -vrf $(DIR_SRC)/config/asterisk/* /var/ipfire/asterisk/
139 chmod o+w /var/ipfire/asterisk
140 chown nobody:nobody -R /var/ipfire/asterisk
141 chown nobody:nobody -R /var/lib/asterisk
142
143 # be sure all source is removed
144 @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* $(DIR_SRC)/libsrtp*
145
146 # remember backup-location
147 install -v -m 644 $(DIR_SRC)/config/backup/includes/asterisk /var/ipfire/backup/addons/includes/asterisk
148
149 # Logrotate
150 mkdir -pv /etc/logrotate.d
151 install -v -m 644 $(DIR_SRC)/config/asterisk/asterisk.logrotate /etc/logrotate.d/asterisk
152
153 # generate softlink (or asterisk will not work properly)
154 ln -sf /var/ipfire/asterisk /etc/asterisk
155
156 # make asterisk start with reboot
157 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc0.d/K30asterisk
158 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc6.d/K30asterisk
159 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc3.d/S30asterisk
160
161 # all done
162 @$(POSTBUILD)