diff options
Diffstat (limited to 'package')
-rw-r--r-- | package/multimedia/pulseaudio/Config.in | 8 | ||||
-rwxr-xr-x | package/multimedia/pulseaudio/S50pulseaudio | 39 | ||||
-rw-r--r-- | package/multimedia/pulseaudio/pulseaudio.mk | 12 |
3 files changed, 59 insertions, 0 deletions
diff --git a/package/multimedia/pulseaudio/Config.in b/package/multimedia/pulseaudio/Config.in index 03c26137e..9a6911e0e 100644 --- a/package/multimedia/pulseaudio/Config.in +++ b/package/multimedia/pulseaudio/Config.in @@ -19,5 +19,13 @@ config BR2_PACKAGE_PULSEAUDIO http://pulseaudio.org +config BR2_PACKAGE_PULSEAUDIO_DAEMON + bool "start as a system daemon" + depends on BR2_PACKAGE_PULSEAUDIO + help + PulseAudio can be started as a system daemon. This is not the + recommended way of using PulseAudio unless you are building a + headless system. + comment "pulseaudio requires a toolchain with WCHAR, LARGEFILE and threads support" depends on !BR2_USE_WCHAR || !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/multimedia/pulseaudio/S50pulseaudio b/package/multimedia/pulseaudio/S50pulseaudio new file mode 100755 index 000000000..4c6877eb1 --- /dev/null +++ b/package/multimedia/pulseaudio/S50pulseaudio @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Starts pulseaudio. +# + + +start() { + echo -n "Starting pulseaudio: " + umask 077 + /usr/bin/pulseaudio --system --daemonize + echo "OK" +} +stop() { + echo -n "Stopping pulseaudio: " + pulseaudio --kill + echo "OK" +} +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? + diff --git a/package/multimedia/pulseaudio/pulseaudio.mk b/package/multimedia/pulseaudio/pulseaudio.mk index e78eb42ba..16df85555 100644 --- a/package/multimedia/pulseaudio/pulseaudio.mk +++ b/package/multimedia/pulseaudio/pulseaudio.mk @@ -84,4 +84,16 @@ endef PULSEAUDIO_POST_INSTALL_TARGET_HOOKS += PULSEAUDIO_REMOVE_VALA endif +ifeq ($(BR2_PACKAGE_PULSEAUDIO_DAEMON),y) +define PULSEAUDIO_USERS + pulse -1 pulse -1 * /var/run/pulse - audio,pulse-access +endef + +define PULSEAUDIO_INSTALL_INIT_SYSV + $(INSTALL) -D -m 755 package/multimedia/pulseaudio/S50pulseaudio \ + $(TARGET_DIR)/etc/init.d/S50pulseaudio +endef + +endif + $(eval $(autotools-package)) |