]> git.pld-linux.org Git - packages/alsa-utils.git/commitdiff
- make sound cards work by default auto/th/alsa-utils-1_0_20-4
authorPatryk Zawadzki <patrys@room-303.com>
Thu, 11 Jun 2009 14:55:14 +0000 (14:55 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- move necessary utils from /prefix to /
- rel 4

Changed files:
    alsa-udev.rules -> 1.1
    alsa-utils.spec -> 1.160
    alsactl.conf -> 1.1
    alsasound.init -> 1.21

alsa-udev.rules [new file with mode: 0644]
alsa-utils.spec
alsactl.conf [new file with mode: 0644]
alsasound.init

diff --git a/alsa-udev.rules b/alsa-udev.rules
new file mode 100644 (file)
index 0000000..87a5279
--- /dev/null
@@ -0,0 +1,4 @@
+ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", \
+  RUN+="/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/lib/alsa/init/00main restore /dev/$name"
+ACTION=="remove", SUBSYSTEM=="sound", KERNEL=="controlC*", \
+  RUN+="/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf store /dev/$name"
index 9aabddfa0316a31066cdf7304c838b8fd1152226..3c25bec78f4a6c090f936e45c9ed15ebb632bd1f 100644 (file)
@@ -6,7 +6,7 @@ Summary(ru.UTF-8):      Утилиты командной строки для ALSA pr
 Summary(uk.UTF-8):     Утиліти командного рядка для ALSA project
 Name:          alsa-utils
 Version:       1.0.20
-Release:       3
+Release:       4
 # some apps GPL v2, some GPL v2+
 License:       GPL v2
 Group:         Applications/Sound
@@ -14,6 +14,8 @@ Source0:      ftp://ftp.alsa-project.org/pub/utils/%{name}-%{version}.tar.bz2
 # Source0-md5: 6837e673ef19da96d8bd2f9e18cd9574
 Source1:       alsasound.init
 Source2:       alsa-oss-pcm
+Source3:       alsa-udev.rules
+Source4:       alsactl.conf
 URL:           http://www.alsa-project.org/
 Patch0:                %{name}-fast_sampling.patch
 Patch1:                %{name}-modprobe.patch
@@ -32,6 +34,7 @@ Requires:     diffutils
 Requires:      which
 Suggests:      gpm
 Obsoletes:     alsaconf
+Obsoletes:     alsa-udev
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -104,7 +107,9 @@ Skrypt init dla Advanced Linux Sound Architecture.
 %{__automake}
 CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
 CXXFLAGS="%{rpmcxxflags} -fno-rtti -fno-exceptions"
-%configure
+# we need alsactl for udev as early as possible
+%configure \
+       --sbindir=/sbin
 %{__make}
 
 %install
@@ -115,6 +120,15 @@ rm -rf $RPM_BUILD_ROOT
 
 install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/alsasound
 install -D %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/alsa-oss-pcm
+install -D %{SOURCE3} $RPM_BUILD_ROOT/etc/udev/rules.d/90-alsa.rules
+install -D %{SOURCE4} $RPM_BUILD_ROOT/etc/alsa/alsactl.conf
+
+install -d $RPM_BUILD_ROOT/lib/alsa
+mv $RPM_BUILD_ROOT%{_datadir}/alsa/init $RPM_BUILD_ROOT/lib/alsa
+
+ln -s /lib/alsa/init $RPM_BUILD_ROOT%{_datadir}/alsa/init
+install -d $RPM_BUILD_ROOT%{_sbindir}
+ln -s /sbin/alsactl $RPM_BUILD_ROOT%{_sbindir}/alsactl
 
 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/arecord.1
 echo ".so aplay.1" > $RPM_BUILD_ROOT%{_mandir}/man1/arecord.1
@@ -137,8 +151,13 @@ fi
 %files -f alsa-utils.lang
 %defattr(644,root,root,755)
 %doc README ChangeLog
+%attr(755,root,root) /sbin/*
 %attr(755,root,root) %{_bindir}/*
 %attr(755,root,root) %{_sbindir}/*
+%{_sysconfdir}/alsa/alsactl.conf
+%{_sysconfdir}/udev/rules.d/90-alsa.rules
+%dir /lib/alsa
+/lib/alsa/init
 %{_datadir}/alsa/init
 %{_datadir}/alsa/speaker-test
 %{_datadir}/sounds/alsa
diff --git a/alsactl.conf b/alsactl.conf
new file mode 100644 (file)
index 0000000..71f0d80
--- /dev/null
@@ -0,0 +1,14 @@
+#
+# ALSA library configuration file for alsactl tool
+# (/usr/share/alsa tree is not necessary for alsactl)
+#
+
+ctl.hw {
+       @args [ CARD ]
+       @args.CARD {
+               type string
+               default "0"
+       }
+       type hw
+       card $CARD
+}
index 0710174bd1d9c9bd46902cd08b94e881c149335e..a37e66713b73fd0ede86b64146ff1f6a6968e10f 100644 (file)
@@ -3,8 +3,6 @@
 # alsasound    This shell script takes care of starting and stopping \
 #              ALSA sound driver.
 #
-# This script requires /usr/sbin/alsactl program from alsa-utils package.
-#
 # Copyright (c) by Jaroslav Kysela <perex@jcu.cz>
 #
 #  This program is free software; you can redistribute it and/or modify
@@ -49,22 +47,6 @@ driver_start()
       /sbin/modprobe $line
       ok
     done
-
-  # restore driver settings
-  #
-  if [ -x /usr/sbin/alsactl ]; then
-    if [ -f /etc/asound.state ]; then
-      if [ "$(kernelver)" -lt "002006012" ]; then
-       for i in 1 2 3 4; do
-         [ -a /dev/snd/controlC0 ] && break
-         sleep 1
-       done
-      fi
-      /usr/sbin/alsactl restore
-    fi
-  else
-    show "ERROR: alsactl not found"; fail
-  fi
 }
 
 detect_stop()
@@ -79,14 +61,6 @@ detect_stop()
 
 driver_stop()
 {
-  #
-  # store driver settings
-  #
-  if [ -x /usr/sbin/alsactl ]; then
-    /usr/sbin/alsactl store
-  else
-    show '!!!alsactl not found!!!'; fail
-  fi
   #
   # remove all sound modules
   #
This page took 0.113478 seconds and 4 git commands to generate.