diff --git a/alsa-utils-1.0.17-alsaconf.patch b/alsa-utils-1.0.18-alsaconf.patch similarity index 62% rename from alsa-utils-1.0.17-alsaconf.patch rename to alsa-utils-1.0.18-alsaconf.patch index 1468819..5031831 100644 --- a/alsa-utils-1.0.17-alsaconf.patch +++ b/alsa-utils-1.0.18-alsaconf.patch @@ -1,18 +1,16 @@ -diff -ruNp alsa-utils-1.0.17.orig/Makefile.am alsa-utils-1.0.17/Makefile.am ---- alsa-utils-1.0.17.orig/Makefile.am 2008-07-14 11:16:02.000000000 +0200 -+++ alsa-utils-1.0.17/Makefile.am 2008-07-21 14:10:06.000000000 +0200 +--- alsa-utils-1.0.18rc3/Makefile.am.orig 2008-09-09 19:50:28.000000000 +0200 ++++ alsa-utils-1.0.18rc3/Makefile.am 2008-09-11 11:18:01.000000000 +0200 @@ -4,7 +4,7 @@ ALSAMIXER_DIR=alsamixer else ALSAMIXER_DIR= endif -SUBDIRS= include alsactl alsaconf $(ALSAMIXER_DIR) amidi amixer aplay iecset seq speaker-test utils m4 po +SUBDIRS= include alsactl $(ALSAMIXER_DIR) amidi amixer aplay iecset seq speaker-test utils m4 po - EXTRA_DIST= config.rpath config.rpath mkinstalldirs ChangeLog INSTALL TODO README configure gitcompile depcomp + EXTRA_DIST= config.rpath TODO gitcompile AUTOMAKE_OPTIONS=foreign ACLOCAL_AMFLAGS = -I m4 -diff -ruNp alsa-utils-1.0.17.orig/Makefile.in alsa-utils-1.0.17/Makefile.in ---- alsa-utils-1.0.17.orig/Makefile.in 2008-07-14 11:16:06.000000000 +0200 -+++ alsa-utils-1.0.17/Makefile.in 2008-07-21 14:10:35.000000000 +0200 +--- alsa-utils-1.0.18rc3/Makefile.in.orig 2008-09-11 11:17:52.000000000 +0200 ++++ alsa-utils-1.0.18rc3/Makefile.in 2008-09-11 11:17:52.000000000 +0200 @@ -65,7 +65,7 @@ RECURSIVE_TARGETS = all-recursive check- uninstall-recursive ETAGS = etags @@ -28,6 +26,6 @@ diff -ruNp alsa-utils-1.0.17.orig/Makefile.in alsa-utils-1.0.17/Makefile.in @ALSAMIXER_TRUE@ALSAMIXER_DIR = alsamixer -SUBDIRS = include alsactl alsaconf $(ALSAMIXER_DIR) amidi amixer aplay iecset seq speaker-test utils m4 po +SUBDIRS = include alsactl $(ALSAMIXER_DIR) amidi amixer aplay iecset seq speaker-test utils m4 po - EXTRA_DIST = config.rpath config.rpath mkinstalldirs ChangeLog INSTALL TODO README configure gitcompile depcomp + EXTRA_DIST = config.rpath TODO gitcompile AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 diff --git a/alsa-utils.spec b/alsa-utils.spec index d6ef956..a6c4b5d 100644 --- a/alsa-utils.spec +++ b/alsa-utils.spec @@ -13,11 +13,13 @@ Source4: alsaunmute Source6: alsa-info.sh Source10: alsa.rules Source11: alsactl.conf -Patch0: alsa-utils-1.0.17-alsaconf.patch +Patch0: alsa-utils-1.0.18-alsaconf.patch +Patch1: alsactl-fix-card-parsing.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: alsa-lib-devel >= %{version} BuildRequires: ncurses-devel BuildRequires: gettext-devel +BuildRequires: xmlto Conflicts: udev < 062 %description @@ -27,11 +29,12 @@ Architecture (ALSA). %prep %setup -q -n %{name}-%{version}%{?prever} %patch0 -p1 +%patch1 -p1 %build %configure CFLAGS="$RPM_OPT_FLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" --sbindir=/sbin %{__make} %{?_smp_mflags} -%{__cp} %{SOURCE5} . +%{__cp} %{SOURCE4} . %install %{__rm} -rf $RPM_BUILD_ROOT @@ -50,13 +53,20 @@ install -p -m 755 alsaunmute %{buildroot}/bin/ mkdir -p $RPM_BUILD_ROOT/%{_sbindir} ln -s ../../sbin/alsactl $RPM_BUILD_ROOT/%{_sbindir}/alsactl +# Move /usr/share/alsa/init to /lib/alsa/init +mkdir -p -m 755 %{buildroot}/%{_lib}/alsa +mv %{buildroot}%{_datadir}/alsa/init %{buildroot}/%{_lib}/alsa + +# Link /lib/alsa/init to /usr/share/alsa/init back +ln -s ../../../lib/alsa/init %{buildroot}%{_datadir}/alsa/init + # Create a place for global configuration -mkdir -p -m 755 $RPM_BUILD_ROOT/etc/alsa -install -p -m 644 alsactl.conf %{buildroot}/etc/alsa -touch $RPM_BUILD_ROOT/etc/asound.state +mkdir -p -m 755 %{buildroot}/etc/alsa +install -p -m 644 %{SOURCE11} %{buildroot}/etc/alsa +touch %{buildroot}/etc/asound.state # Install alsa-info.sh script -install -p -m 755 %{SOURCE6} $RPM_BUILD_ROOT/usr/bin/alsa-info +install -p -m 755 %{SOURCE6} %{buildroot}/usr/bin/alsa-info %clean %{__rm} -rf $RPM_BUILD_ROOT @@ -68,6 +78,7 @@ install -p -m 755 %{SOURCE6} $RPM_BUILD_ROOT/usr/bin/alsa-info %config /etc/alsa/* /bin/* /sbin/* +/%{_lib}/alsa/init/* %{_bindir}/* %{_sbindir}/* %{_datadir}/alsa/ diff --git a/alsa.rules b/alsa.rules index 4a7c202..748db95 100644 --- a/alsa.rules +++ b/alsa.rules @@ -1,4 +1,4 @@ ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", \ - ENV{ALSA_CONFIG_PATH}="/etc/alsa/alsactl.conf", RUN+="/sbin/alsactl restore $name" + RUN+="/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/lib/alsa/init/00main restore $name" ACTION=="remove", SUBSYSTEM=="sound", KERNEL=="controlC*", \ - ENV{ALSA_CONFIG_PATH}="/etc/alsa/alsactl.conf", RUN+="/sbin/alsactl store $name" + RUN+="/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf store $name" diff --git a/alsactl-fix-card-parsing.patch b/alsactl-fix-card-parsing.patch new file mode 100644 index 0000000..858de14 --- /dev/null +++ b/alsactl-fix-card-parsing.patch @@ -0,0 +1,26 @@ +From 0a8e8d581e5df6f1b13ea009fcdd77c6afcbdc43 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Thu, 11 Sep 2008 13:39:42 +0200 +Subject: [PATCH] alsactl: Fix oops (when parsing card argument) + +Signed-off-by: Jaroslav Kysela +--- + alsactl/alsactl.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/alsactl/alsactl.c b/alsactl/alsactl.c +index 6728fbc..57957bf 100644 +--- a/alsactl/alsactl.c ++++ b/alsactl/alsactl.c +@@ -150,7 +150,7 @@ int main(int argc, char *argv[]) + } + + cardname = argc - optind > 1 ? argv[optind + 1] : NULL; +- for (tmp = devfiles; cardname != NULL && tmp != NULL; tmp++) { ++ for (tmp = devfiles; cardname != NULL && *tmp != NULL; tmp++) { + int len = strlen(*tmp); + if (!strncmp(cardname, *tmp, len)) { + long l = strtol(cardname + len, NULL, 0); +-- +1.6.0.GIT + diff --git a/alsaunmute b/alsaunmute index 401e21d..3f772ea 100755 --- a/alsaunmute +++ b/alsaunmute @@ -1,5 +1,6 @@ #!/bin/sh -export ALSA_CONFIG_PATH="/etc/alsa/alsactl.conf" -exec /sbin/alsactl init - +exec /sbin/alsactl \ + -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf \ + --initfile=/lib/alsa/init/00main \ + init