]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - lfs/dahdi
Add eject rootfile.
[people/pmueller/ipfire-2.x.git] / lfs / dahdi
CommitLineData
3886437c
AF
1###############################################################################
2# #
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 #
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
25include Config
26
27ifeq "$(XEN)" "1"
28 VERSUFIX=ipfire-xen
29else
30 VERSUFIX=ipfire
31endif
32
33VER = 2.2.0.2
34TVER = 2.2.0
35
36DL_FILE = dahdi-linux-$(VER)-with-vpmadt032-1.17.0.tar.gz
37DL_FILE1 = dahdi-tools-$(TVER).tar.gz
38
39THISAPP = dahdi-$(VER)
40DL_FROM = $(URL_IPFIRE)
41DIR_APP = $(DIR_SRC)/dahdi-linux-$(VER)
42DIR_APP1 = $(DIR_SRC)/dahdi-tools-$(TVER)
43
44PROG = dahdi
45PAK_VER = 1
46
47DEPS = ""
48
49
50ifeq "$(KMOD)" "1"
51 TARGET = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)-$(VERSUFIX)
52else
53 TARGET = $(DIR_INFO)/$(THISAPP)
54endif
55
56
57###############################################################################
58# Top-level Rules
59###############################################################################
60
7f0974a2 61objects = $(DL_FILE) $(DL_FILE1) dahdi-linux-2.2.0.2-firmware.tar.bz2
3886437c
AF
62
63$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
64$(DL_FILE1) = $(DL_FROM)/$(DL_FILE1)
7f0974a2 65dahdi-linux-2.2.0.2-firmware.tar.bz2 = $(DL_FROM)/dahdi-linux-2.2.0.2-firmware.tar.bz2
3886437c
AF
66
67$(DL_FILE)_MD5 = 5cbabd47cf780305e2cba6ccec42c754
68$(DL_FILE1)_MD5 = a018f452f3851a312ff51705ac44de37
7f0974a2
AF
69dahdi-linux-2.2.0.2-firmware.tar.bz2_MD5 = 7d7c774d214a528b49c9a08b5350a652
70
3886437c
AF
71
72install : $(TARGET)
73
74check : $(patsubst %,$(DIR_CHK)/%,$(objects))
75
76download :$(patsubst %,$(DIR_DL)/%,$(objects))
77
78md5 : $(subst %,%_MD5,$(objects))
79
80dist:
81 $(PAK)
82
83###############################################################################
84# Downloading, checking, md5sum
85###############################################################################
86
87$(patsubst %,$(DIR_CHK)/%,$(objects)) :
88 @$(CHECK)
89
90$(patsubst %,$(DIR_DL)/%,$(objects)) :
91 @$(LOAD)
92
93$(subst %,%_MD5,$(objects)) :
94 @$(MD5)
95
96###############################################################################
97# Installation Details
98###############################################################################
99
100$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
101 @$(PREBUILD)
102
103ifeq "$(KMOD)" "1"
104 rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
105 cd $(DIR_APP) && make $(MAKETUNING) clean all KVERS=$(KVER)
106 cd $(DIR_APP) && make install-modules KVERS=$(KVER)-$(VERSUFIX)
107 @rm -rf $(DIR_APP)
108else
109 rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
7f0974a2 110 cd $(DIR_SRC) && tar jxf $(DIR_DL)/dahdi-linux-2.2.0.2-firmware.tar.bz2
3886437c
AF
111 cd $(DIR_APP) && make $(MAKETUNING) clean all KVERS=$(KVER)
112 cd $(DIR_APP) && make install-devices install-include \
113 install-firmware install-xpp-firm KVERS=$(KVER)-$(VERSUFIX)
114 @rm -rf $(DIR_APP)
115
116 # remove previous generated symlink (if this a rebuild)
117 rm -rf /etc/dahdi
118
119 rm -rf $(DIR_APP1) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE1)
120 cd $(DIR_APP1) && ./configure --sysconfdir=/var/ipfire/asterisk
121 cd $(DIR_APP1) && make $(MAKETUNING) clean all
122 cd $(DIR_APP1) && make install
123
124 # Supress Error output because this erase the log
125 cd $(DIR_APP1) && make config 2>/dev/null
126
127 # remove build src
128 @rm -rf $(DIR_APP1)
129
130 # config stuff
131 ln -sf ../init.d/dahdi /etc/rc.d/rc0.d/K30dahdi
132 ln -sf ../init.d/dahdi /etc/rc.d/rc6.d/K30dahdi
133 ln -sf ../init.d/dahdi /etc/rc.d/rc3.d/S15dahdi
134 mv -f /etc/dahdi/genconf_parameters /var/ipfire/asterisk/dahdi/
135 mv -f /etc/dahdi/init.conf /var/ipfire/asterisk/dahdi/
136 mv -f /etc/dahdi/modules /var/ipfire/asterisk/dahdi/
137 rmdir /etc/dahdi
138 ln -s /var/ipfire/asterisk/dahdi /etc/dahdi
139
140 # make init.d-script work with ipfire
141 sed s/system=redhat/system=debian/ /etc/init.d/dahdi > /tmp/dahdi-temp
142 mv /tmp/dahdi-temp /etc/init.d/dahdi && chmod 755 /etc/init.d/dahdi
143
144 # add dummy-module (to get conference rooms work)
145 echo "#Dummy" >> /etc/dahdi/modules
146 echo "dahdi_dummy" >> /etc/dahdi/modules
147endif
148 @$(POSTBUILD)
149