configure.ac + debian: Add systemd service file support

Closes: OS#4326
Change-Id: I0d7b6562c1127f005ddbd47298c03942ac3d241d
This commit is contained in:
Harald Welte 2020-03-04 17:11:36 +01:00
parent de80eb3988
commit 75b8eb3bcc
5 changed files with 26 additions and 0 deletions

View File

@ -160,6 +160,22 @@ then
AC_SUBST([OSMO_GSM_MANUALS_DIR])
fi
# https://www.freedesktop.org/software/systemd/man/daemon.html
AC_ARG_WITH([systemdsystemunitdir],
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
[with_systemdsystemunitdir=auto])
AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
AS_IF([test "x$def_systemdsystemunitdir" = "x"],
[AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
[AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
with_systemdsystemunitdir=no],
[with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
[AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
CFLAGS="$CFLAGS -Wall"
CPPFLAGS="$CPPFLAGS -Wall"

View File

@ -1 +1,8 @@
EXTRA_DIST = osmo-remsim-bankd.service osmo-remsim-client@.service osmo-remsim-server.service
if HAVE_SYSTEMD
systemdsystemunit_DATA = \
osmo-remsim-bankd.service \
osmo-remsim-server.service \
osmo-remsim-client@.service
endif

View File

@ -1 +1,2 @@
usr/bin/osmo-remsim-bankd
lib/systemd/system/osmo-remsim-bankd.service

View File

@ -1 +1,2 @@
usr/bin/osmo-remsim-client*
lib/systemd/system/osmo-remsim-client*

View File

@ -1 +1,2 @@
usr/bin/osmo-remsim-server
lib/systemd/system/osmo-remsim-server.service