]> git.ipfire.org Git - ipfire-2.x.git/blob - lfs/asterisk
Korrekturen
[ipfire-2.x.git] / lfs / asterisk
1 ###############################################################################
2 # This file is part of the IPCop Firewall. #
3 # #
4 # IPCop is free software; you can redistribute it and/or modify #
5 # it under the terms of the GNU General Public License as published by #
6 # the Free Software Foundation; either version 2 of the License, or #
7 # (at your option) any later version. #
8 # #
9 # IPCop is distributed in the hope that it will be useful, #
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
12 # GNU General Public License for more details. #
13 # #
14 # You should have received a copy of the GNU General Public License #
15 # along with IPCop; if not, write to the Free Software #
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
17 # #
18 # Makefiles are based on LFSMake, which is #
19 # Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
20 # #
21 ###############################################################################
22
23 ###############################################################################
24 # Definitions
25 ###############################################################################
26
27 include Config
28
29 VER = 1.2.7.1
30
31 THISAPP = asterisk-$(VER)
32 DL_FILE = $(THISAPP).tar.gz
33 DL_FROM = $(URL_IPFIRE)
34 DIR_APP = $(DIR_SRC)/$(THISAPP)
35 TARGET = $(DIR_INFO)/$(THISAPP)
36 PROG = asterisk
37 PAK_VER = ipfire-beta1
38
39 ASTERISK = $(THISAPP)
40 ZAPTEL = zaptel-1.2.5
41 BRISTUFF = bristuff-0.3.0-PRE-1o
42 LIBPRI = libpri-1.2.2
43 SPANDSP = spandsp-0.0.2pre25
44 OH323 = asterisk-oh323-0.7.3
45
46 ###############################################################################
47 # Top-level Rules
48 ###############################################################################
49
50 objects = $(DL_FILE) \
51 $(ZAPTEL).tar.gz \
52 $(BRISTUFF).tar.gz \
53 $(LIBPRI).tar.gz \
54 $(OH323).tar.gz \
55 app_rxfax.c \
56 app_txfax.c \
57 apps_Makefile.patch
58
59 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
60 $(ZAPTEL).tar.gz = $(URL_IPFIRE)/$(ZAPTEL).tar.gz
61 $(BRISTUFF).tar.gz = $(URL_IPFIRE)/$(BRISTUFF).tar.gz
62 $(LIBPRI).tar.gz = $(URL_IPFIRE)/$(LIBPRI).tar.gz
63 app_rxfax.c = $(URL_IPFIRE)/app_rxfax.c
64 app_txfax.c = $(URL_IPFIRE)/app_txfax.c
65 apps_Makefile.patch = $(URL_IPFIRE)/apps_Makefile.patch
66 $(OH323).tar.gz = $(URL_IPFIRE)/$(OH323).tar.gz
67
68 $(DL_FILE)_MD5 = 5c4b473eee2fbc2cb9e346f0564ef970
69 $(ZAPTEL).tar.gz_MD5 = 8c8561259d29a314aa5a076050124697
70 $(BRISTUFF).tar.gz_MD5 = 93bb8a5661aaf3022cf4a102ea061f83
71 $(LIBPRI).tar.gz_MD5 = efce9c3699110588df5e4cf09eae01d9
72 app_rxfax.c_MD5 = ab6983b51c412883545b36993d704999
73 app_txfax.c_MD5 = 8c8fcb263b76897022b4c28052a7b439
74 apps_Makefile.patch_MD5 = 6b0faa7a7cf8613962b17c23ee5a1583
75 $(OH323).tar.gz_MD5 = 66dc098a20ac11f098edbbaed307c085
76
77 install : $(TARGET)
78
79 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
80
81 download :$(patsubst %,$(DIR_DL)/%,$(objects))
82
83 md5 : $(subst %,%_MD5,$(objects))
84
85 dist:
86 @$(PAK)
87
88 ###############################################################################
89 # Downloading, checking, md5sum
90 ###############################################################################
91
92 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
93 @$(CHECK)
94
95 $(patsubst %,$(DIR_DL)/%,$(objects)) :
96 @$(LOAD)
97
98 $(subst %,%_MD5,$(objects)) :
99 @$(MD5)
100
101 ###############################################################################
102 # Installation Details
103 ###############################################################################
104
105 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
106 @$(PREBUILD)
107 @rm -rf $(DIR_SRC)/$(BRISTUFF)
108 # Decompress the source-code
109 cd $(DIR_SRC) && \
110 tar zxf $(DIR_DL)/$(BRISTUFF).tar.gz -C $(DIR_SRC) && \
111 cd $(DIR_SRC)/$(BRISTUFF) && \
112 tar xfz $(DIR_DL)/$(ZAPTEL).tar.gz && \
113 tar xfz $(DIR_DL)/$(LIBPRI).tar.gz && \
114 tar xfz $(DIR_DL)/$(ASTERISK).tar.gz && \
115 tar xfz $(DIR_DL)/$(OH323).tar.gz
116
117 # Build Zaptel
118 cd $(DIR_SRC)/$(BRISTUFF)/$(ZAPTEL) && \
119 patch -Np1 < $(DIR_SRC)/src/patches/zaptel.patch && \
120 make clean && \
121 make all KVERS=$(KVER)-smp && \
122 make install KVERS=$(KVER)-smp && \
123 make clean && \
124 make all KVERS=$(KVER) && \
125 make install KVERS=$(KVER)
126 cd $(DIR_SRC)/$(BRISTUFF)/$(ZAPTEL) && install -D -m 644 zaptel.h /usr/include/linux/zaptel.h
127 cd $(DIR_SRC)/$(BRISTUFF)/$(ZAPTEL) && install -D -m 644 zconfig.h /usr/include/linux/zconfig.h
128 cd $(DIR_SRC)/$(BRISTUFF)/$(ZAPTEL) && install -D -m 644 ecdis.h /usr/include/linux/ecdis.h
129 cd $(DIR_SRC)/$(BRISTUFF)/$(ZAPTEL) && install -D -m 644 fasthdlc.h /usr/include/linux/fasthdlc.h
130 cd $(DIR_SRC)/$(BRISTUFF)/$(ZAPTEL) && install -D -m 644 kb1ec.h /usr/include/linux/kb1ec.h
131 cd $(DIR_SRC)/$(BRISTUFF)/$(ZAPTEL) && install -D -m 644 kb1ec_const.h /usr/include/linux/kb1ec_const.h
132 cd $(DIR_SRC)/$(BRISTUFF)/$(ZAPTEL) && install -D -m 644 biquad.h /usr/include/linux/biquad.h
133 cd $(DIR_SRC)/$(BRISTUFF)/$(ZAPTEL) && install -D -m 644 arith.h /usr/include/linux/arith.h
134 ln -nf -v /usr/include/linux/zaptel.h /usr/include/zaptel.h
135 ln -nf -v /usr/include/linux/zconfig.h /usr/include/zconfig.h
136 ln -nf -v /usr/include/linux/ecdis.h /usr/include/ecdis.h
137 ln -nf -v /usr/include/linux/fasthdlc.h /usr/include/fasthdlc.h
138 ln -nf -v /usr/include/linux/kb1ec.h /usr/include/kb1ec.h
139 ln -nf -v /usr/include/linux/kb1ec_const.h /usr/include/kb1ec_const.h
140 ln -nf -v /usr/include/linux/biquad.h /usr/include/biquad.h
141 ln -nf -v /usr/include/linux/arith.h /usr/include/arith.h
142
143 # Build Libpri
144 cd $(DIR_SRC)/$(BRISTUFF)/$(LIBPRI) && \
145 patch -Np1 < $(DIR_SRC)/src/patches/libpri.patch && \
146 make clean all KVERS=$(KVER) && \
147 make install KVERS=$(KVER)
148
149 # Build libgsmat
150 cd $(DIR_SRC)/$(BRISTUFF)/libgsmat-0.0.1 && \
151 make clean all && \
152 make install
153
154 # Build uno/duo/quad GSM PCI driver
155 cd $(DIR_SRC)/$(BRISTUFF)/ztgsm && \
156 make clean linux24 && \
157 install -D -m 644 ztgsm.o /lib/modules/$(KVER)/misc/ztgsm.o
158
159 # Build qozap
160 cd $(DIR_SRC)/$(BRISTUFF)/qozap && \
161 make clean linux24 && \
162 install -D -m 644 qozap.o /lib/modules/$(KVER)/misc/qozap.o
163
164 # Build cwain
165 cd $(DIR_SRC)/$(BRISTUFF)/cwain && \
166 make clean linux24 && \
167 install -D -m 644 cwain.o /lib/modules/$(KVER)/misc/cwain.o
168
169 # Build zaphfc
170 cd $(DIR_SRC)/$(BRISTUFF)/zaphfc && \
171 patch -Np1 < $(DIR_SRC)/src/patches/zaphfc_0.3.0-PRE-1o_florz-12.diff && \
172 cd $(DIR_SRC)/$(BRISTUFF)/zaphfc && make clean linux24 && \
173 install -D -m 644 zaphfc.o /lib/modules/$(KVER)/misc/zaphfc.o
174
175 # Compress the Kernelmodules
176 find /lib/modules/$(KVER)/misc/ -name '*.o' -a -type f | xargs gzip -f9
177 find /lib/modules/$(KVER)-smp/misc/ -name '*.o' -a -type f | xargs gzip -f9
178
179 # Build Asterisk
180 cd $(DIR_SRC)/$(BRISTUFF)/$(ASTERISK) && patch -Np1 < $(DIR_SRC)/src/patches/asterisk.patch
181 ### FAX geht noch nicht mit Asterisk 1.2.7.1
182 # cp -fv $(DIR_DL)/app_{r,t}xfax.c $(DIR_SRC)/$(BRISTUFF)/$(ASTERISK)/apps && \
183 # cd $(DIR_SRC)/$(BRISTUFF)/$(ASTERISK)/apps && patch < $(DIR_DL)/apps_Makefile.patch
184 cd $(DIR_SRC)/$(BRISTUFF)/$(ASTERISK) && make clean
185 cd $(DIR_SRC)/$(BRISTUFF)/$(ASTERISK) && make all ASTETCDIR=/var/ipfire/asterisk
186 cd $(DIR_SRC)/$(BRISTUFF)/$(ASTERISK) && make install ASTETCDIR=/var/ipfire/asterisk
187 cd $(DIR_SRC)/$(BRISTUFF)/$(ASTERISK) && make samples ASTETCDIR=/var/ipfire/asterisk
188
189 # Build OH323
190 cd $(DIR_SRC)/$(BRISTUFF)/$(OH323) && \
191 make ASTERISKINCDIR=$(DIR_SRC)/$(BRISTUFF)/$(ASTERISK)/include OH323WRAPLIBDIR=/usr/lib && \
192 make install ASTERISKINCDIR=$(DIR_SRC)/$(BRISTUFF)/$(ASTERISK)/include OH323WRAPLIBDIR=/usr/lib
193 @rm -rf $(DIR_SRC)/$(BRISTUFF) ## Do not delete any more cause to save time on a recompile: $(DIR_SRC)/{pwlib,openh323}
194 @$(POSTBUILD)
195