summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Vroon <chainsaw@gentoo.org>2012-02-20 09:03:53 +0000
committerTony Vroon <chainsaw@gentoo.org>2012-02-20 09:03:53 +0000
commitad640ce96e512f4da97bea87e74fb148a1a8a19f (patch)
treeeab682362b0e0c9ca4fc639adf96e28466ae9163 /media-sound/alsa-utils
parentVersion bump. (diff)
downloadgentoo-2-ad640ce96e512f4da97bea87e74fb148a1a8a19f.tar.gz
gentoo-2-ad640ce96e512f4da97bea87e74fb148a1a8a19f.tar.bz2
gentoo-2-ad640ce96e512f4da97bea87e74fb148a1a8a19f.zip
Use -I option on alsactl restore to avoid aborting unnecessarily, as per Adam Nielsen in bug #281631. libsamplerate is both a build & run time dependency, as per Albert W. Hopkins in bug #403557. Remove unsupported autoload/unload as it breaks with kmod, as per Ulenrich in bug #404535.
(Portage version: 2.1.10.46/cvs/Linux x86_64)
Diffstat (limited to 'media-sound/alsa-utils')
-rw-r--r--media-sound/alsa-utils/ChangeLog17
-rw-r--r--media-sound/alsa-utils/alsa-utils-1.0.25-r1.ebuild79
-rw-r--r--media-sound/alsa-utils/files/alsasound.confd-r415
-rw-r--r--media-sound/alsa-utils/files/alsasound.initd-r583
4 files changed, 185 insertions, 9 deletions
diff --git a/media-sound/alsa-utils/ChangeLog b/media-sound/alsa-utils/ChangeLog
index a56720314c62..dc0c67e97b3d 100644
--- a/media-sound/alsa-utils/ChangeLog
+++ b/media-sound/alsa-utils/ChangeLog
@@ -1,16 +1,15 @@
# ChangeLog for media-sound/alsa-utils
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/ChangeLog,v 1.315 2012/02/03 12:31:38 chainsaw Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/ChangeLog,v 1.316 2012/02/20 09:03:53 chainsaw Exp $
-*alsa-utils-1.0.25 (03 Feb 2012)
+*alsa-utils-1.0.25-r1 (20 Feb 2012)
- 03 Feb 2012; Tony Vroon <chainsaw@gentoo.org> +alsa-utils-1.0.25.ebuild,
- +files/alsa-utils-1.0.25-separate-usr-var-fs.patch:
- Version bump. Add missed libsamplerate dependency, closes bug #383263 by
- Hans. Patch by Martin van Gagern silences warnings when using a separate /usr
- or /var partition, closes bug #384375. Upstream changes fix build breakage
- when SED is set in the environment, closes bug #366587 by Nils Kneuper.
- Automatic module loading & unloading is unsupported and may be removed soon.
+ 20 Feb 2012; Tony Vroon <chainsaw@gentoo.org> +alsa-utils-1.0.25-r1.ebuild,
+ +files/alsasound.confd-r4, +files/alsasound.initd-r5:
+ Use -I option on alsactl restore to avoid aborting unnecessarily, as per Adam
+ Nielsen in bug #281631. libsamplerate is both a build & run time dependency,
+ as per Albert W. Hopkins in bug #403557. Remove unsupported autoload/unload
+ as it breaks with kmod, as per Ulenrich in bug #404535.
18 Jan 2012; William Hubbs <williamh@gentoo.org> alsa-utils-1.0.23-r1.ebuild,
alsa-utils-1.0.24.2-r1.ebuild:
diff --git a/media-sound/alsa-utils/alsa-utils-1.0.25-r1.ebuild b/media-sound/alsa-utils/alsa-utils-1.0.25-r1.ebuild
new file mode 100644
index 000000000000..3d6c623df5f9
--- /dev/null
+++ b/media-sound/alsa-utils/alsa-utils-1.0.25-r1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/alsa-utils-1.0.25-r1.ebuild,v 1.1 2012/02/20 09:03:53 chainsaw Exp $
+
+EAPI=4
+inherit base systemd
+
+MY_P=${P/_rc/rc}
+
+DESCRIPTION="Advanced Linux Sound Architecture Utils (alsactl, alsamixer, etc.)"
+HOMEPAGE="http://www.alsa-project.org/"
+SRC_URI="mirror://alsaproject/utils/${MY_P}.tar.bz2
+ mirror://alsaproject/driver/alsa-driver-${PV}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0.9"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="doc nls minimal"
+
+COMMON_DEPEND=">=sys-libs/ncurses-5.1
+ dev-util/dialog
+ >=media-libs/alsa-lib-1.0.25
+ media-libs/libsamplerate"
+DEPEND="${COMMON_DEPEND}
+ doc? ( app-text/xmlto )"
+RDEPEND="${COMMON_DEPEND}
+ !minimal? ( sys-apps/pciutils )"
+
+S="${WORKDIR}/${MY_P}"
+PATCHES=(
+"${FILESDIR}/${PN}-1.0.23-modprobe.d.patch"
+"${FILESDIR}/${P}-separate-usr-var-fs.patch"
+)
+
+src_configure() {
+ local myconf=""
+ use doc || myconf="--disable-xmlto"
+
+ econf ${myconf} \
+ $(use_enable nls) \
+ "$(systemd_with_unitdir)"
+}
+
+src_install() {
+ local ALSA_UTILS_DOCS="ChangeLog README TODO
+ seq/aconnect/README.aconnect
+ seq/aseqnet/README.aseqnet"
+
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ dodoc ${ALSA_UTILS_DOCS} || die
+
+ newbin "${WORKDIR}/alsa-driver-${PV}/utils/alsa-info.sh" \
+ alsa-info
+
+ newinitd "${FILESDIR}/alsasound.initd-r5" alsasound
+ newconfd "${FILESDIR}/alsasound.confd-r4" alsasound
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}/alsa-modules.conf-rc" alsa.conf
+
+ keepdir /var/lib/alsa
+}
+
+pkg_postinst() {
+ echo
+ elog "To take advantage of the init script, and automate the process of"
+ elog "saving and restoring sound-card mixer levels you should"
+ elog "add alsasound to the boot runlevel. You can do this as"
+ elog "root like so:"
+ elog " # rc-update add alsasound boot"
+ echo
+ ewarn "The ALSA core should be built into the kernel or loaded through other"
+ ewarn "means. There is no longer any modular auto(un)loading in alsa-utils."
+ echo
+ if use minimal; then
+ ewarn "The minimal use flag disables the dependency on pciutils that"
+ ewarn "is needed by alsaconf at runtime."
+ fi
+}
diff --git a/media-sound/alsa-utils/files/alsasound.confd-r4 b/media-sound/alsa-utils/files/alsasound.confd-r4
new file mode 100644
index 000000000000..6fec8f5938da
--- /dev/null
+++ b/media-sound/alsa-utils/files/alsasound.confd-r4
@@ -0,0 +1,15 @@
+# RESTORE_ON_START:
+# Do you want to restore your mixer settings? If not, your cards will be
+# muted.
+# no - Do not restore state
+# yes - Restore state
+
+RESTORE_ON_START="yes"
+
+# SAVE_ON_STOP:
+# Do you want to save changes made to your mixer volumes when alsasound
+# stops?
+# no - Do not save state
+# yes - Save state
+
+SAVE_ON_STOP="yes"
diff --git a/media-sound/alsa-utils/files/alsasound.initd-r5 b/media-sound/alsa-utils/files/alsasound.initd-r5
new file mode 100644
index 000000000000..e3c8dd90099f
--- /dev/null
+++ b/media-sound/alsa-utils/files/alsasound.initd-r5
@@ -0,0 +1,83 @@
+#!/sbin/runscript
+# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsasound.initd-r5,v 1.1 2012/02/20 09:03:53 chainsaw Exp $
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+alsastatedir=/var/lib/alsa
+alsascrdir=/etc/alsa.d
+
+extra_commands="save restore"
+
+depend() {
+ need localmount
+ after bootmisc modules isapnp coldplug hotplug
+}
+
+restore() {
+ ebegin "Restoring Mixer Levels"
+
+ if [ ! -r "${alsastatedir}/asound.state" ] ; then
+ ewarn "No mixer config in ${alsastatedir}/asound.state, you have to unmute your card!"
+ eend 0
+ return 0
+ fi
+
+ local cards="$(sed -n -e 's/ *\([[:digit:]]*\) .*/\1/p' /proc/asound/cards)"
+ local CARDNUM
+ for cardnum in ${cards}; do
+ [ -e /dev/snd/controlC${cardnum} ] || sleep 2
+ [ -e /dev/snd/controlC${cardnum} ] || sleep 2
+ [ -e /dev/snd/controlC${cardnum} ] || sleep 2
+ [ -e /dev/snd/controlC${cardnum} ] || sleep 2
+ alsactl -I -f "${alsastatedir}/asound.state" restore ${cardnum} \
+ || ewarn "Errors while restoring defaults, ignoring"
+ done
+
+ for ossfile in "${alsastatedir}"/oss/card*_pcm* ; do
+ [ -e "${ossfile}" ] || continue
+ # We use cat because I'm not sure if cp works properly on /proc
+ local procfile=${ossfile##${alsastatedir}/oss}
+ procfile="$(echo "${procfile}" | sed -e 's,_,/,g')"
+ if [ -e /proc/asound/"${procfile}"/oss ] ; then
+ cat "${ossfile}" > /proc/asound/"${procfile}"/oss
+ fi
+ done
+
+ eend 0
+}
+
+save() {
+ ebegin "Storing ALSA Mixer Levels"
+
+ mkdir -p "${alsastatedir}"
+ if ! alsactl -f "${alsastatedir}/asound.state" store; then
+ eerror "Error saving levels."
+ eend 1
+ return 1
+ fi
+
+ for ossfile in /proc/asound/card*/pcm*/oss; do
+ [ -e "${ossfile}" ] || continue
+ local device=${ossfile##/proc/asound/} ; device=${device%%/oss}
+ device="$(echo "${device}" | sed -e 's,/,_,g')"
+ mkdir -p "${alsastatedir}/oss/"
+ cp "${ossfile}" "${alsastatedir}/oss/${device}"
+ done
+
+ eend 0
+}
+
+start() {
+ if [ "${RESTORE_ON_START}" = "yes" ]; then
+ restore
+ fi
+
+ return 0
+}
+
+stop() {
+ if [ "${SAVE_ON_STOP}" = "yes" ]; then
+ save
+ fi
+ return 0
+}