diff options
author | 2003-03-07 15:35:10 +0000 | |
---|---|---|
committer | 2003-03-07 15:35:10 +0000 | |
commit | f8471e7fddc636297abfd43742bcc1a7504c850f (patch) | |
tree | 87e3862090fdf223e2dfd91616cf158aa9f87177 | |
parent | added 4.3.10 (with gtk+-1.2 dep bug #14945) (diff) | |
download | gentoo-2-f8471e7fddc636297abfd43742bcc1a7504c850f.tar.gz gentoo-2-f8471e7fddc636297abfd43742bcc1a7504c850f.tar.bz2 gentoo-2-f8471e7fddc636297abfd43742bcc1a7504c850f.zip |
make wrapper script automagic
-rw-r--r-- | media-sound/emu10k1/ChangeLog | 7 | ||||
-rw-r--r-- | media-sound/emu10k1/emu10k1-0.20a-r1.ebuild | 85 | ||||
-rw-r--r-- | media-sound/emu10k1/emu10k1-0.20a-r2.ebuild | 88 | ||||
-rw-r--r-- | media-sound/emu10k1/emu10k1-0.20a-r4.ebuild (renamed from media-sound/emu10k1/emu10k1-0.20a-r3.ebuild) | 6 | ||||
-rw-r--r-- | media-sound/emu10k1/files/digest-emu10k1-0.20a-r2 | 1 | ||||
-rw-r--r-- | media-sound/emu10k1/files/digest-emu10k1-0.20a-r3 | 1 | ||||
-rw-r--r-- | media-sound/emu10k1/files/digest-emu10k1-0.20a-r4 (renamed from media-sound/emu10k1/files/digest-emu10k1-0.20a-r1) | 0 | ||||
-rw-r--r-- | media-sound/emu10k1/files/emu10k1-script | 38 | ||||
-rw-r--r-- | media-sound/emu10k1/files/emu10k1.conf-gentoo-header | 9 |
9 files changed, 47 insertions, 188 deletions
diff --git a/media-sound/emu10k1/ChangeLog b/media-sound/emu10k1/ChangeLog index 3e33fb04a3c4..0bb93e4dd48e 100644 --- a/media-sound/emu10k1/ChangeLog +++ b/media-sound/emu10k1/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for media-sound/emu10k1 # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/emu10k1/ChangeLog,v 1.9 2003/02/12 07:27:08 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-sound/emu10k1/ChangeLog,v 1.10 2003/03/07 15:35:10 vapier Exp $ + +*emu10k1-0.20a-r4 (07 Mar 2003) + + 07 Mar 2003; Mike Frysinger <vapier@gentoo.org> : + Updated wrapper script to detect card type automagically. *emu10k1-0.20a-r3 (11 Feb 2003) diff --git a/media-sound/emu10k1/emu10k1-0.20a-r1.ebuild b/media-sound/emu10k1/emu10k1-0.20a-r1.ebuild deleted file mode 100644 index c1a596b689e1..000000000000 --- a/media-sound/emu10k1/emu10k1-0.20a-r1.ebuild +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright 1999-2003 Gentoo Technologies, Inc. -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/emu10k1/emu10k1-0.20a-r1.ebuild,v 1.8 2003/02/13 13:10:23 vapier Exp $ - -MY_P="${P/-/-v}" -DESCRIPTION="Drivers, utilities, and effects for Sound Blaster cards (SBLive!, SB512, Audigy)" -SRC_URI="mirror://sourceforge/emu10k1/${MY_P}.tar.bz2" -HOMEPAGE="http://www.sourceforge.net/projects/emu10k1/" - -DEPEND="virtual/linux-sources" -RDEPEND="media-sound/aumix" - -KEYWORDS="x86 -ppc -sparc -alpha" -SLOT="${KV}" -LICENSE="GPL-2" - -S="${WORKDIR}/${MY_P}" - -pkg_setup() { - [ -z "$KV" ] && die "Couldn't detect kernel version. Does /usr/src/linux exist?" - return 0 -} - -src_compile() { - echo "SEQUENCER_SUPPORT := y" > config - echo "DBGEMU := n" >> config - - export KERNEL_SOURCE=/usr/src/linux - make || die "make failed" - make all || die "make all failed" - make tools || die "make tools failed" -} - -src_install() { - insinto /etc/modules.d - newins ${FILESDIR}/modules-emu10k1 emu10k1 - - # first install the main parts - make DESTDIR=${D} install || die "could not install" - - # now fix up the script so it'll install into /usr and not /usr/local - for f in ${S}/utils/{Makefile.config,scripts/{audigy,emu}-script} ; do - cp ${f} ${f}.old - sed -e 's:/usr/local:/usr:g' ${f}.old > ${f} - done - make DESTDIR=${D} install-tools || die "could not install tools" - - # clean up the /usr/etc directory - cd ${D}/usr/etc - mv `find -type f -perm +1` ../bin/ - mv * ${D}/etc/ - cd ${D} - rm -rf ${D}/usr/etc - - # clean up the scripts - dosed 's:$BASE_PATH/etc:/etc:g' /usr/bin/emu-script - dosed 's:$BASE_PATH/etc:/etc:g' /usr/bin/audigy-script - dosed 's:.aumixrc:aumixrc:g' /usr/bin/audigy-script - dosed 's:/bin/aumix-minimal:/usr/bin/aumix:g' /usr/bin/audigy-script - dosed 's:/etc/.aumixrc:/etc/aumixrc:g' /usr/bin/audigy-script - - # change default settings - dosed 's:AC3PASSTHROUGH=no:AC3PASSTHROUGH=yes:' /etc/emu10k1.conf - dosed 's:ANALOG_FRONT_BOOST=no:ANALOG_FRONT_BOOST=yes:' /etc/emu10k1.conf - dosed 's:SURROUND=no:SURROUND=yes:' /etc/emu10k1.conf -} - -pkg_postinst() { - /sbin/depmod -a - einfo "In order for the module to work correctly you must" - einfo "Enable the following options in your kernel:" - echo - einfo "Sound/Sound card support (module or builtin)" - einfo "Sound/OSS sound modules (module or builtin)" - echo - einfo "In addition, ensure that the following modules are" - einfo "*not* built in to your kernel, or are at least" - einfo "built as modules are not currently loaded." - echo - einfo "Sound/Creative SBLive! (EMU10K1) (disabled or module)" - einfo "Sound/Creative SBLive! MIDI (disabled or module)" - echo - einfo "If you have not yet done this, rebuild and install" - einfo "your kernel modules and re-emerge this package." -} diff --git a/media-sound/emu10k1/emu10k1-0.20a-r2.ebuild b/media-sound/emu10k1/emu10k1-0.20a-r2.ebuild deleted file mode 100644 index fe5aa65342f9..000000000000 --- a/media-sound/emu10k1/emu10k1-0.20a-r2.ebuild +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright 1999-2003 Gentoo Technologies, Inc. -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/emu10k1/emu10k1-0.20a-r2.ebuild,v 1.2 2003/02/13 13:10:27 vapier Exp $ - -MY_P="${P/-/-v}" -DESCRIPTION="Drivers, utilities, and effects for Sound Blaster cards (SBLive!, SB512, Audigy)" -SRC_URI="mirror://sourceforge/emu10k1/${MY_P}.tar.bz2" -HOMEPAGE="http://www.sourceforge.net/projects/emu10k1/" - -DEPEND="virtual/linux-sources" -RDEPEND="media-sound/aumix" - -KEYWORDS="x86 -ppc -sparc -alpha" -SLOT="${KV}" -LICENSE="GPL-2" - -S="${WORKDIR}/${MY_P}" - -pkg_setup() { - [ -z "$KV" ] && die "Couldn't detect kernel version. Does /usr/src/linux exist?" - return 0 -} - -src_compile() { - echo "SEQUENCER_SUPPORT := y" > config - echo "MODVERSIONS := y" >> config - echo "DBGEMU := n" >> config - - export KERNEL_SOURCE=/usr/src/linux - make || die "make failed" - make all || die "make all failed" - make tools || die "make tools failed" -} - -src_install() { - insinto /etc/modules.d - newins ${FILESDIR}/modules-emu10k1 emu10k1 - - # first install the main parts - make DESTDIR=${D} install || die "could not install" - rm -f docs/*patch - dodoc docs/* - - # now fix up the script so it'll install into /usr and not /usr/local - for f in ${S}/utils/{Makefile.config,scripts/{audigy,emu}-script} ; do - cp ${f} ${f}.old - sed -e 's:/usr/local:/usr:g' ${f}.old > ${f} - done - make man_prefix=${D}/usr/share/man DESTDIR=${D} install-tools || die "could not install tools" - - # clean up the /usr/etc directory - cd ${D}/usr/etc - mv `find -type f -perm +1` ../bin/ - mv * ${D}/etc/ - cd ${D} - rm -rf ${D}/usr/etc - - # clean up the scripts - dosed 's:$BASE_PATH/etc:/etc:g' /usr/bin/emu-script - dosed 's:$BASE_PATH/etc:/etc:g' /usr/bin/audigy-script - dosed 's:.aumixrc:aumixrc:g' /usr/bin/audigy-script - dosed 's:/bin/aumix-minimal:/usr/bin/aumix:g' /usr/bin/audigy-script - dosed 's:/etc/.aumixrc:/etc/aumixrc:g' /usr/bin/audigy-script - - # change default settings - dosed 's:AC3PASSTHROUGH=no:AC3PASSTHROUGH=yes:' /etc/emu10k1.conf - dosed 's:ANALOG_FRONT_BOOST=no:ANALOG_FRONT_BOOST=yes:' /etc/emu10k1.conf - dosed 's:SURROUND=no:SURROUND=yes:' /etc/emu10k1.conf -} - -pkg_postinst() { - /sbin/depmod -a - einfo "In order for the module to work correctly you must" - einfo "Enable the following options in your kernel:" - echo - einfo "Sound/Sound card support (module or builtin)" - einfo "Sound/OSS sound modules (module or builtin)" - echo - einfo "In addition, ensure that the following modules are" - einfo "*not* built in to your kernel, or are at least" - einfo "built as modules are not currently loaded." - echo - einfo "Sound/Creative SBLive! (EMU10K1) (disabled or module)" - einfo "Sound/Creative SBLive! MIDI (disabled or module)" - echo - einfo "If you have not yet done this, rebuild and install" - einfo "your kernel modules and re-emerge this package." -} diff --git a/media-sound/emu10k1/emu10k1-0.20a-r3.ebuild b/media-sound/emu10k1/emu10k1-0.20a-r4.ebuild index 0494235c26ce..20aac74311e7 100644 --- a/media-sound/emu10k1/emu10k1-0.20a-r3.ebuild +++ b/media-sound/emu10k1/emu10k1-0.20a-r4.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/emu10k1/emu10k1-0.20a-r3.ebuild,v 1.2 2003/02/13 13:10:32 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-sound/emu10k1/emu10k1-0.20a-r4.ebuild,v 1.1 2003/03/07 15:35:10 vapier Exp $ MY_P="${P/-/-v}" DESCRIPTION="Drivers, utilities, and effects for Sound Blaster cards (SBLive!, SB512, Audigy)" @@ -96,8 +96,4 @@ pkg_postinst() { echo einfo "If you have not yet done this, rebuild and install" einfo "your kernel modules and re-emerge this package." - echo - ewarn "You must edit /etc/emu10k1.conf and set the" - ewarn "CARD_TYPE that reflects the soundblaster card" - ewarn "you have in your computer." } diff --git a/media-sound/emu10k1/files/digest-emu10k1-0.20a-r2 b/media-sound/emu10k1/files/digest-emu10k1-0.20a-r2 deleted file mode 100644 index c5afcbd75a1f..000000000000 --- a/media-sound/emu10k1/files/digest-emu10k1-0.20a-r2 +++ /dev/null @@ -1 +0,0 @@ -MD5 ffeab46e1b5ff9fd834dc78e240edf4b emu10k1-v0.20a.tar.bz2 286000 diff --git a/media-sound/emu10k1/files/digest-emu10k1-0.20a-r3 b/media-sound/emu10k1/files/digest-emu10k1-0.20a-r3 deleted file mode 100644 index c5afcbd75a1f..000000000000 --- a/media-sound/emu10k1/files/digest-emu10k1-0.20a-r3 +++ /dev/null @@ -1 +0,0 @@ -MD5 ffeab46e1b5ff9fd834dc78e240edf4b emu10k1-v0.20a.tar.bz2 286000 diff --git a/media-sound/emu10k1/files/digest-emu10k1-0.20a-r1 b/media-sound/emu10k1/files/digest-emu10k1-0.20a-r4 index c5afcbd75a1f..c5afcbd75a1f 100644 --- a/media-sound/emu10k1/files/digest-emu10k1-0.20a-r1 +++ b/media-sound/emu10k1/files/digest-emu10k1-0.20a-r4 diff --git a/media-sound/emu10k1/files/emu10k1-script b/media-sound/emu10k1/files/emu10k1-script index 379159074c36..1ee3aae66c5a 100644 --- a/media-sound/emu10k1/files/emu10k1-script +++ b/media-sound/emu10k1/files/emu10k1-script @@ -1,16 +1,42 @@ #!/bin/bash -. /sbin/functions.sh -. /etc/emu10k1.conf -case "${CARD_TYPE}" in - audigy) +source /sbin/functions.sh +source /etc/emu10k1.conf + +# setup regex strings to match +AUDIGY_PCI_TAG="multimedia audio controller: creative labs.*audigy" +EMU10K1_PCI_TAG="multimedia audio controller: creative labs.*emu10k1" + +# first try to detect via lspci (sys-apps/pciutils) +if [ -z "${CARD_TYPE}" ] && [ -x /sbin/lspci ] ; then + if [ -n "$(lspci | egrep -i '${AUDIGY_PCI_TAG}')" ] ; then + CARD_TYPE="audigy" + elif [ -n "$(lspci | egrep -i '${EMU10K1_PCI_TAG}')" ] ; then + CARD_TYPE="emu" + fi +fi + +# if that didnt work, lets try via the kernel's /proc/pci interface +if [ -z "${CARD_TYPE}" ] && [ -e /proc/pci ] ; then + if [ -n "$(egrep -i '${AUDIGY_PCI_TAG}' /proc/pci)" ] ; then + CARD_TYPE="audigy" + elif [ -n "$(egrep -i '${EMU10K1_PCI_TAG}' /proc/pci)" ] ; then + CARD_TYPE="emu" + fi +fi + +# if that failed, make the user tell us what it is +case "`echo ${CARD_TYPE} | awk '{print toupper($1)}'`" in + AUDIGY) audigy-script $@ ;; - emu) + EMU) emu-script $@ ;; *) - eerror "You have not told me what kind of sound card you have." + eerror "I was unable to figure out whether you have an Audigy" + eerror "or an Emu10k1 sound card. Further more, you have not" + eerror "told me what kind of sound card you have." eerror "Please edit /etc/emu10k1.conf and set the CARD_TYPE" eerror "variable. You will find it at the top of the file." exit 1 diff --git a/media-sound/emu10k1/files/emu10k1.conf-gentoo-header b/media-sound/emu10k1/files/emu10k1.conf-gentoo-header index 9c96e7eee292..20710ecdf74e 100644 --- a/media-sound/emu10k1/files/emu10k1.conf-gentoo-header +++ b/media-sound/emu10k1/files/emu10k1.conf-gentoo-header @@ -4,5 +4,12 @@ # Accepted values are 'emu' and 'audigy' # use 'audigy' if you have an audigy based sound card, # otherwise use 'emu' -CARD_TYPE="set_me" +# +# Note: you should only have to set this if: +# (1) the auto-detect script fails +# - no lspci support +# - no /proc/pci support +# - the kernel just plain doesn't like you +# (2) you like to set everything +#CARD_TYPE="set_me" |