alsactl: add --with-alsactl-daemonswitch=FILE to the global configure.in

It may be useful to have the file location configurable.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2013-04-10 11:08:47 +02:00
parent 8b34bf25c0
commit c3a31afe14
6 changed files with 14 additions and 6 deletions

View file

@ -2,7 +2,7 @@ ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS!="card*", GOTO="
GOTO="alsa_restore_end"
LABEL="alsa_restore_go"
TEST!="/etc/alsa/state-daemon.conf", RUN+="@sbindir@/alsactl restore $attr{number}"
TEST=="/etc/alsa/state-daemon.conf", RUN+="@sbindir@/alsactl nrestore $attr{number}"
TEST!="@daemonswitch@", RUN+="@sbindir@/alsactl restore $attr{number}"
TEST=="@daemonswitch@", RUN+="@sbindir@/alsactl nrestore $attr{number}"
LABEL="alsa_restore_end"

View file

@ -36,7 +36,9 @@ install-data-hook:
endif
edit = \
$(SED) -r 's,@sbindir\@,$(sbindir),g' < $< > $@ || rm $@
$(SED) -r -e 's,@sbindir\@,$(sbindir),g' \
-e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
< $< > $@ || rm $@
alsa-state.service: alsa-state.service.in
$(edit)

View file

@ -5,7 +5,7 @@
[Unit]
Description=Restore Sound Card State
ConditionPathExists=!/etc/alsa/state-daemon.conf
ConditionPathExists=!@daemonswitch@
DefaultDependencies=no
After=alsa-state.service
Before=shutdown.target

View file

@ -5,7 +5,7 @@
[Unit]
Description=Manage Sound Card State (restore and store)
ConditionPathExists=/etc/alsa/state-daemon.conf
ConditionPathExists=@daemonswitch@
DefaultDependencies=no
After=sysinit.target
Before=shutdown.target

View file

@ -5,7 +5,7 @@
[Unit]
Description=Store Sound Card State
ConditionPathExists=!/etc/alsa/state-daemon.conf
ConditionPathExists=!@daemonswitch@
DefaultDependencies=no
Before=shutdown.target

View file

@ -328,6 +328,12 @@ AC_ARG_WITH([alsactl-pidfile-dir],
[ALSACTL_PIDFILE_DIR="/var/run"])
AC_SUBST(ALSACTL_PIDFILE_DIR)
AC_ARG_WITH([alsactl-daemonswitch],
AS_HELP_STRING([--with-alsactl-daemonswitch=FILE], [File to test for the daemon mode]),
[ALSACTL_DAEMONSWITCH="$withval"],
[ALSACTL_DAEMONSWITCH="/etc/alsa/state-daemon.conf"])
AC_SUBST(ALSACTL_DAEMONSWITCH)
AC_OUTPUT(Makefile alsactl/Makefile alsactl/init/Makefile \
alsamixer/Makefile amidi/Makefile amixer/Makefile \
m4/Makefile po/Makefile.in \