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.26-r1.ebuild
Date: Sun, 24 Aug 2008 19:30:08
Message-Id: E1KXLHp-0001e0-FR@stork.gentoo.org
1 rajiv 08/08/24 19:30:05
2
3 Modified: ChangeLog
4 Added: zaptel-1.2.26-r1.ebuild
5 Log:
6 fix for multilib, bug #208190. thanks to gentoofan23 for the patch.
7 (Portage version: 2.1.5.4)
8
9 Revision Changes Path
10 1.110 net-misc/zaptel/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/zaptel/ChangeLog?rev=1.110&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/zaptel/ChangeLog?rev=1.110&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/zaptel/ChangeLog?r1=1.109&r2=1.110
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v
19 retrieving revision 1.109
20 retrieving revision 1.110
21 diff -u -r1.109 -r1.110
22 --- ChangeLog 16 Aug 2008 16:13:18 -0000 1.109
23 +++ ChangeLog 24 Aug 2008 19:30:04 -0000 1.110
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.109 2008/08/16 16:13:18 tove Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.110 2008/08/24 19:30:04 rajiv Exp $
29 +
30 +*zaptel-1.2.26-r1 (24 Aug 2008)
31 +
32 + 24 Aug 2008; Rajiv Aaron Manglani <rajiv@g.o>
33 + +files/zaptel-1.2.26-gentoo.diff, +zaptel-1.2.26-r1.ebuild:
34 + fix for multilib, bug #208190. thanks to gentoofan23 for the patch.
35
36 16 Aug 2008; Torsten Veller <tove@g.o> metadata.xml:
37 Remove stkn from metadata.xml (#27693)
38
39
40
41 1.1 net-misc/zaptel/zaptel-1.2.26-r1.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/zaptel/zaptel-1.2.26-r1.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/zaptel/zaptel-1.2.26-r1.ebuild?rev=1.1&content-type=text/plain
45
46 Index: zaptel-1.2.26-r1.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.26-r1.ebuild,v 1.1 2008/08/24 19:30:04 rajiv Exp $
51
52 inherit toolchain-funcs eutils linux-mod flag-o-matic multilib
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.26-gentoo.diff
221 epatch "${FILESDIR}"/zaptel-1.2.9.1-ar.patch
222 epatch "${FILESDIR}"/zaptel-1.2.25-xpputils.diff
223
224 # try to apply bristuff patch
225 if use bri; then
226 # fix for userpriv
227 chmod -R a=rwX ${S_BRI}
228
229 einfo "Patching zaptel w/ BRI stuff (${BRI_VERSION})"
230 epatch ${S_BRI}/patches/zaptel.patch
231
232 cd ${S_BRI}
233
234 if use florz; then
235 einfo "Patching zaptel with florz (${FLORZ_VERSION}) for zaphfc"
236 epatch "${WORKDIR}"/zaphfc_${FLORZ_VERSION}.diff
237 fi
238
239 # patch includes
240 sed -i -e "s:^#include.*zaptel\.h.*:#include <zaptel.h>:" \
241 qozap/qozap.c \
242 zaphfc/zaphfc.c \
243 cwain/cwain.c
244
245 # patch makefiles
246 sed -i -e "s:^ZAP[\t ]*=.*:ZAP=-I${S}:" \
247 -e "s:^MODCONF=.*:MODCONF=/etc/modules.d/zaptel:" \
248 -e "s:linux-2.6:linux:g" \
249 qozap/Makefile \
250 zaphfc/Makefile \
251 cwain/Makefile
252
253 sed -i -e "s:^\(CFLAGS+=-I. \).*:\1 \$(ZAP):" \
254 zaphfc/Makefile
255
256 cd "${S}"
257 fi
258
259 ### Configuration changes
260 local myEC
261
262 # prepare zconfig.h
263 myEC=$(select_echo_cancel)
264 if [[ -n "${myEC}" ]]; then
265 einfo "Selected echo canceller: ${myEC}"
266 # disable default first, set new selected ec afterwards
267 zconfig_disable ECHO_CAN
268 zconfig_enable ECHO_CAN_${myEC}
269 fi
270
271 # enable rtc support on 2.6
272 if use rtc && linux_chkconfig_present RTC && kernel_is 2 6; then
273 einfo "Enabling ztdummy RTC support"
274 zconfig_enable USE_RTC
275 fi
276
277 # enable agressive echo surpression
278 use ecaggressive && \
279 zconfig_enable AGGRESSIVE_SUPPRESSOR
280
281 # ppp ras support
282 use zapras && \
283 zconfig_enable CONFIG_ZAPATA_PPP
284
285 # frame relay, syncppp...
286 use zapnet && \
287 zconfig_enable CONFIG_ZAPATA_NET
288
289 # zaptel watchdog
290 use watchdog && \
291 zconfig_enable CONFIG_ZAPTEL_WATCHDOG
292 }
293
294 src_compile() {
295 export MYLIBDIR="$(get_libdir)"
296
297 # build
298 make KVERS=${KV_FULL} \
299 KSRC=${KV_DIR} ARCH=$(tc-arch-kernel) || die
300
301 if use astribank; then
302 cd "${S}"/xpp/utils
303 make || die "make xpp utils failed"
304 fi
305
306 if use bri; then
307 cd ${S_BRI}
308 for x in cwain qozap zaphfc; do
309 einfo "Building ${x}..."
310 make KVERS=${KV_FULL} \
311 KSRC=/usr/src/linux \
312 ARCH=$(tc-arch-kernel) \
313 -C ${x} || die "make ${x} failed"
314 done
315 fi
316 }
317
318 src_install() {
319 # Create firmware directory
320 mkdir -p "${D}"/lib/firmware/
321
322 kernel_is 2 4 && cp /etc/modules.conf "${D}"/etc
323 make DESTDIR="${D}" ARCH=$(tc-arch-kernel) \
324 KVERS=${KV_FULL} KSRC=/usr/src/linux devices firmware \
325 install-modules install-programs || die
326
327 dodoc ChangeLog README README.udev README.fxsusb zaptel.init
328 dodoc zaptel.conf.sample zaptel.sysconfig README.fxotune
329
330 # additional tools
331 dobin ztmonitor ztspeed zttest fxotune
332
333 # install all header files, several packages need the complete set
334 # (e.g. sangoma wanpipe)
335 insinto /usr/include/zaptel
336 doins *.h
337
338 if use bri; then
339 einfo "Installing bri"
340 cd ${S_BRI}
341
342 insinto /lib/modules/${KV_FULL}/misc
343 doins qozap/qozap.${KV_OBJ}
344 doins zaphfc/zaphfc.${KV_OBJ}
345 doins cwain/cwain.${KV_OBJ}
346
347 # install example configs for octoBRI and quadBRI
348 insinto /etc
349 doins qozap/zaptel.conf.octoBRI
350 newins qozap/zaptel.conf zaptel.conf.quadBRI
351 newins zaphfc/zaptel.conf zaptel.conf.zaphfc
352
353 insinto /etc/asterisk
354 doins qozap/zapata.conf.octoBRI
355 newins qozap/zapata.conf zapata.conf.quadBRI
356 newins zaphfc/zapata.conf zapata.conf.zaphfc
357
358 docinto bristuff
359 dodoc CHANGES INSTALL
360
361 docinto bristuff/qozap
362 dodoc qozap/TODO qozap/*.conf*
363
364 docinto bristuff/zaphfc
365 dodoc zaphfc/*.conf
366
367 docinto bristuff/cwain
368 dodoc cwain/TODO
369
370 cd "${S}"
371 fi
372
373 # install init script
374 newinitd "${FILESDIR}"/zaptel.rc6 zaptel
375 newconfd "${FILESDIR}"/zaptel.confd zaptel
376
377 # install udev rule file
378 insinto /etc/udev/rules.d
379 newins "${FILESDIR}"/zaptel.udevd 10-zaptel.rules
380
381 if use astribank; then
382 cd "${S}"/xpp/utils
383 eval `perl '-V:installarchlib'`
384 make DESTDIR="${D}" PERLLIBDIR=${installarchlib} install || die "failed xpp utils install"
385 dosbin zt_registration xpp_sync lszaptel
386 fi
387 }
388
389 pkg_postinst() {
390 linux-mod_pkg_postinst
391
392 echo
393 einfo "Use the /etc/init.d/zaptel script to load zaptel.conf settings on startup!"
394 einfo "This ebuild no longer sets permissions on device nodes. Please review"
395 einfo " /etc/udev/rules.d/10-zaptel.rules or the appropriate configuration"
396 einfo " method for your device node manager."
397 echo
398
399 if use bri; then
400 einfo "Bristuff configs have been merged as:"
401 einfo ""
402 einfo "${ROOT}etc/"
403 einfo " zaptel.conf.zaphfc"
404 einfo " zaptel.conf.quadBRI"
405 einfo " zaptel.conf.octoBRI"
406 einfo ""
407 einfo "${ROOT}etc/asterisk/"
408 einfo " zapata.conf.zaphfc"
409 einfo " zapata.conf.quadBRI"
410 einfo " zapata.conf.octoBRI"
411 echo
412 fi
413 }