Gentoo Archives: gentoo-commits

From: "Rajiv Aaron Manglani (rajiv)" <rajiv@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/zaptel: ChangeLog zaptel-1.2.24.ebuild
Date: Sun, 24 Feb 2008 20:52:46
Message-Id: E1JTNpx-0008FV-UW@stork.gentoo.org
1 rajiv 08/02/24 20:52:41
2
3 Modified: ChangeLog
4 Added: zaptel-1.2.24.ebuild
5 Log:
6 version bump, bug #208190.
7 (Portage version: 2.1.4.4)
8
9 Revision Changes Path
10 1.105 net-misc/zaptel/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/zaptel/ChangeLog?rev=1.105&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/zaptel/ChangeLog?rev=1.105&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/zaptel/ChangeLog?r1=1.104&r2=1.105
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v
19 retrieving revision 1.104
20 retrieving revision 1.105
21 diff -u -r1.104 -r1.105
22 --- ChangeLog 24 Feb 2008 18:25:48 -0000 1.104
23 +++ ChangeLog 24 Feb 2008 20:52:41 -0000 1.105
24 @@ -1,6 +1,12 @@
25 # ChangeLog for net-misc/zaptel
26 # Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.104 2008/02/24 18:25:48 rajiv Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.105 2008/02/24 20:52:41 rajiv Exp $
29 +
30 +*zaptel-1.2.24 (24 Feb 2008)
31 +
32 + 24 Feb 2008; Rajiv Aaron Manglani <rajiv@g.o>
33 + +zaptel-1.2.24.ebuild:
34 + version bump, bug #208190.
35
36 24 Feb 2008; Rajiv Aaron Manglani <rajiv@g.o>
37 -files/zaptel-bristuff-0.2.0-RC8q.patch, -files/zaptel-1.2.0-ukcid.patch,
38
39
40
41 1.1 net-misc/zaptel/zaptel-1.2.24.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/zaptel/zaptel-1.2.24.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/zaptel/zaptel-1.2.24.ebuild?rev=1.1&content-type=text/plain
45
46 Index: zaptel-1.2.24.ebuild
47 ===================================================================
48 # Copyright 1999-2008 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/zaptel-1.2.24.ebuild,v 1.1 2008/02/24 20:52:41 rajiv Exp $
51
52 inherit toolchain-funcs eutils linux-mod flag-o-matic
53
54 BRI_VERSION="0.3.0-PRE-1y-l"
55 FLORZ_VERSION="0.3.0-PRE-1y-l_florz-12.1"
56
57 IUSE="astribank bri ecmark ecmark2 ecmark3 ecaggressive eckb1 ecmg2 ecsteve ecsteve2 florz
58 rtc watchdog zapras zapnet"
59
60 MY_P="${P/_/-}"
61
62 DESCRIPTION="Drivers for Digium and ZapataTelephony cards"
63 HOMEPAGE="http://www.asterisk.org"
64 SRC_URI="http://downloads.digium.com/pub/zaptel/releases/${MY_P}.tar.gz
65 bri? ( http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )
66 florz? ( http://zaphfc.florz.dyndns.org/zaphfc_${FLORZ_VERSION}.diff.gz )
67 "
68
69 S="${WORKDIR}/${MY_P}"
70
71 S_BRI="${WORKDIR}/bristuff-${BRI_VERSION}"
72
73 SLOT="0"
74 LICENSE="GPL-2"
75 KEYWORDS="~amd64 ~ppc ~x86"
76
77 RDEPEND="virtual/libc
78 dev-libs/libusb
79 >=dev-libs/newt-0.50.0
80 astribank? ( dev-lang/perl )"
81
82 DEPEND="${RDEPEND} virtual/linux-sources"
83
84 # list of echo canceller use flags,
85 # first active in this list is selected (=order does matter)
86 ZAP_EC_FLAGS="ecmark ecmark2 ecmark3 ecsteve ecsteve2 eckb1 ecmg2"
87
88 ### Begin: Helper functions
89
90 select_echo_cancel() {
91 local myEC=""
92
93 for x in ${ZAP_EC_FLAGS}; do
94 if use $x; then
95 myEC=$(echo "$x" | sed -e "s:^ec::" | tr '[:lower:]' '[:upper:]')
96 break;
97 fi
98 done
99
100 echo ${myEC}
101 }
102
103 zconfig_disable() {
104 if grep -q "${1}" "${S}"/zconfig.h; then
105 # match a little more than ${1} so we can use zconfig_disable
106 # to disable all echo cancellers in zconfig.h w/o calling it several times
107 sed -i -e "s:^[ \t]*#define[ \t]\+\(${1}[a-zA-Z0-9_-]*\).*:#undef \1:" \
108 "${S}"/zconfig.h
109 fi
110
111 return $?
112 }
113
114 zconfig_enable() {
115 if grep -q "${1}" "${S}"/zconfig.h; then
116 sed -i -e "s:^/\*[ \t]*#define[ \t]\+\(${1}\).*:#define \1:" \
117 -e "s:^[ \t]*#undef[ \t]\+\(${1}\).*:#define \1:" \
118 "${S}"/zconfig.h
119 fi
120
121 return $?
122 }
123
124 ### End: Helper functions
125
126 pkg_setup() {
127 local result=0 numec=0
128
129 linux-mod_pkg_setup
130
131 einfo "Running pre-flight checks..."
132
133 # basic zaptel checks
134 if kernel_is 2 4 ; then
135 if ! linux_chkconfig_present CRC32; then
136 echo
137 eerror "Your kernel lacks CRC32 support!"
138 eerror "Enable CONFIG_CRC32!"
139 result=$((result+1))
140 fi
141 else
142 if ! linux_chkconfig_present CRC_CCITT; then
143 echo
144 eerror "Your kernel lacks CRC_CCIT support!"
145 eerror "Enable CONFIG_CRC_CCIT!"
146 result=$((result+1))
147 fi
148 if ! linux_chkconfig_present FW_LOADER; then
149 echo
150 eerror "Your kernel lacks FW_LOADER support!"
151 eerror "Enable CONFIG_FW_LOADER!"
152 result=$((result+1))
153 fi
154 fi
155
156 # check if multiple echo cancellers have been selected
157 for x in ${ZAP_EC_FLAGS}; do
158 use $x && numec=$((numec+1))
159 done
160 if [[ $numec -gt 1 ]]; then
161 # multiple flags are active, only the first in the ZAP_EC_FLAGS list
162 # will be used, make sure the user knows about this
163 echo
164 ewarn "Multiple echo canceller flags are active but only one will be used!"
165 ewarn "Selected: $(select_echo_cancel)"
166 fi
167
168 # we need at least HDLC generic support
169 if use zapnet && ! linux_chkconfig_present HDLC; then
170 echo
171 eerror "zapnet: Your kernel lacks HDLC support!"
172 eerror "zapnet: Enable CONFIG_HDLC* to use zaptel network support!"
173 result=$((result+1))
174 fi
175
176 # zapras needs PPP support
177 if use zapras && ! linux_chkconfig_present PPP; then
178 echo
179 eerror "zapras: Your kernel lacks PPP support!"
180 eerror "zapras: Enable CONFIG_PPP* to use zaptel ras support!"
181 result=$((result+1))
182 fi
183
184 # rtc needs linux-2.6 and CONFIG_RTC
185 if use rtc; then
186 if ! kernel_is 2 6; then
187 echo
188 eerror "rtc: >=Linux-2.6.0 is needed for rtc support!"
189 result=$((result+1))
190 fi
191
192 if ! linux_chkconfig_present RTC; then
193 eerror "rtc: Your kernel lacks RealTime-Clock support!"
194 result=$((result+1))
195 fi
196 fi
197
198 if [[ $result -gt 0 ]]; then
199 echo
200 ewarn "One or more of the neccessary precondition(s) is/are not met!"
201 ewarn "Look at the messages above, resolve the problem (or disable the use-flag) and try again"
202 echo
203
204 if [[ $result -lt 3 ]]; then
205 eerror "[$result Error(s)] Zaptel is not happy :("
206 else
207 eerror "[$result Error(s)] You're making zaptel cry :'("
208 fi
209 die "[$result] Precondition(s) not met"
210 fi
211
212 echo
213 einfo "Zaptel is happy and continues... :)"
214 }
215
216 src_unpack() {
217 unpack ${A}
218
219 cd "${S}"
220 epatch "${FILESDIR}"/${PN}-1.2.23-gentoo.diff
221 epatch "${FILESDIR}"/zaptel-1.2.9.1-ar.patch
222
223 # try to apply bristuff patch
224 if use bri; then
225 # fix for userpriv
226 chmod -R a=rwX ${S_BRI}
227
228 einfo "Patching zaptel w/ BRI stuff (${BRI_VERSION})"
229 epatch ${S_BRI}/patches/zaptel.patch
230
231 cd ${S_BRI}
232
233 if use florz; then
234 einfo "Patching zaptel with florz (${FLORZ_VERSION}) for zaphfc"
235 epatch "${WORKDIR}"/zaphfc_${FLORZ_VERSION}.diff
236 fi
237
238 # patch includes
239 sed -i -e "s:^#include.*zaptel\.h.*:#include <zaptel.h>:" \
240 qozap/qozap.c \
241 zaphfc/zaphfc.c \
242 cwain/cwain.c
243
244 # patch makefiles
245 sed -i -e "s:^ZAP[\t ]*=.*:ZAP=-I${S}:" \
246 -e "s:^MODCONF=.*:MODCONF=/etc/modules.d/zaptel:" \
247 -e "s:linux-2.6:linux:g" \
248 qozap/Makefile \
249 zaphfc/Makefile \
250 cwain/Makefile
251
252 sed -i -e "s:^\(CFLAGS+=-I. \).*:\1 \$(ZAP):" \
253 zaphfc/Makefile
254
255 cd "${S}"
256 fi
257
258 ### Configuration changes
259 local myEC
260
261 # prepare zconfig.h
262 myEC=$(select_echo_cancel)
263 if [[ -n "${myEC}" ]]; then
264 einfo "Selected echo canceller: ${myEC}"
265 # disable default first, set new selected ec afterwards
266 zconfig_disable ECHO_CAN
267 zconfig_enable ECHO_CAN_${myEC}
268 fi
269
270 # enable rtc support on 2.6
271 if use rtc && linux_chkconfig_present RTC && kernel_is 2 6; then
272 einfo "Enabling ztdummy RTC support"
273 zconfig_enable USE_RTC
274 fi
275
276 # enable agressive echo surpression
277 use ecaggressive && \
278 zconfig_enable AGGRESSIVE_SUPPRESSOR
279
280 # ppp ras support
281 use zapras && \
282 zconfig_enable CONFIG_ZAPATA_PPP
283
284 # frame relay, syncppp...
285 use zapnet && \
286 zconfig_enable CONFIG_ZAPATA_NET
287
288 # zaptel watchdog
289 use watchdog && \
290 zconfig_enable CONFIG_ZAPTEL_WATCHDOG
291 }
292
293 src_compile() {
294 # build
295 make KVERS=${KV_FULL} \
296 KSRC=${KV_DIR} ARCH=$(tc-arch-kernel) || die
297
298 if use astribank; then
299 cd "${S}"/xpp/utils
300 make || die "make xpp utils failed"
301 fi
302
303 if use bri; then
304 cd ${S_BRI}
305 for x in cwain qozap zaphfc; do
306 einfo "Building ${x}..."
307 make KVERS=${KV_FULL} \
308 KSRC=/usr/src/linux \
309 ARCH=$(tc-arch-kernel) \
310 -C ${x} || die "make ${x} failed"
311 done
312 fi
313 }
314
315 src_install() {
316 # Create firmware directory
317 mkdir -p "${D}"/lib/firmware/
318
319 kernel_is 2 4 && cp /etc/modules.conf "${D}"/etc
320 make DESTDIR="${D}" ARCH=$(tc-arch-kernel) \
321 KVERS=${KV_FULL} KSRC=/usr/src/linux devices firmware \
322 install-modules install-programs || die
323
324 dodoc ChangeLog README README.udev README.fxsusb zaptel.init
325 dodoc zaptel.conf.sample zaptel.sysconfig README.fxotune
326
327 # additional tools
328 dobin ztmonitor ztspeed zttest fxotune
329
330 # install all header files, several packages need the complete set
331 # (e.g. sangoma wanpipe)
332 insinto /usr/include/zaptel
333 doins *.h
334
335 if use bri; then
336 einfo "Installing bri"
337 cd ${S_BRI}
338
339 insinto /lib/modules/${KV_FULL}/misc
340 doins qozap/qozap.${KV_OBJ}
341 doins zaphfc/zaphfc.${KV_OBJ}
342 doins cwain/cwain.${KV_OBJ}
343
344 # install example configs for octoBRI and quadBRI
345 insinto /etc
346 doins qozap/zaptel.conf.octoBRI
347 newins qozap/zaptel.conf zaptel.conf.quadBRI
348 newins zaphfc/zaptel.conf zaptel.conf.zaphfc
349
350 insinto /etc/asterisk
351 doins qozap/zapata.conf.octoBRI
352 newins qozap/zapata.conf zapata.conf.quadBRI
353 newins zaphfc/zapata.conf zapata.conf.zaphfc
354
355 docinto bristuff
356 dodoc CHANGES INSTALL
357
358 docinto bristuff/qozap
359 dodoc qozap/TODO qozap/*.conf*
360
361 docinto bristuff/zaphfc
362 dodoc zaphfc/*.conf
363
364 docinto bristuff/cwain
365 dodoc cwain/TODO
366
367 cd "${S}"
368 fi
369
370 # install init script
371 newinitd "${FILESDIR}"/zaptel.rc6 zaptel
372 newconfd "${FILESDIR}"/zaptel.confd zaptel
373
374 # install udev rule file
375 insinto /etc/udev/rules.d
376 newins "${FILESDIR}"/zaptel.udevd 10-zaptel.rules
377
378 if use astribank; then
379 cd "${S}"/xpp/utils
380 eval `perl '-V:installarchlib'`
381 make DESTDIR="${D}" PERLLIBDIR=${installarchlib} install || die "failed xpp utils install"
382 dosbin zt_registration xpp_sync lszaptel
383 fi
384 }
385
386 pkg_postinst() {
387 linux-mod_pkg_postinst
388
389 echo
390 einfo "Use the /etc/init.d/zaptel script to load zaptel.conf settings on startup!"
391 einfo "This ebuild no longer sets permissions on device nodes. Please review"
392 einfo " /etc/udev/rules.d/10-zaptel.rules or the appropriate configuration"
393 einfo " method for your device node manager."
394 echo
395
396 if use bri; then
397 einfo "Bristuff configs have been merged as:"
398 einfo ""
399 einfo "${ROOT}etc/"
400 einfo " zaptel.conf.zaphfc"
401 einfo " zaptel.conf.quadBRI"
402 einfo " zaptel.conf.octoBRI"
403 einfo ""
404 einfo "${ROOT}etc/asterisk/"
405 einfo " zapata.conf.zaphfc"
406 einfo " zapata.conf.quadBRI"
407 einfo " zapata.conf.octoBRI"
408 echo
409 fi
410 }
411
412
413
414 --
415 gentoo-commits@l.g.o mailing list