]> git.ipfire.org Git - people/arne_f/ipfire-2.x.git/blame - lfs/asterisk
tor: Increase PAK_VER for shipping modified CGI file.
[people/arne_f/ipfire-2.x.git] / lfs / asterisk
CommitLineData
5e69ef1a 1###############################################################################
5e69ef1a 2# #
70df8302 3# IPFire.org - A linux based firewall #
11b5b85c 4# Copyright (C) 2007-2012 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
21include Config
22
70956410 23VER = 11.16.0
5e69ef1a
MT
24
25THISAPP = asterisk-$(VER)
26DL_FILE = $(THISAPP).tar.gz
1751628e 27DL_FROM = $(URL_IPFIRE)
5e69ef1a
MT
28DIR_APP = $(DIR_SRC)/$(THISAPP)
29TARGET = $(DIR_INFO)/$(THISAPP)
a8b159e7 30PROG = asterisk
70956410 31PAK_VER = 15
5e69ef1a 32
8392627c 33DEPS = "libsrtp"
3489ebac 34
5e69ef1a
MT
35###############################################################################
36# Top-level Rules
37###############################################################################
38
39objects = $(DL_FILE) \
980245eb 40 asterisk-1.4-de-prompts.tar.gz \
8667a65b 41 asterisk-extra-sounds-en-gsm-1.4.15.tar.gz \
ae77e0ba 42 asterisk-moh-opsound-gsm-2.03.tar.gz
5e69ef1a
MT
43
44$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
8667a65b 45asterisk-extra-sounds-en-gsm-1.4.15.tar.gz = $(URL_IPFIRE)/asterisk-extra-sounds-en-gsm-1.4.15.tar.gz
eb5b3f95 46asterisk-moh-opsound-gsm-2.03.tar.gz = $(URL_IPFIRE)/asterisk-moh-opsound-gsm-2.03.tar.gz
61d0d586 47asterisk-1.4-de-prompts.tar.gz = $(URL_IPFIRE)/asterisk-1.4-de-prompts.tar.gz
5e69ef1a 48
70956410 49$(DL_FILE)_MD5 = de06d4ac0d1ba531c4c18805a9d5a18d
8667a65b 50asterisk-extra-sounds-en-gsm-1.4.15.tar.gz_MD5 = 5099fc65f49008e33ba7fb043a4ec995
eb5b3f95 51asterisk-moh-opsound-gsm-2.03.tar.gz_MD5 = 09066f55f1358f298bc1a6e4678a3ddf
61d0d586 52asterisk-1.4-de-prompts.tar.gz_MD5 = 626a2b95071a5505851e43874dfbfd5c
5e69ef1a
MT
53
54install : $(TARGET)
55
56check : $(patsubst %,$(DIR_CHK)/%,$(objects))
57
58download :$(patsubst %,$(DIR_DL)/%,$(objects))
59
60md5 : $(subst %,%_MD5,$(objects))
61
62dist:
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)
b6541fec
AF
84
85 # remove old directories and extract asterisk
83167e38 86 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
b6541fec 87
83167e38
DW
88 # patch asterisk
89 cd $(DIR_APP) && patch -p4 < $(DIR_SRC)/src/patches/asterisk-no-ffmpeg.patch
5e55b70d 90
ae77e0ba 91 # configure asterisk
f1d418f5
DW
92 cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire \
93 --without-oss \
94 --without-sdl \
95 --without-SDL_image \
96 --without-netsnmp \
83167e38
DW
97 --without-avcodec \
98 --without-vorbis \
99 --without-ogg \
100 --without-spandsp \
f1d418f5 101 --disable-xmldoc
b6541fec
AF
102
103 # enable additional features (include following sound-tars)
f1d418f5
DW
104 cd $(DIR_APP) && make menuselect.makeopts && menuselect/menuselect \
105 --enable res_srtp \
106 --enable app_mysql \
107 --enable cdr_mysql \
108 --enable res_config_mysql \
109 --enable EXTRA-SOUNDS-EN-GSM \
110 --enable MOH-OPSOUND-GSM \
111 menuselect.makeopts
b6541fec
AF
112
113 # add additional sounds
8667a65b 114 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-extra-sounds-en-gsm-1.4.15.tar.gz $(DIR_APP)/sounds/
eb5b3f95 115 cd $(DIR_APP) && cp -fv $(DIR_DL)/asterisk-moh-opsound-gsm-2.03.tar.gz $(DIR_APP)/sounds/
b6541fec 116
eb5b3f95
AF
117 # Fix wrong cpu optimization (march=armv5tel)
118 cd $(DIR_APP) && sed -i -e "s|^PROC=armv5te.*|PROC=armv5te|g" makeopts
119
120 # Add armv5te to gsm codecs
121 cd $(DIR_APP) && sed -i -e "s|armv5b |*armv5te |g" codecs/gsm/Makefile
821f9f50 122
b6541fec 123 # compile and install
6f61f8c6
MT
124 cd $(DIR_APP) && make $(MAKETUNING) all
125 cd $(DIR_APP) && make install
126 cd $(DIR_APP) && make samples
b6541fec 127
b6541fec 128 # add german sounds and remove README.txt
61d0d586
MT
129 tar xfz $(DIR_DL)/asterisk-1.4-de-prompts.tar.gz -C /var/lib/asterisk/sounds/
130 -rm -f /var/lib/asterisk/sounds/README.txt
b6541fec
AF
131
132 # remove build directories
61d0d586 133 @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-*
b6541fec
AF
134
135 # copy additional ipfire scripts for asterisk
42dc0090
CS
136 -mkdir -p /var/ipfire/asterisk
137 cp -vrf $(DIR_SRC)/config/asterisk/* /var/ipfire/asterisk/
138 chmod o+w /var/ipfire/asterisk
6257cba2 139 chown nobody:nobody -R /var/ipfire/asterisk
28b8e0ec 140 chown nobody:nobody -R /var/lib/asterisk
b6541fec 141
8667a65b 142# be sure all source is removed
5e55b70d 143 @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* $(DIR_SRC)/libsrtp*
b6541fec
AF
144
145 # remember backup-location
ef3002be 146 install -v -m 644 $(DIR_SRC)/config/backup/includes/asterisk /var/ipfire/backup/addons/includes/asterisk
b6541fec 147
972f767f
DW
148 # Logrotate
149 mkdir -pv /etc/logrotate.d
150 install -v -m 644 $(DIR_SRC)/config/asterisk/asterisk.logrotate /etc/logrotate.d/asterisk
151
b6541fec
AF
152 # generate softlink (or asterisk will not work properly)
153 ln -sf /var/ipfire/asterisk /etc/asterisk
154
155 # make asterisk start with reboot
156 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc0.d/K30asterisk
157 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc6.d/K30asterisk
158 ln -sf /etc/rc.d/init.d/asterisk /etc/rc.d/rc3.d/S30asterisk
159
160 # all done
5e69ef1a 161 @$(POSTBUILD)