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