aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-03-04 17:11:36 +0100
committerHarald Welte <laforge@osmocom.org>2020-03-04 18:18:14 +0100
commit75b8eb3bcc91c8c0e54ce4b2336e66364cbc1a16 (patch)
treeaa6761e3e9310ae4d6ec53ed58ba0ecdde302a9d
parentde80eb3988d426f413e850a779af2013b1ad5384 (diff)
configure.ac + debian: Add systemd service file support
-rw-r--r--configure.ac16
-rw-r--r--contrib/systemd/Makefile.am7
-rw-r--r--debian/osmo-remsim-bankd.install1
-rw-r--r--debian/osmo-remsim-client.install1
-rw-r--r--debian/osmo-remsim-server.install1
5 files changed, 26 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index d2c5e58..0ccb0ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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"
diff --git a/contrib/systemd/Makefile.am b/contrib/systemd/Makefile.am
index 642920c..2cc64df 100644
--- a/contrib/systemd/Makefile.am
+++ b/contrib/systemd/Makefile.am
@@ -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
diff --git a/debian/osmo-remsim-bankd.install b/debian/osmo-remsim-bankd.install
index d8168d5..58de089 100644
--- a/debian/osmo-remsim-bankd.install
+++ b/debian/osmo-remsim-bankd.install
@@ -1 +1,2 @@
usr/bin/osmo-remsim-bankd
+lib/systemd/system/osmo-remsim-bankd.service
diff --git a/debian/osmo-remsim-client.install b/debian/osmo-remsim-client.install
index 8e73dc1..85ffb82 100644
--- a/debian/osmo-remsim-client.install
+++ b/debian/osmo-remsim-client.install
@@ -1 +1,2 @@
usr/bin/osmo-remsim-client*
+lib/systemd/system/osmo-remsim-client*
diff --git a/debian/osmo-remsim-server.install b/debian/osmo-remsim-server.install
index f6f14a1..497f7e1 100644
--- a/debian/osmo-remsim-server.install
+++ b/debian/osmo-remsim-server.install
@@ -1 +1,2 @@
usr/bin/osmo-remsim-server
+lib/systemd/system/osmo-remsim-server.service