diff options
author | matt335672 <30179339+matt335672@users.noreply.github.com> | 2021-10-19 12:15:38 +0300 |
---|---|---|
committer | matt335672 <30179339+matt335672@users.noreply.github.com> | 2021-10-30 17:10:57 +0300 |
commit | 91c239ee58ff36dfe235a13b7286fd36bd5a08f8 (patch) | |
tree | 8e6851f125329e0f41df59780105d4e9f3a0f20f | |
parent | 22b84e312e3aaea7324121ae9a2c1ca1a014b2cd (diff) |
Add install files to the build
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | instfiles/Makefile.am | 33 | ||||
-rwxr-xr-x | instfiles/load_pa_modules.sh | 32 | ||||
-rw-r--r-- | instfiles/pulseaudio-xrdp.desktop.in | 9 |
5 files changed, 77 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am index 3bc4e60..e944705 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = src +SUBDIRS = src instfiles EXTRA_DIST = bootstrap.sh diff --git a/configure.ac b/configure.ac index 4d30e39..d4090b4 100644 --- a/configure.ac +++ b/configure.ac @@ -80,5 +80,6 @@ AC_TYPE_UINT32_T AC_CHECK_FUNCS([memset socket]) AC_CONFIG_FILES([Makefile - src/Makefile]) + src/Makefile + instfiles/Makefile]) AC_OUTPUT diff --git a/instfiles/Makefile.am b/instfiles/Makefile.am new file mode 100644 index 0000000..9c281fe --- /dev/null +++ b/instfiles/Makefile.am @@ -0,0 +1,33 @@ +EXTRA_DIST = \ + load_pa_modules.sh \ + pulseaudio-xrdp.desktop.in + +# +# substitute directories in service file +# +CLEANFILES= \ + pulseaudio-xrdp.desktop + +SUBST_VARS = sed \ + -e 's|@pkglibexecdir[@]|$(pkglibexecdir)|g' + +subst_verbose = $(subst_verbose_@AM_V@) +subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) +subst_verbose_0 = @echo " SUBST $@"; + +SUFFIXES = .in +.in: + $(subst_verbose)$(SUBST_VARS) $< > $@ + +# +# files for all platforms +# + +# Don't use sysconfdir for this one as it won't work! +xdgautostartdir=/etc/xdg/autostart + +xdgautostart_DATA = \ + pulseaudio-xrdp.desktop + +pkglibexec_SCRIPTS = \ + load_pa_modules.sh diff --git a/instfiles/load_pa_modules.sh b/instfiles/load_pa_modules.sh new file mode 100755 index 0000000..bfb2bc6 --- /dev/null +++ b/instfiles/load_pa_modules.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +PACTL=/usr/bin/pactl + +if [ -n "$XRDP_SESSION" -a -n "$XRDP_SOCKET_PATH" ]; then + # These values are not present on xrdp versions before v0.9.8 + if [ -z "$XRDP_PULSE_SINK_SOCKET" -o \ + -z "$XRDP_PULSE_SOURCE_SOCKET" ]; then + displaynum=${DISPLAY##*:} + displaynum=${displaynum%.*} + XRDP_PULSE_SINK_SOCKET=xrdp_chansrv_audio_out_socket_$displaynum + XRDP_PULSE_SOURCE_SOCKET=xrdp_chansrv_audio_in_socket_$displaynum + fi + + # Don't check for the presence of the sockets, as if the modules + # are loaded they won't be there + + # Unload modules + $PACTL unload-module module-xrdp-sink >/dev/null 2>&1 + $PACTL unload-module module-xrdp-source >/dev/null 2>&1 + + # Reload modules + $PACTL load-module module-xrdp-sink \ + xrdp_socket_path=$XRDP_SOCKET_PATH \ + xrdp_pulse_sink_socket=$XRDP_PULSE_SINK_SOCKET && \ + \ + $PACTL load-module module-xrdp-source \ + xrdp_socket_path=$XRDP_SOCKET_PATH \ + xrdp_pulse_source_socket=$XRDP_PULSE_SOURCE_SOCKET +fi + +exit $? diff --git a/instfiles/pulseaudio-xrdp.desktop.in b/instfiles/pulseaudio-xrdp.desktop.in new file mode 100644 index 0000000..baac740 --- /dev/null +++ b/instfiles/pulseaudio-xrdp.desktop.in @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Name=PulseAudio xrdp modules +Comment=Load PulseAudio Modules for xrdp +Exec=@pkglibexecdir@/load_pa_modules.sh +Terminal=false +Type=Application +Categories= +GenericName= |