From 493da614b9c6c2f2e615d00d1b8e7eb1bf88ae49 Mon Sep 17 00:00:00 2001 From: Rajiv Aaron Manglani Date: Sun, 24 Feb 2008 20:52:41 +0000 Subject: [PATCH] version bump, bug #208190. Package-Manager: portage-2.1.4.4 --- net-misc/zaptel/ChangeLog | 8 +- net-misc/zaptel/Manifest | 4 +- net-misc/zaptel/zaptel-1.2.24.ebuild | 363 +++++++++++++++++++++++++++ 3 files changed, 373 insertions(+), 2 deletions(-) create mode 100644 net-misc/zaptel/zaptel-1.2.24.ebuild diff --git a/net-misc/zaptel/ChangeLog b/net-misc/zaptel/ChangeLog index e6a2d4cf9293..7e0694aa2277 100644 --- a/net-misc/zaptel/ChangeLog +++ b/net-misc/zaptel/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-misc/zaptel # Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.104 2008/02/24 18:25:48 rajiv Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.105 2008/02/24 20:52:41 rajiv Exp $ + +*zaptel-1.2.24 (24 Feb 2008) + + 24 Feb 2008; Rajiv Aaron Manglani + +zaptel-1.2.24.ebuild: + version bump, bug #208190. 24 Feb 2008; Rajiv Aaron Manglani -files/zaptel-bristuff-0.2.0-RC8q.patch, -files/zaptel-1.2.0-ukcid.patch, diff --git a/net-misc/zaptel/Manifest b/net-misc/zaptel/Manifest index fd2363c97e16..375ed1af3843 100644 --- a/net-misc/zaptel/Manifest +++ b/net-misc/zaptel/Manifest @@ -14,8 +14,10 @@ DIST zaphfc_0.3.0-PRE-1y-h_florz-12.diff.gz 10806 RMD160 34834559a99e3a52ade9ff7 DIST zaphfc_0.3.0-PRE-1y-l_florz-12.1.diff.gz 10277 RMD160 20507dfa5fa9f882ebcd26b0634c07f34c4f0874 SHA1 3cbf5e061b7efe0103b2b80a4b42183a0da7bed8 SHA256 e564ae8c5da0c27899dff3d9c32c4579cc86f9eaf848f972dbb361050c8c86f4 DIST zaptel-1.2.18.tar.gz 3076214 RMD160 e051b06311681c281a70c4826705b2ab315377c1 SHA1 9ec57df2548b77d4e591aa9253393153455177db SHA256 c1bfd262dcb428456cf590c6740f146d409faceeba9969585d8bec4ceb376b4d DIST zaptel-1.2.23.tar.gz 3696838 RMD160 717f376273810310858c28d3cbf700c778b70d71 SHA1 992b8ca44076b8ebdbe39909753b585324c44082 SHA256 1b8a77b999ff60b37d6f4163d07458ca3f4c54c9bdba43b3385168a127705e5b +DIST zaptel-1.2.24.tar.gz 3698419 RMD160 dae9da002162ad74d3324f0b0bad409af2585666 SHA1 4a45654ce392a8ba5a5d73a0a01ba8febfcc5c4b SHA256 2c00825461ac3605311f3be646fec0c95715954bbf71aca4eda105fea7895da0 EBUILD zaptel-1.2.18-r1.ebuild 11135 RMD160 4f16f3e055e5f19aedf0a6e05ca40d2ac4ec7318 SHA1 a50d7a2e5dee7be8119034c8360d6501c1deb37f SHA256 ff1351ea9269cb30c3a6eb28ec873f52e18e88ae5bbf3ec5e970c8ad4d83b1b6 EBUILD zaptel-1.2.18.ebuild 9344 RMD160 f27247f4e762009092e02a59b2edefed97d16e8c SHA1 a3c05a521c7246bf65c5e504ca2e17ec53b99488 SHA256 86b0b1bffac3a8be89161b2f087eed44fb3e509a3765daca32d3919891c50ceb EBUILD zaptel-1.2.23.ebuild 8950 RMD160 ae775faa15c11d49b042943f163c186a06d39383 SHA1 6f18504009a31fafca054044197897468795d615 SHA256 489ad83ed52f6ee6b558241d483f4d30af0334008dd0360cd24b53cd6511e6ad -MISC ChangeLog 20932 RMD160 bef231efa9a57b88a555b73f113980bcf212d3d4 SHA1 6e03bbf2e5133061256886a239bca74b0dfc746a SHA256 546902f68236754c1b80c9842f408e96c29e239c2da2393a1615fbc891322add +EBUILD zaptel-1.2.24.ebuild 8959 RMD160 28379acbc47408fd6a61efc973924c333a2d5aa0 SHA1 337060203ba5e0514fa116963620b32eea99cae9 SHA256 559584c26f70d170c0b028ca3a9aa0b7fcf2e97ea8ce0c7820c7e0e0816bc203 +MISC ChangeLog 21072 RMD160 9753ff54c22a11bae61bdada75d4c8df74933477 SHA1 c39689e8f603e31dc4ffc344e9cd0700b878c488 SHA256 97bd954ca6298b9289ada1a9cb9bd532914a2b8b3a140717f7fe885f2860584e MISC metadata.xml 345 RMD160 ce0076215245b28c91df8fcaf8a62c26c4f6b17e SHA1 b5d75d0687c1bb698d4ead8663aae5b7e73728fe SHA256 79f621be31d2899b13106f9a518c4c34971005fee3dd15564582d107e62da2e8 diff --git a/net-misc/zaptel/zaptel-1.2.24.ebuild b/net-misc/zaptel/zaptel-1.2.24.ebuild new file mode 100644 index 000000000000..931a80c8b0f6 --- /dev/null +++ b/net-misc/zaptel/zaptel-1.2.24.ebuild @@ -0,0 +1,363 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/zaptel-1.2.24.ebuild,v 1.1 2008/02/24 20:52:41 rajiv Exp $ + +inherit toolchain-funcs eutils linux-mod flag-o-matic + +BRI_VERSION="0.3.0-PRE-1y-l" +FLORZ_VERSION="0.3.0-PRE-1y-l_florz-12.1" + +IUSE="astribank bri ecmark ecmark2 ecmark3 ecaggressive eckb1 ecmg2 ecsteve ecsteve2 florz +rtc watchdog zapras zapnet" + +MY_P="${P/_/-}" + +DESCRIPTION="Drivers for Digium and ZapataTelephony cards" +HOMEPAGE="http://www.asterisk.org" +SRC_URI="http://downloads.digium.com/pub/zaptel/releases/${MY_P}.tar.gz + bri? ( http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz ) + florz? ( http://zaphfc.florz.dyndns.org/zaphfc_${FLORZ_VERSION}.diff.gz ) + " + +S="${WORKDIR}/${MY_P}" + +S_BRI="${WORKDIR}/bristuff-${BRI_VERSION}" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~ppc ~x86" + +RDEPEND="virtual/libc + dev-libs/libusb + >=dev-libs/newt-0.50.0 + astribank? ( dev-lang/perl )" + +DEPEND="${RDEPEND} virtual/linux-sources" + +# list of echo canceller use flags, +# first active in this list is selected (=order does matter) +ZAP_EC_FLAGS="ecmark ecmark2 ecmark3 ecsteve ecsteve2 eckb1 ecmg2" + +### Begin: Helper functions + +select_echo_cancel() { + local myEC="" + + for x in ${ZAP_EC_FLAGS}; do + if use $x; then + myEC=$(echo "$x" | sed -e "s:^ec::" | tr '[:lower:]' '[:upper:]') + break; + fi + done + + echo ${myEC} +} + +zconfig_disable() { + if grep -q "${1}" "${S}"/zconfig.h; then + # match a little more than ${1} so we can use zconfig_disable + # to disable all echo cancellers in zconfig.h w/o calling it several times + sed -i -e "s:^[ \t]*#define[ \t]\+\(${1}[a-zA-Z0-9_-]*\).*:#undef \1:" \ + "${S}"/zconfig.h + fi + + return $? +} + +zconfig_enable() { + if grep -q "${1}" "${S}"/zconfig.h; then + sed -i -e "s:^/\*[ \t]*#define[ \t]\+\(${1}\).*:#define \1:" \ + -e "s:^[ \t]*#undef[ \t]\+\(${1}\).*:#define \1:" \ + "${S}"/zconfig.h + fi + + return $? +} + +### End: Helper functions + +pkg_setup() { + local result=0 numec=0 + + linux-mod_pkg_setup + + einfo "Running pre-flight checks..." + + # basic zaptel checks + if kernel_is 2 4 ; then + if ! linux_chkconfig_present CRC32; then + echo + eerror "Your kernel lacks CRC32 support!" + eerror "Enable CONFIG_CRC32!" + result=$((result+1)) + fi + else + if ! linux_chkconfig_present CRC_CCITT; then + echo + eerror "Your kernel lacks CRC_CCIT support!" + eerror "Enable CONFIG_CRC_CCIT!" + result=$((result+1)) + fi + if ! linux_chkconfig_present FW_LOADER; then + echo + eerror "Your kernel lacks FW_LOADER support!" + eerror "Enable CONFIG_FW_LOADER!" + result=$((result+1)) + fi + fi + + # check if multiple echo cancellers have been selected + for x in ${ZAP_EC_FLAGS}; do + use $x && numec=$((numec+1)) + done + if [[ $numec -gt 1 ]]; then + # multiple flags are active, only the first in the ZAP_EC_FLAGS list + # will be used, make sure the user knows about this + echo + ewarn "Multiple echo canceller flags are active but only one will be used!" + ewarn "Selected: $(select_echo_cancel)" + fi + + # we need at least HDLC generic support + if use zapnet && ! linux_chkconfig_present HDLC; then + echo + eerror "zapnet: Your kernel lacks HDLC support!" + eerror "zapnet: Enable CONFIG_HDLC* to use zaptel network support!" + result=$((result+1)) + fi + + # zapras needs PPP support + if use zapras && ! linux_chkconfig_present PPP; then + echo + eerror "zapras: Your kernel lacks PPP support!" + eerror "zapras: Enable CONFIG_PPP* to use zaptel ras support!" + result=$((result+1)) + fi + + # rtc needs linux-2.6 and CONFIG_RTC + if use rtc; then + if ! kernel_is 2 6; then + echo + eerror "rtc: >=Linux-2.6.0 is needed for rtc support!" + result=$((result+1)) + fi + + if ! linux_chkconfig_present RTC; then + eerror "rtc: Your kernel lacks RealTime-Clock support!" + result=$((result+1)) + fi + fi + + if [[ $result -gt 0 ]]; then + echo + ewarn "One or more of the neccessary precondition(s) is/are not met!" + ewarn "Look at the messages above, resolve the problem (or disable the use-flag) and try again" + echo + + if [[ $result -lt 3 ]]; then + eerror "[$result Error(s)] Zaptel is not happy :(" + else + eerror "[$result Error(s)] You're making zaptel cry :'(" + fi + die "[$result] Precondition(s) not met" + fi + + echo + einfo "Zaptel is happy and continues... :)" +} + +src_unpack() { + unpack ${A} + + cd "${S}" + epatch "${FILESDIR}"/${PN}-1.2.23-gentoo.diff + epatch "${FILESDIR}"/zaptel-1.2.9.1-ar.patch + + # try to apply bristuff patch + if use bri; then + # fix for userpriv + chmod -R a=rwX ${S_BRI} + + einfo "Patching zaptel w/ BRI stuff (${BRI_VERSION})" + epatch ${S_BRI}/patches/zaptel.patch + + cd ${S_BRI} + + if use florz; then + einfo "Patching zaptel with florz (${FLORZ_VERSION}) for zaphfc" + epatch "${WORKDIR}"/zaphfc_${FLORZ_VERSION}.diff + fi + + # patch includes + sed -i -e "s:^#include.*zaptel\.h.*:#include :" \ + qozap/qozap.c \ + zaphfc/zaphfc.c \ + cwain/cwain.c + + # patch makefiles + sed -i -e "s:^ZAP[\t ]*=.*:ZAP=-I${S}:" \ + -e "s:^MODCONF=.*:MODCONF=/etc/modules.d/zaptel:" \ + -e "s:linux-2.6:linux:g" \ + qozap/Makefile \ + zaphfc/Makefile \ + cwain/Makefile + + sed -i -e "s:^\(CFLAGS+=-I. \).*:\1 \$(ZAP):" \ + zaphfc/Makefile + + cd "${S}" + fi + +### Configuration changes + local myEC + + # prepare zconfig.h + myEC=$(select_echo_cancel) + if [[ -n "${myEC}" ]]; then + einfo "Selected echo canceller: ${myEC}" + # disable default first, set new selected ec afterwards + zconfig_disable ECHO_CAN + zconfig_enable ECHO_CAN_${myEC} + fi + + # enable rtc support on 2.6 + if use rtc && linux_chkconfig_present RTC && kernel_is 2 6; then + einfo "Enabling ztdummy RTC support" + zconfig_enable USE_RTC + fi + + # enable agressive echo surpression + use ecaggressive && \ + zconfig_enable AGGRESSIVE_SUPPRESSOR + + # ppp ras support + use zapras && \ + zconfig_enable CONFIG_ZAPATA_PPP + + # frame relay, syncppp... + use zapnet && \ + zconfig_enable CONFIG_ZAPATA_NET + + # zaptel watchdog + use watchdog && \ + zconfig_enable CONFIG_ZAPTEL_WATCHDOG +} + +src_compile() { + # build + make KVERS=${KV_FULL} \ + KSRC=${KV_DIR} ARCH=$(tc-arch-kernel) || die + + if use astribank; then + cd "${S}"/xpp/utils + make || die "make xpp utils failed" + fi + + if use bri; then + cd ${S_BRI} + for x in cwain qozap zaphfc; do + einfo "Building ${x}..." + make KVERS=${KV_FULL} \ + KSRC=/usr/src/linux \ + ARCH=$(tc-arch-kernel) \ + -C ${x} || die "make ${x} failed" + done + fi +} + +src_install() { + # Create firmware directory + mkdir -p "${D}"/lib/firmware/ + + kernel_is 2 4 && cp /etc/modules.conf "${D}"/etc + make DESTDIR="${D}" ARCH=$(tc-arch-kernel) \ + KVERS=${KV_FULL} KSRC=/usr/src/linux devices firmware \ + install-modules install-programs || die + + dodoc ChangeLog README README.udev README.fxsusb zaptel.init + dodoc zaptel.conf.sample zaptel.sysconfig README.fxotune + + # additional tools + dobin ztmonitor ztspeed zttest fxotune + + # install all header files, several packages need the complete set + # (e.g. sangoma wanpipe) + insinto /usr/include/zaptel + doins *.h + + if use bri; then + einfo "Installing bri" + cd ${S_BRI} + + insinto /lib/modules/${KV_FULL}/misc + doins qozap/qozap.${KV_OBJ} + doins zaphfc/zaphfc.${KV_OBJ} + doins cwain/cwain.${KV_OBJ} + + # install example configs for octoBRI and quadBRI + insinto /etc + doins qozap/zaptel.conf.octoBRI + newins qozap/zaptel.conf zaptel.conf.quadBRI + newins zaphfc/zaptel.conf zaptel.conf.zaphfc + + insinto /etc/asterisk + doins qozap/zapata.conf.octoBRI + newins qozap/zapata.conf zapata.conf.quadBRI + newins zaphfc/zapata.conf zapata.conf.zaphfc + + docinto bristuff + dodoc CHANGES INSTALL + + docinto bristuff/qozap + dodoc qozap/TODO qozap/*.conf* + + docinto bristuff/zaphfc + dodoc zaphfc/*.conf + + docinto bristuff/cwain + dodoc cwain/TODO + + cd "${S}" + fi + + # install init script + newinitd "${FILESDIR}"/zaptel.rc6 zaptel + newconfd "${FILESDIR}"/zaptel.confd zaptel + + # install udev rule file + insinto /etc/udev/rules.d + newins "${FILESDIR}"/zaptel.udevd 10-zaptel.rules + + if use astribank; then + cd "${S}"/xpp/utils + eval `perl '-V:installarchlib'` + make DESTDIR="${D}" PERLLIBDIR=${installarchlib} install || die "failed xpp utils install" + dosbin zt_registration xpp_sync lszaptel + fi +} + +pkg_postinst() { + linux-mod_pkg_postinst + + echo + einfo "Use the /etc/init.d/zaptel script to load zaptel.conf settings on startup!" + einfo "This ebuild no longer sets permissions on device nodes. Please review" + einfo " /etc/udev/rules.d/10-zaptel.rules or the appropriate configuration" + einfo " method for your device node manager." + echo + + if use bri; then + einfo "Bristuff configs have been merged as:" + einfo "" + einfo "${ROOT}etc/" + einfo " zaptel.conf.zaphfc" + einfo " zaptel.conf.quadBRI" + einfo " zaptel.conf.octoBRI" + einfo "" + einfo "${ROOT}etc/asterisk/" + einfo " zapata.conf.zaphfc" + einfo " zapata.conf.quadBRI" + einfo " zapata.conf.octoBRI" + echo + fi +} -- 2.26.2