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