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