It may be useful to have the file location configurable.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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"
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)
[Unit]
Description=Restore Sound Card State
-ConditionPathExists=!/etc/alsa/state-daemon.conf
+ConditionPathExists=!@daemonswitch@
DefaultDependencies=no
After=alsa-state.service
Before=shutdown.target
[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
[Unit]
Description=Store Sound Card State
-ConditionPathExists=!/etc/alsa/state-daemon.conf
+ConditionPathExists=!@daemonswitch@
DefaultDependencies=no
Before=shutdown.target
[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 \