Install systemd service file if systemd is available

This commit is contained in:
Miklos Vajna 2011-09-30 08:37:36 +02:00 committed by Max Kellermann
parent 525a791987
commit 83f6498aac
4 changed files with 27 additions and 0 deletions

View File

@ -802,6 +802,15 @@ FILTER_SRC = \
src/filter/volume_filter_plugin.c src/filter/volume_filter_plugin.c
#
# systemd unit
#
if HAVE_SYSTEMD
systemdsystemunit_DATA = \
mpd.service
endif
# #
# Sparse code analysis # Sparse code analysis
# #

1
NEWS
View File

@ -11,6 +11,7 @@ ver 0.16.5 (2010/??/??)
- ffmpeg: don't require key frame for seeking - ffmpeg: don't require key frame for seeking
- fix CUE track seeking - fix CUE track seeking
* WIN32: close sockets properly * WIN32: close sockets properly
* install systemd service file if systemd is available
ver 0.16.4 (2011/09/01) ver 0.16.4 (2011/09/01)

View File

@ -33,6 +33,13 @@ fi
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
AC_ARG_WITH([systemdsystemunitdir],
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
[], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
if test "x$with_systemdsystemunitdir" != xno; then
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl Declare Variables dnl Declare Variables
@ -1592,5 +1599,6 @@ dnl ---------------------------------------------------------------------------
dnl Generate files dnl Generate files
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
AC_OUTPUT(Makefile) AC_OUTPUT(Makefile)
AC_OUTPUT(mpd.service)
echo 'MPD is ready for compilation, type "make" to begin.' echo 'MPD is ready for compilation, type "make" to begin.'

9
mpd.service.in Normal file
View File

@ -0,0 +1,9 @@
[Unit]
Description=Music Player Daemon
After=sound.target
[Service]
ExecStart=@prefix@/bin/mpd --no-daemon
[Install]
WantedBy=multi-user.target