]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsactl: add --with-alsactl-daemonswitch=FILE to the global configure.in
authorJaroslav Kysela <perex@perex.cz>
Wed, 10 Apr 2013 09:08:47 +0000 (11:08 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 10 Apr 2013 09:08:47 +0000 (11:08 +0200)
It may be useful to have the file location configurable.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
alsactl/90-alsa-restore.rules.in
alsactl/Makefile.am
alsactl/alsa-restore.service.in
alsactl/alsa-state.service.in
alsactl/alsa-store.service.in
configure.in

index 3ce9a6540d551cdfe1d10a43e7f767c27c551fe7..88e12e0656d26cbda120cf7f8f610ae3bd2c45c9 100644 (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"
index dbc00f157c02cab8d2f240a08b0385d742b7723b..b6442108bc02bc198c36e57773a0adbea8951109 100644 (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)
index a0d752c8a207c48507f550c22e329298c012143b..ab3c30d4f3c2c34a3dd652e21ead641b2c20a951 100644 (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
index 94d138be045e52a4044a3790805b875ab00ac51b..768c5a848a7cd901f356945130ae4c50a79b1893 100644 (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
index b2e0ac935465e59810c21ae609b10652948d80f8..f1a56bb9dbb5826af1a9d4c2c7be10fb877e6c95 100644 (file)
@@ -5,7 +5,7 @@
 
 [Unit]
 Description=Store Sound Card State
-ConditionPathExists=!/etc/alsa/state-daemon.conf
+ConditionPathExists=!@daemonswitch@
 DefaultDependencies=no
 Before=shutdown.target
 
index bcb53210f9eeb24bab03b733a2a466cdf18aeea9..aca2b7999c15f1a80a3bb4ea2ebc5b3b563abfc7 100644 (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 \