diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-07-09 15:43:36 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-07-09 15:43:36 +0100 |
commit | 2719f73b6813d11d13a9650cdd2ab8ec6e69385d (patch) | |
tree | 8c816148bcbd22757d892089c989ae614eae4f5a /net-misc/dahdi-tools | |
parent | 0f558761aa2dee1017b4751e4017205e015a9560 (diff) |
gentoo resync : 09.07.2022
Diffstat (limited to 'net-misc/dahdi-tools')
-rw-r--r-- | net-misc/dahdi-tools/Manifest | 2 | ||||
-rw-r--r-- | net-misc/dahdi-tools/dahdi-tools-3.1.0-r3.ebuild | 70 | ||||
-rw-r--r-- | net-misc/dahdi-tools/files/dahdi-autoconf.init-3.1.0-r3 | 271 |
3 files changed, 343 insertions, 0 deletions
diff --git a/net-misc/dahdi-tools/Manifest b/net-misc/dahdi-tools/Manifest index 793795c7b771..0b18ebf6f5d2 100644 --- a/net-misc/dahdi-tools/Manifest +++ b/net-misc/dahdi-tools/Manifest @@ -1,4 +1,5 @@ AUX dahdi-autoconf.conf2 1067 BLAKE2B f6c64135e4b47ce3eafd4b79b4e02ea8bc4d46ab36e30203cf061a5541fc2bdc9bdb2bf6050bc36c8d1e1b5f2ba07f72e83037eccd86ead45fdc97e8a4a3d767 SHA512 7de2ad496a48da487b0f54b0d3c98681e72ebb86107bdf091c74f410d0e2598fe21e1b876eea81d72ef5250570a67a2ece19de6d003b9bbc3def5fae9173189a +AUX dahdi-autoconf.init-3.1.0-r3 6674 BLAKE2B 08e9309034faea3f97ce9c82fbc79b88cafc6ca07fcf9c5f555e815fd13191c6287b0b85896cc7fe3e10fc4e5de29dfa2737313ebdc51b1e1dd9e98bff409fcb SHA512 d2990903350b1275777bcbd0e1c5e38630aca7627d73b2741aaec7ddc055c96ff7d7adc4c55f578cc0fd8f693f6927b4d77f7db7f273f89ba99a9326cf41b1a0 AUX dahdi-autoconf.init2 5817 BLAKE2B c8186a6ff1188ed1d91b86db2b6e861297b5927c7a2cc95a95eb656d4149f2d01c2d8b91412e440f76e9fcb3ff530aef00dae04c38763bd84575cadecdfe2692 SHA512 0201e4555a8c3ccaceb4cfe1fe004dada847608ad6d8ad031f788f72b056e0d0ef0bdad653eb2f492ae08444c2094dc00ac73180a4107eaabc5f5258a91fa50d AUX dahdi-nondigium-blacklist.patch 507 BLAKE2B 5cd8264cfb6792db5fdb92b32dad33a224defb876807d260fbef9f72b943f56f8415a7f082752e261c03982c6b016fe1ce8034d98c6a1aac4cfee7c9d50b3ddb SHA512 4fdb4933e05e07812d1a94efb9bda9038aaadb8a1830cb9ba99d62346f2d007e827771f8de144ef09d6ee5adb1a571ca5ef8ae646c7f62bde8232af30468c2ac AUX dahdi-tools-3.1.0-cplusplusexternc.patch 695 BLAKE2B 8b3cbe872786017759d11bf5d23e6eb41de29003e047ab7244188e0603df6ea669b870216e15cdf4c77a41f7b4f5d10169853aaf839b6dc4d491c0a23121924b SHA512 eecfdb73558b8f4ea8b5ffb55ced8f863960cb1ee92196995ca69e30df4a55f07f59a0b429cfad40271b71b585130438b11861d3459fab87f02ced7032f57ded @@ -8,4 +9,5 @@ AUX dahdi-tools-3.1.0-parallel-make-no-config.patch 681 BLAKE2B c72cc644d88514c8 AUX dahdi.init2 582 BLAKE2B 2e273c929772428586f6800601cc0249a33f61c6aad474c19dd45d9d78a187a9fdd34d1ca26e0eed605fc9630c04b0b0ffd29214a5116749db94bf7609bb078a SHA512 684e8dea54a4f082345100f4d05ca286a085b99c46f0b3fa7300ca5d9a666657afb5405c1f14ac3ba4aba02ce39872e74b9c1cfe6321fd631fa6c39ae38e5ebb DIST dahdi-tools-3.1.0.tar.gz 607449 BLAKE2B aa8ef197cbdecf5c892386aa1c25c940ed3f7c24884f588dcca975d34ee7b4c41722d2529fa305d7568d03302e10e6eb4d5df36a899315e05bf243163500b22d SHA512 e0e5bf24e4834ca39ef7dc1af1bb7ef26bd258a8b2cb2406a7e1ffed25b4b1d44a5fce41d97c5ad7fc6ebb66f965759d2b49ffa6d89845786f43eadb89ff4694 EBUILD dahdi-tools-3.1.0-r2.ebuild 2152 BLAKE2B 2c84f625ba1d41d43a69841c8d4dcbe898e1f5c54c54b0a554b3e382c0861fa97b4d027fb63b1b4e4ae2fa7b32dd81389554af2cab3cedfad0c68c2288748537 SHA512 b4e76d483b67390b1a889d868118093d2d5db443d80ded95c0a3424b478a16da934b3911fa451ae7fca380f3a76fad6b821f2ca9ba91f87b27869f15d14b486c +EBUILD dahdi-tools-3.1.0-r3.ebuild 2162 BLAKE2B dfc90c8ccdaf62e2456717aec490bf5248955149a7af8e7f7523349337ec9f8b2dedfa6ff4d7a830ac8180f2e53b0e056565972d170cd779872853639d9c29de SHA512 664ef6000fa11a95f7dfcad22cb7570603a46691e5a7ad7b7e869114f149fe93f73f39b84f97fa83ac260719aa2da342aa02720ab9457dbadb6425d554f8cbdb MISC metadata.xml 474 BLAKE2B 05062875e00c015c39cce4432a8197606dcbe1d40efb3058843c05defedd04304581a449b7a1abeb37ac96c5e6c9559ef9b36f7cbe1123783cc1822a25c5ee78 SHA512 bd60b375dd7863a16f525eb82c7c97d2a93032a93963ab764523fb774692b2ad107cb69eab4eacc695d67316307b91bac8e299a9c3d2689894d9dc174516c2a7 diff --git a/net-misc/dahdi-tools/dahdi-tools-3.1.0-r3.ebuild b/net-misc/dahdi-tools/dahdi-tools-3.1.0-r3.ebuild new file mode 100644 index 000000000000..4cdea940512c --- /dev/null +++ b/net-misc/dahdi-tools/dahdi-tools-3.1.0-r3.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit autotools bash-completion-r1 perl-functions udev + +DESCRIPTION="Userspace tools to configure the kernel modules from net-misc/dahdi" +HOMEPAGE="https://www.asterisk.org" +SRC_URI="https://downloads.asterisk.org/pub/telephony/${PN}/releases/${P}.tar.gz" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" +IUSE="ppp" +PATCHES=( + "${FILESDIR}/dahdi-nondigium-blacklist.patch" + "${FILESDIR}/dahdi-tools-3.1.0-parallel-make-no-config.patch" + "${FILESDIR}/dahdi-tools-3.1.0-fno-common.patch" + "${FILESDIR}/dahdi-tools-3.1.0-execinfo.patch" + "${FILESDIR}/dahdi-tools-3.1.0-cplusplusexternc.patch" +) + +DEPEND="dev-libs/newt + net-misc/dahdi + sys-kernel/linux-headers + virtual/libusb:0 + ppp? ( net-dialup/ppp:= )" +RDEPEND="${DEPEND} + dev-lang/perl:= + dev-perl/CGI" +BDEPEND="dev-lang/perl + sys-apps/file" + +src_prepare() { + default + eautoreconf +} + +src_configure() { + econf $(use_with ppp) --with-perllib="$(perl_get_vendorlib)" + sed -re 's/ -Werror($|[[:space:]])//' -i xpp/oct612x/Makefile.in || die "sed to eliminate -Werror failed." + sed -re '/[[:space:]]*-Werror[[:space:]]*\\$/ d' -i xpp/xtalk/Makefile || die "sed to eliminate -Werror failed." +} + +src_install() { + local bashcompdir="$(get_bashcompdir)" + local bashcmd bashcmdtarget + + emake DESTDIR="${ED}" bashcompdir="${bashcompdir}" udevrulesdir="$(get_udevdir)/rules.d" install + emake DESTDIR="${ED}" install-config + + dosbin patgen pattest patlooptest hdlcstress hdlctest hdlcgen hdlcverify timertest + + # install init scripts + newinitd "${FILESDIR}"/dahdi.init2 dahdi + newinitd "${FILESDIR}"/dahdi-autoconf.init-3.1.0-r3 dahdi-autoconf + newconfd "${FILESDIR}"/dahdi-autoconf.conf2 dahdi-autoconf + + bashcomp_alias dahdi $(sed -nre 's/^complete -F .* //p' "${ED}${bashcompdir}/dahdi" || + die "Error parsing dahdi bash completion file for commands") + + rm "${ED}"/usr/$(get_libdir)/libtonezone.a || die "Unable to remove static libs from install." + # Delete *if* the libtool file exists, bug #778380 + find "${ED}" -name '*.la' -delete || die +} + +pkg_postinst() { + udev_reload +} diff --git a/net-misc/dahdi-tools/files/dahdi-autoconf.init-3.1.0-r3 b/net-misc/dahdi-tools/files/dahdi-autoconf.init-3.1.0-r3 new file mode 100644 index 000000000000..3841aca8d18a --- /dev/null +++ b/net-misc/dahdi-tools/files/dahdi-autoconf.init-3.1.0-r3 @@ -0,0 +1,271 @@ +#!/sbin/openrc-run +# Copyright 1999-2011 Ultimate Linux Solutions CC +# Distributed under the terms of the GNU General Public License v2 + +depend() { + before dahdi +} + +dahdi_load_modules() { + local hwlist loc status mod mod_vname pciid desc + + hwlist=$(/usr/sbin/dahdi_hardware) + + if [ -z "${hwlist}" ]; then + einfo "No digium hardware found." + ebegin "Loading module dahdi_dummy" + /sbin/modprobe dahdi_dummy + eend $? + return + fi + + echo "${hwlist}" | while read loc mod pciid desc; do + status="${mod:${#mod}-1:1}" + mod="${mod%[+-]}" + mod_vname="mod_${mod}" + + einfo "Found $desc at $loc (module: $mod)" + + if [ "${status}" = "-" -a "${!mod_vname-notloaded}" = "notloaded" ]; then + ebegin "Loading module $mod" + /sbin/modprobe $mod + eend + + [ $? -eq 0 ] && eval "$mod_vname=loaded" + fi + done +} + +dahdi_module_unload() { + local mod=$1 s + [ -d /sys/module/${mod} ] || return 0 + + for s in $(find /sys/module/${mod}/holders -type l); do + dahdi_module_unload $(basename $s) + done + + ebegin "Removing dahdi module: $mod" + /sbin/rmmod $mod + eend $? +} + +dahdi_gen_fxo_config() { + local port=$1 + + echo "fxs${DAHDI_FXO_SIGNALLING-ks}=${port}" + [ "${DAHDI_FXO_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${port}" +} + +dahdi_gen_fxs_config() { + local port=$1 + + echo "fxo${DAHDI_FXO_SIGNALLING-ks}=${port}" + [ "${DAHDI_FXS_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${port}" +} + +dahdi_gen_bri_te_config() { + span=$1 + port=$2 + basechan=$3 + + echo "span=${span},${port},0,${DAHDI_BRI_FRAMING-CSS},${DAHDI_BRI_CODING-AMI}" + echo "bchan=${basechan}-$(( basechan + 1 ))" + echo "hardhdlc=$(( basechan + 2 ))" + [ "${DAHDI_BRI_TE_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${basechan}-$(( basechan + 1 ))" +} + +dahdi_gen_bri_nt_config() { + span=$1 + port=$2 + basechan=$3 + + echo "span=${span},0,0,${DAHDI_BRI_FRAMING-CSS},${DAHDI_BRI_CODING-AMI}" + echo "bchan=${basechan}-$(( basechan + 1 ))" + echo "hardhdlc=$(( basechan + 2 ))" + [ "${DAHDI_BRI_NT_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${basechan}-$(( basechan + 1 ))" +} + +dahdi_gen_e1_cpe_config() { + span=$1 + port=$2 + basechan=$3 + + echo "span=${span},${port},0,${DAHDI_E1_FRAMING-CCS},${DAHDI_E1_CODING-HDB3,CRC4}" + bchans="${basechan}-$(( basechan + 14 )),$(( basechan + 16 ))-$(( basechan + 30 ))" + echo "bchan=${bchans}" + echo "dchan=$(( basechan + 15 ))" + [ "${DAHDI_E1_CPE_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${bchans}" +} + +dahdi_gen_e1_net_config() { + span=$1 + port=$2 + basechan=$3 + + echo "span=${span},0,0,${DAHDI_E1_FRAMING-CCS},${DAHDI_E1_CODING-HDB3,CRC4}" + bchans="${basechan}-$(( basechan + 14 )),$(( basechan + 16 ))-$(( basechan + 30 ))" + echo "bchan=${bchans}" + echo "dchan=$(( basechan + 15 ))" + [ "${DAHDI_E1_NET_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${bchans}" +} + +dahdi_gen_t1_cpe_config() { + span=$1 + port=$2 + basechan=$3 + + echo "span=${span},${port},0,${DAHDI_T1_FRAMING-ESF},${DAHDI_T1_CODING-B8ZS}" + bchans="${basechan}-$(( basechan + 22 ))" + echo "bchan=${bchans}" + echo "dchan=$(( basechan + 23 ))" + [ "${DAHDI_T1_CPE_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${bchans}" +} + +dahdi_gen_t1_net_config() { + span=$1 + port=$2 + basechan=$3 + + echo "span=${span},0,0,${DAHDI_T1_FRAMING-ESF},${DAHDI_T1_CODING-B8ZS}" + bchans="${basechan}-$(( basechan + 22 ))" + echo "bchan=${bchans}" + echo "dchan=$(( basechan + 23 ))" + [ "${DAHDI_T1_NET_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${bchans}" +} + +dahdi_conf_span() { + local span=$1 + local type=$2 + local desc=$3 + local port=$4 + local basechan=$5 + local vname="PRI_SPAN_${span}_NET" + local cfunc="dahdi_gen_" + + # Analog we need to deal with on a port-by-port basis. + [ "${type}" = "analog" ] && return 0 + + echo "" + echo "# ${desc}" + + case "${type}" in + digital-TE) + cfunc+="bri_te" + ;; + digital-NT) + cfunc+="bri_nt" + ;; + digital-[TE]1) + cfunc+="$(echo "${type##*-}" | tr 'TE' 'te')" + # Use CPE by default. Unfortunately there is no easy + # way to detect CPE vs NET as far as I know and specifying + # in a config that you want NET mode seems the sanest way. + if yesno "${vname}"; then + cfunc+="_net" + else + cfunc+="_cpe" + fi + ;; + *) + echo "# Don't know how to configure this (type=${type})." + echo "# Please file a bug on bugs.gentoo.org and add jaco@uls.co.za as CC." + return 1 + ;; + esac + + "${cfunc}_config" "${span}" "${port}" "${basechan}" +} + +dahdi_gen_config() { + local type manufacturer devicetype basechan aport atype + local span= + local tfile="$(mktemp)" + local sfile="$(mktemp)" + local plocation="" + local isdnport=0 + + /usr/sbin/dahdi_scan > "${sfile}" + exec 3<"${sfile}" + exec 4>"${tfile}" + + echo "# Automatically dahdi-autoconf generated file ($(date))." >&4 + echo "# This file WILL get regenerated whenever you restart dahdi-autoconf." >&4 + + while read LINE <&3; do + case "$LINE" in + \[*\]) + if [ -n "${span}" ]; then + ebegin "Configuring ${manufacturer} ${devicetype} (${name})" + dahdi_conf_span "${span}" "${type}" "${manufacturer} ${devicetype} (${name})" "${isdnport}" "${basechan}" >&4 + eend $? + fi + span="${LINE%?}" + span="${span#?}" + ;; + type=*|manufacturer=*|devicetype=*|basechan=*|name=*) + eval "${LINE%%=*}='${LINE#*=}'" + ;; + location=*) + eval "${LINE%%=*}='${LINE#*=}'" + if [ "${location}" = "${plocation}" ]; then + isdnport=$(( isdnport + 1 )) + else + plocation="${location}" + isdnport=1 + fi + ;; + port=*) + # For analog cards only. + aport="${LINE#*=}"; aport="${aport%,*}" + atype="${LINE#*,}" + if [ "${aport}" -eq "${basechan}" ]; then + echo "" >&4 + echo "# ${manufacturer} ${devicetype} (${name})" >&4 + fi + case "${atype}" in + FXO) + dahdi_gen_fxo_config $aport >&4 + ;; + FXS) + dahdi_gen_fxs_config $aport >&4 + ;; + esac + ;; + esac + done + + if [ -n "${span}" ]; then + ebegin "Configuring ${manufacturer} ${devicetype} (${name})" + dahdi_conf_span "${span}" "${type}" "${manufacturer} ${devicetype} (${name})" "${isdnport}" "${basechan}" >&4 + eend $? + fi + + echo "" >&4 + echo "loadzone = ${DAHDI_ZONE}" >&4 + echo "defaultzone = ${DAHDI_ZONE}" >&4 + echo "## END OF AUTOCONFIGURED FILE ##" >&4 + + exec 3<&- + exec 4<&- + + rm -f "${sfile}" + [ -r /etc/dahdi/system.conf ] && mv /etc/dahdi/system.conf /etc/dahdi/system.conf.bck + mv "${tfile}" /etc/dahdi/system.conf +} + +start() { + dahdi_load_modules + + if [ ! -r /dev/dahdi/ctl ]; then + eerror "No DAHDI compatible cards detected." + return 1 + fi + + ebegin "Generating DAHDI Configuration" + dahdi_gen_config + eend $? +} + +stop() { + dahdi_module_unload dahdi +} |