diff --git a/CMakeLists.txt b/CMakeLists.txt index 34e187fdf..195a37fc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -475,6 +475,15 @@ if ( UNIX ) configure_file ( fluidsynth.spec.in ${CMAKE_BINARY_DIR}/fluidsynth.spec IMMEDIATE @ONLY ) + if ( DEFINED FLUID_DAEMON_ENV_FILE) + configure_file ( fluidsynth.service.in + ${CMAKE_BINARY_DIR}/fluidsynth.service @ONLY ) + + configure_file ( fluidsynth.conf.in + ${CMAKE_BINARY_DIR}/fluidsynth.conf @ONLY ) + + endif ( DEFINED FLUID_DAEMON_ENV_FILE ) + # uninstall custom target configure_file ( "${CMAKE_SOURCE_DIR}/cmake_admin/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) diff --git a/fluidsynth.conf.in b/fluidsynth.conf.in new file mode 100644 index 000000000..c358dc7a1 --- /dev/null +++ b/fluidsynth.conf.in @@ -0,0 +1,5 @@ +# Mandatory parameters (uncomment and edit) +#SOUND_FONT=@DEFAULT_SOUNDFONT@ + +# Additional optional parameters (may be useful, see 'man fluidsynth' for further info) +#OTHER_OPTS='-a alsa -m alsa_seq -r 48000' diff --git a/fluidsynth.service.in b/fluidsynth.service.in new file mode 100644 index 000000000..20b5696af --- /dev/null +++ b/fluidsynth.service.in @@ -0,0 +1,13 @@ +[Unit] +Description=FluidSynth Daemon +Documentation=man:fluidsynth(1) +After=sound.target + +[Service] +EnvironmentFile=@FLUID_DAEMON_ENV_FILE@ +EnvironmentFile=-%h/.config/fluidsynth +ExecStart=@CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@/fluidsynth -is $OTHER_OPTS $SOUND_FONT + +[Install] +WantedBy=multi-user.target +