Install systemd services with autotools

Change-Id: I3a87d5ad4cb43efdcfc25828144f825f4d3b1594
This commit is contained in:
Pau Espin 2018-09-10 12:55:00 +02:00
parent 36115c9d9a
commit f282f33360
7 changed files with 31 additions and 3 deletions

View File

@ -12,12 +12,16 @@ SUBDIRS = \
doc \
include \
src \
contrib \
tests \
$(NULL)
BUILT_SOURCES = $(top_srcdir)/.version
EXTRA_DIST = git-version-gen osmoappdesc.py .version
DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
@RELMAKE@
$(top_srcdir)/.version:

View File

@ -181,6 +181,22 @@ AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
AC_MSG_RESULT([$enable_ext_tests])
AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
# 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"])
AC_MSG_RESULT([CFLAGS="$CFLAGS"])
AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
@ -203,4 +219,6 @@ AC_OUTPUT(
tests/msc_vlr/Makefile
doc/Makefile
doc/examples/Makefile
contrib/Makefile
contrib/systemd/Makefile
Makefile)

1
contrib/Makefile.am Normal file
View File

@ -0,0 +1 @@
SUBDIRS = systemd

View File

@ -0,0 +1,5 @@
if HAVE_SYSTEMD
EXTRA_DIST = osmo-msc.service
systemdsystemunit_DATA = \
osmo-msc.service
endif

View File

@ -1,3 +1,4 @@
lib/systemd/system/osmo-msc.service
usr/bin/osmo-msc
usr/share/doc/osmo-msc/examples/osmo-msc/osmo-msc.cfg usr/share/doc/osmo-msc/examples
usr/share/doc/osmo-msc/examples/osmo-msc/osmo-msc_custom-sccp.cfg usr/share/doc/osmo-msc/examples

View File

@ -1 +0,0 @@
../contrib/systemd/osmo-msc.service

4
debian/rules vendored
View File

@ -42,11 +42,11 @@
# main packaging script based on dh7 syntax
%:
dh $@ --with autoreconf
dh $@ --with autoreconf
# debmake generated override targets
# Set options for ./configure
CONFIGURE_FLAGS += --enable-iu --enable-smpp
CONFIGURE_FLAGS += --enable-iu --enable-smpp --with-systemdsystemunitdir=/lib/systemd/system
override_dh_auto_configure:
dh_auto_configure -- $(CONFIGURE_FLAGS)
#