initial import
This commit is contained in:
84
alsa-utils/PKGBUILD
Normal file
84
alsa-utils/PKGBUILD
Normal file
@@ -0,0 +1,84 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgname=alsa-utils
|
||||
pkgver=1.2.4
|
||||
_debver=$pkgver
|
||||
_debrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="Utilities for configuring and using ALSA"
|
||||
arch=('i686' 'x86_64')
|
||||
url="https://www.alsa-project.org"
|
||||
license=('GPL-2')
|
||||
depends=('glibc' 'pciutils' 'psmisc')
|
||||
makedepends=('alsa-lib' 'docbook-xsl' 'fftw' 'libsamplerate' 'ncurses' 'xmlto' 'quilt')
|
||||
optdepends=('fftw: for alsabat')
|
||||
backup=('etc/conf.d/alsasound')
|
||||
source=(https://www.alsa-project.org/files/pub/utils/$pkgname-$pkgver.tar.bz2
|
||||
https://deb.debian.org/debian/pool/main/a/alsa-utils/alsa-utils_$_debver-$_debrel.debian.tar.xz
|
||||
alsasound.confd
|
||||
alsasound.initd
|
||||
alsasound.finish
|
||||
alsasound.run)
|
||||
sha512sums=('13080abda55269513b3751044dac292d695e273073a62d74ed4a32c68f448a2b015fe16604650821a6398b6ef6a7b6008cb9f0b7fb7f4ee1fa2b4eb2dcf29770'
|
||||
'ebe550a904069495e0673b5f1bf0506b9d8a7b270def187f42b92d5f4f3e065022e35af38a7c47422dca9c56b319966878771904e7c9ad15fc55443c280e1133'
|
||||
'90c1e974276945f7632dc370a005b58d669b93edbf27116098d4831e69c11c26d9b21e7eacfaf12c50019f8c88dc1f370101e2d905fdde40887fe36bac00d83e'
|
||||
'960e6eff97174004abeb8d36d68c01a9f67e589174743928bb63dc37390f9868551e5b7e11c8386db67889c3d518f5ff4564b258dfee5e3317c164bc52aac04e'
|
||||
'55fa39e5d138e103c23e7c55a3ad68a4c910f622aa58bedbb757c183d090000c719871bc126f8c8025dcebdcb97c4fc5edaa03a9719ecbc8970397f0f6743c8f'
|
||||
'30a1eb39628efc561375bd0fc6f9e3e24d6d1d8d723ef50acf85f51e619e609081fffa7535adf77d8976ca5926a7156d4c87ec0345569cb8393878334190b66d')
|
||||
|
||||
prepare() {
|
||||
cd ${srcdir}/${pkgname}-${pkgver}
|
||||
|
||||
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
|
||||
# Debian patches
|
||||
export QUILT_PATCHES=debian/patches
|
||||
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
||||
export QUILT_DIFF_ARGS='--no-timestamps'
|
||||
|
||||
mv "$srcdir"/debian .
|
||||
|
||||
# Doesn't apply and seems unimportant
|
||||
rm -v debian/patches/Don-t-run-both-systemd-services-in-paralell.patch || true
|
||||
rm -v debian/patches/systemd_Documentation_key.patch || true
|
||||
|
||||
quilt push -av
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
cd ${srcdir}/${pkgname}-${pkgver}
|
||||
./configure --prefix=/usr --disable-alsaconf \
|
||||
--with-udev-rules-dir=/lib/udev/rules.d
|
||||
make
|
||||
# fix udev rules generation
|
||||
cd alsactl
|
||||
make 90-alsa-restore.rules
|
||||
}
|
||||
|
||||
package() {
|
||||
cd ${srcdir}/${pkgname}-${pkgver}
|
||||
make DESTDIR=${pkgdir} install
|
||||
|
||||
# install license
|
||||
install -D -m644 COPYING \
|
||||
${pkgdir}/usr/share/licenses/${pkgname}/COPYING
|
||||
|
||||
# install alsa udev rule file
|
||||
install -D -m644 alsactl/90-alsa-restore.rules \
|
||||
${pkgdir}/lib/udev/rules.d/90-alsa-restore.rules
|
||||
|
||||
# dir where to save ALSA state
|
||||
install -d ${pkgdir}/var/lib/alsa
|
||||
|
||||
# install OpenRC files
|
||||
install -D -m644 ${srcdir}/alsasound.confd \
|
||||
${pkgdir}/etc/conf.d/alsasound
|
||||
install -D -m755 ${srcdir}/alsasound.initd \
|
||||
${pkgdir}/etc/init.d/alsasound
|
||||
|
||||
# install runit files
|
||||
install -D -m644 ${srcdir}/alsasound.finish \
|
||||
${pkgdir}/etc/sv/alsasound/finish
|
||||
install -D -m755 ${srcdir}/alsasound.run \
|
||||
${pkgdir}/etc/sv/alsasound/run
|
||||
}
|
||||
15
alsa-utils/alsasound.confd
Normal file
15
alsa-utils/alsasound.confd
Normal file
@@ -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"
|
||||
3
alsa-utils/alsasound.finish
Normal file
3
alsa-utils/alsasound.finish
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
exec alsactl store
|
||||
87
alsa-utils/alsasound.initd
Normal file
87
alsa-utils/alsasound.initd
Normal file
@@ -0,0 +1,87 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2016 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
alsastatedir=/var/lib/alsa
|
||||
alsascrdir=/etc/alsa.d
|
||||
alsahomedir=/var/run/alsasound
|
||||
|
||||
extra_commands="save restore"
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
after bootmisc modules isapnp coldplug hotplug
|
||||
}
|
||||
|
||||
restore() {
|
||||
ebegin "Restoring Mixer Levels"
|
||||
|
||||
checkpath -q -d -m 0700 -o root:root ${alsahomedir} || return 1
|
||||
|
||||
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 -E HOME="${alsahomedir}" -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"
|
||||
|
||||
checkpath -q -d -m 0700 -o root:root ${alsahomedir} || return 1
|
||||
|
||||
mkdir -p "${alsastatedir}"
|
||||
if ! alsactl -E HOME="${alsahomedir}" -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
|
||||
}
|
||||
3
alsa-utils/alsasound.run
Normal file
3
alsa-utils/alsasound.run
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
exec alsactl -n 19 -c daemon
|
||||
Reference in New Issue
Block a user