Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=systemd.git;a=commitdiff;h=a6befeea0f0e85d3f5d46c4d09199fb9ea1f8c6c
commit a6befeea0f0e85d3f5d46c4d09199fb9ea1f8c6c Author: bouleetbil <bouleet...@frogdev.info> Date: Sat Dec 4 11:49:05 2010 +0000 alsa-utils-1.0.23-2-i686 *added systemd support diff --git a/source/multimedia/alsa-utils/FrugalBuild b/source/multimedia/alsa-utils/FrugalBuild index 338adc0..744e893 100644 --- a/source/multimedia/alsa-utils/FrugalBuild +++ b/source/multimedia/alsa-utils/FrugalBuild @@ -13,11 +13,17 @@ groups=('multimedia') archs=('i686' 'x86_64' 'ppc') _F_archive_grepv='rc' up2date="Flasttar $url" -source=(ftp://ftp.alsa-project.org/pub/utils/$pkgname-$pkgver.tar.bz2 rc.alsa \ - rc.alsa-{de,hu}.po) +source=(ftp://ftp.alsa-project.org/pub/utils/$pkgname-$pkgver.tar.bz2 systemd-support.diff) sha1sums=('52dc9260e21960231c084109f16979e70e36ab03' \ - '1b155e27e97650b5b84b744125fcb5a1bb25705a' \ - '817a8676b205865af86b6cbc4859561f9f8c2e53' \ - 'abe9418c9f379419b5ffce7ef5a5955e797b1813') -_F_rcd_name=alsa + 'e5a2ed68aadc6757abebb10f803201504eb059c0') +Fconfopts="$fconfopts --with-systemdsystemunitdir=/lib/systemd/system" + +build() { + Fcd + Fpatchall + Fautoreconf + Fmake + Fmakeinstall +} + # optimization OK diff --git a/source/multimedia/alsa-utils/alsa-utils.install b/source/multimedia/alsa-utils/alsa-utils.install deleted file mode 100644 index 831bb87..0000000 --- a/source/multimedia/alsa-utils/alsa-utils.install +++ /dev/null @@ -1,25 +0,0 @@ -post_install() -{ - /usr/sbin/chkconfig --add rc.alsa -} - -post_upgrade() -{ - post_install -} - -pre_remove() -{ - /usr/sbin/chkconfig --del rc.alsa -} - -pre_upgrade() -{ - pre_remove -} - -op=$1 -shift -$op $* - -# vim: ft=sh diff --git a/source/multimedia/alsa-utils/rc.alsa b/source/multimedia/alsa-utils/rc.alsa deleted file mode 100644 index 17e21c1..0000000 --- a/source/multimedia/alsa-utils/rc.alsa +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -# (c) 2003, 2004, 2007 Miklos Vajna <vmik...@frugalware.org> -# (c) 2005 Marcus Habermehl <bmh198...@yahoo.de> -# rc.alsa for Frugalware -# distributed under GPL License - -# chkconfig: 2345 99 01 -# description: Loads and saves ALSA mixer settings - -source /lib/initscripts/functions -TEXTDOMAIN=alsa -TEXTDOMAINDIR=/lib/initscripts/messages - -actions=(load save start stop status) - -rc_load() -{ - msg $"Loading ALSA mixer settings" - if [ -d /proc/asound -a -r /etc/asound.state ] ; then - alsactl restore - ok $? - else - amixer set Master 35 unmute - amixer set PCM 35 unmute - fi -} - -rc_save() -{ - msg $"Saving ALSA mixer settings" - [ ! -r /etc/asound.state ] && touch /etc/asound.state - if [ -d /proc/asound ] ; then - alsactl store - ok $? - else - ok 999 - fi -} - -rc_start() -{ - rc_load -} - -rc_stop() -{ - rc_save -} - -rc_exec $1 - -# vim: ft=sh diff --git a/source/multimedia/alsa-utils/rc.alsa-de.po b/source/multimedia/alsa-utils/rc.alsa-de.po deleted file mode 100644 index b907ad2..0000000 --- a/source/multimedia/alsa-utils/rc.alsa-de.po +++ /dev/null @@ -1,26 +0,0 @@ -# German translations for rc.alsa package -# German messages for rc.alsa. -# Copyright (C) 2005 THE rc.alsa'S COPYRIGHT HOLDER -# This file is distributed under the same license as the rc.alsa package. -# VMiklos <vmik...@frugalware.org>, 2005. -# -msgid "" -msgstr "" -"Project-Id-Version: rc.alsa 1.0.10\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-11-20 14:27+0100\n" -"PO-Revision-Date: 2005-11-20 14:29+0100\n" -"Last-Translator: VMiklos <vmik...@frugalware.org>\n" -"Language-Team: German <translation-team...@lists.sourceforge.net>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-1\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: rc.alsa:18 -msgid "Loading ALSA mixer settings" -msgstr "Lade Einstellungen des ALSA-Mixers" - -#: rc.alsa:29 -msgid "Saving ALSA mixer settings" -msgstr "Speichere Einstellungen des ALSA-Mixers" diff --git a/source/multimedia/alsa-utils/rc.alsa-hu.po b/source/multimedia/alsa-utils/rc.alsa-hu.po deleted file mode 100644 index cfd496b..0000000 --- a/source/multimedia/alsa-utils/rc.alsa-hu.po +++ /dev/null @@ -1,25 +0,0 @@ -# Hungarian translations for rc.alsa package. -# Copyright (C) 2005 THE rc.alsa'S COPYRIGHT HOLDER -# This file is distributed under the same license as the rc.alsa package. -# VMiklos <vmik...@frugalware.org>, 2005. -# -msgid "" -msgstr "" -"Project-Id-Version: rc.alsa 1.0.10\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-11-20 14:27+0100\n" -"PO-Revision-Date: 2005-11-20 14:27+0100\n" -"Last-Translator: VMiklos <vmik...@frugalware.org>\n" -"Language-Team: Hungarian <translation-team...@lists.sourceforge.net>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-2\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: rc.alsa:18 -msgid "Loading ALSA mixer settings" -msgstr "Az ALSA hangerõbeállítások betöltése" - -#: rc.alsa:29 -msgid "Saving ALSA mixer settings" -msgstr "Az ALSA hangerõbeállítások elmentése" diff --git a/source/multimedia/alsa-utils/rc.alsa.pot b/source/multimedia/alsa-utils/rc.alsa.pot deleted file mode 100644 index 9de8934..0000000 --- a/source/multimedia/alsa-utils/rc.alsa.pot +++ /dev/null @@ -1,25 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR <em...@address>, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-11-20 14:27+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME <em...@address>\n" -"Language-Team: LANGUAGE <l...@li.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: rc.alsa:18 -msgid "Loading ALSA mixer settings" -msgstr "" - -#: rc.alsa:29 -msgid "Saving ALSA mixer settings" -msgstr "" diff --git a/source/multimedia/alsa-utils/systemd-support.diff b/source/multimedia/alsa-utils/systemd-support.diff new file mode 100644 index 0000000..3a0998c --- /dev/null +++ b/source/multimedia/alsa-utils/systemd-support.diff @@ -0,0 +1,210 @@ +From: Lennart Poettering <lenn...@poettering.net> +Date: Tue, 23 Nov 2010 00:45:08 +0000 (+0100) +Subject: alsactl: systemd and udev hookup +X-Git-Url: http://git.alsa-project.org/?p=alsa-utils.git;a=commitdiff_plain;h=de7c3eff0e371ce155403bbcdcf81ee79266fa0f;hp=b42a1c7a1979e1f5c01dc3d6ecf09169d7a912b0 + +alsactl: systemd and udev hookup + +Add minimal systemd and udev support to alsactl so that mixer settings +are restored at boot, when sound cards are plugged in and saved on +shutdown. + +This is similar to existing udev/init script solutions in various +distributions. + +Note that alsactl is called both synchronously from the udev rules as +well as asynchronously at boot. This is intended, and to ensure two +things: + +- At boot the asound.state file might not be readable, since it resides + on a different file system. That means exclusively restoring sound card + settings from udev rules will no suffice, since if the rule is + executed at early boot (for example within udev settle) then the file + will no be readable and cannot be restored. + +- We need to ensure that applications monitoring sound cards coming and + going (such as PA) must not get these events before the mixer settings + have been restored. That means the mixer settings must be restored + synchronously withing the udev rules, before the events are passed on + to the apps. + +That basically means we need to restore the settings once in udev, to +deal with sound cards becoming available during runtime. And once in +early boot to deal with coldplugged soundcards whose data files might +not have been available at time of plugging. Hence we call alsactl +twice: one from the udev rule, and once from he systemd unit file. + +Signed-off-by: Lennart Poettering <mzn...@0pointer.de> +Signed-off-by: Jaroslav Kysela <pe...@perex.cz> +--- + +diff --git a/Makefile.am b/Makefile.am +index 9951c46..62e1ba6 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -37,3 +37,6 @@ dist-hook: + else \ + $(TAR) --create --verbose --file=- $(distdir) | bzip2 -c -9 > $(distdir).tar.bz2 ; \ + fi ++ ++DISTCHECK_CONFIGURE_FLAGS = \ ++ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) +diff --git a/alsactl/.gitignore b/alsactl/.gitignore +new file mode 100644 +index 0000000..56ab3a2 +--- /dev/null ++++ b/alsactl/.gitignore +@@ -0,0 +1,3 @@ ++alsa-store.service ++alsa-restore.service ++90-alsa-restore.rules +diff --git a/alsactl/90-alsa-restore.rules.in b/alsactl/90-alsa-restore.rules.in +new file mode 100644 +index 0000000..0bcee5b +--- /dev/null ++++ b/alsactl/90-alsa-restore.rules.in +@@ -0,0 +1,2 @@ ++ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS=="card*", \ ++ RUN+="@sbindir@/alsactl restore $attr{number}" +diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am +index 359f73a..9a2d30e 100644 +--- a/alsactl/Makefile.am ++++ b/alsactl/Makefile.am +@@ -10,5 +10,51 @@ EXTRA_DIST=alsactl.1 alsactl_init.xml + alsactl_SOURCES=alsactl.c state.c utils.c init_parse.c + noinst_HEADERS=alsactl.h list.h init_sysdeps.c init_utils_string.c init_utils_run.c init_sysfs.c + ++udevrulesdir=/lib/udev/rules.d ++ ++dist_udevrules_DATA = \ ++ 90-alsa-restore.rules ++ ++if HAVE_SYSTEMD ++ ++systemdsystemunit_DATA = \ ++ alsa-store.service \ ++ alsa-restore.service ++ ++install-data-hook: ++ $(MKDIR_P) -m 0755 \ ++ $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants \ ++ $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants ++ ( cd $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants && \ ++ rm -f alsa-restore.service && \ ++ $(LN_S) ../alsa-restore.service alsa-restore.service ) ++ ( cd $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants && \ ++ rm -f alsa-store.service && \ ++ $(LN_S) ../alsa-store.service alsa-store.service ) ++ ++endif ++ ++edit = \ ++ sed $(SED) -r 's,@sbindir\@,$(sbindir),g' < $< > $@ || rm $@ ++ ++alsa-store.service: alsa-store.service.in ++ $(edit) ++ ++alsa-restore.service: alsa-restore.service.in ++ $(edit) ++ ++90-alsa-restore.rules: 90-alsa-restore.rules.in ++ $(edit) ++ ++EXTRA_DIST += \ ++ alsa-store.service.in \ ++ alsa-restore.service.in \ ++ 90-alsa-restore.rules.in ++ ++CLEANFILES = \ ++ alsa-store.service \ ++ alsa-restore.service \ ++ 90-alsa-restore.rules ++ + %.7: %.xml + xmlto man $? +diff --git a/alsactl/alsa-restore.service.in b/alsactl/alsa-restore.service.in +new file mode 100644 +index 0000000..e97d196 +--- /dev/null ++++ b/alsactl/alsa-restore.service.in +@@ -0,0 +1,11 @@ ++[Unit] ++Description=Restore Sound Card State ++DefaultDependencies=no ++After=sysinit.target ++Before=shutdown.target ++Conflicts=shutdown.target ++ ++[Service] ++Type=oneshot ++execstar...@sbindir@/alsactl restore ++StandardOutput=syslog +diff --git a/alsactl/alsa-store.service.in b/alsactl/alsa-store.service.in +new file mode 100644 +index 0000000..0e2823c +--- /dev/null ++++ b/alsactl/alsa-store.service.in +@@ -0,0 +1,9 @@ ++[Unit] ++Description=Store Sound Card State ++DefaultDependencies=no ++Before=shutdown.target ++ ++[Service] ++Type=oneshot ++execsta...@sbindir@/alsactl store ++StandardOutput=syslog +diff --git a/configure.in b/configure.in +index 31fd581..54ea74c 100644 +--- a/configure.in ++++ b/configure.in +@@ -26,6 +26,7 @@ fi + AC_PROG_CC + dnl AC_PROG_CXX + AC_PROG_INSTALL ++AC_PROG_MKDIR_P + AC_PROG_LN_S + AM_PATH_ALSA(1.0.16) + +@@ -130,7 +131,7 @@ if test x$alsamixer = xtrue; then + CURSES_CFLAGS=`ncursesw5-config --cflags` + curseslib="ncursesw" + else +- AC_CHECK_LIB(ncursesw, initscr, ++ AC_CHECK_LIB(ncursesw, initscr, + [ CURSESINC='<ncurses.h>'; CURSESLIB='-lncursesw'; curseslib="ncursesw"]) + fi + if test -n "$CURSESINC"; then +@@ -147,12 +148,12 @@ if test x$alsamixer = xtrue; then + CURSES_CFLAGS=`ncurses5-config --cflags` + curseslib="ncurses" + else +- AC_CHECK_LIB(ncurses, initscr, ++ AC_CHECK_LIB(ncurses, initscr, + [ CURSESINC='<ncurses.h>'; CURSESLIB='-lncurses'; curseslib="ncurses"]) + fi + fi + if test "$curseslib" = "curses" -o "$curseslib" = "auto"; then +- AC_CHECK_LIB(curses, initscr, ++ AC_CHECK_LIB(curses, initscr, + [ CURSESINC='<curses.h>'; CURSESLIB='-lcurses'; curseslib="curses"]) + fi + if test -z "$CURSESINC"; then +@@ -278,6 +279,16 @@ SAVE_UTIL_VERSION + + AC_SUBST(LIBRT) + ++dnl Check for systemd ++PKG_PROG_PKG_CONFIG ++AC_ARG_WITH([systemdsystemunitdir], ++ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), ++ [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) ++if test "x$with_systemdsystemunitdir" != xno; then ++ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) ++fi ++AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) ++ + AC_OUTPUT(Makefile alsactl/Makefile alsactl/init/Makefile \ + alsamixer/Makefile amidi/Makefile amixer/Makefile \ + m4/Makefile po/Makefile.in \ +
_______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git