# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ DESCRIPTION="cmictl sets some internal parameters of CMI 8338/8738 based soundcards." HOMEPAGE="http://member.nifty.ne.jp/Breeze/softwares/unix/cmictl.html" SRC_URI="http://member.nifty.ne.jp/Breeze/softwares/unix/bin/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="X nls" DEPEND=" X? ( virtual/x11 ) >=x11-libs/gtk+-1.2.0 " S=${WORKDIR}/${P} src_compile() { local myconf use X || myconf="--disable-gcmictl" use nls || myconf="${myconf} --disable-nls" # If CMIBASE has been set or detected, state what is being used, otherwise die [ -z "${CMIBASE}" ] && CMIBASE="0x$(grep cmpci /proc/ioports | grep -v "Midi" | grep -v "FM" | cut -d '-' -f 1 | sed 's/^ *//')" [ "${CMIBASE}" ] && myconf="${myconf} --with-cmibase=${CMIBASE}" && einfo "Using CMIBASE=${CMIBASE}" || ( ewarn "I couldn't detect your sound card's IO port." && ewarn "Please set CMIBASE to the IO address of your card." && ewarn "Usually this is the first four digits of the cmpci line in /proc/ioports" ) [ -z "${CMIBASE}" ] && die "CMIBASE needs setting." ./configure \ --host=${CHOST} \ --prefix=/usr \ --infodir=/usr/share/info \ --mandir=/usr/share/man \ --disable-gtktest \ ${myconf} || die "./configure failed" emake || die } src_install() { make DESTDIR=${D} install || die dodoc AUTHORS COPYING ChangeLog INSTALL README } pkg_postinst() { echo einfo "${PN} was configured with your sound card's IO address as: ${CMIBASE}" einfo "If this is not correct, consult /proc/ioports, look for the cmpci line and specify the first four digits of the number to this ebuild with:" einfo "CMIBASE=\"0xNNNN\" emerge ${PN}" einfo "where NNNN is the number from /proc/ioports" einfo "The author of this software warns that this program could cause damage if the IO port is wrong." echo }