Install systemd services with autotools
Change-Id: I103bf3468d53578045593eac31b61f7e0248495e
This commit is contained in:
parent
e17ae024fa
commit
97ba4062f8
|
@ -12,6 +12,7 @@ SUBDIRS = \
|
|||
doc \
|
||||
include \
|
||||
src \
|
||||
contrib \
|
||||
tests \
|
||||
$(NULL)
|
||||
|
||||
|
@ -21,6 +22,9 @@ pkgconfig_DATA = osmo-sgsn.pc
|
|||
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:
|
||||
|
|
18
configure.ac
18
configure.ac
|
@ -176,6 +176,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"])
|
||||
|
||||
|
@ -201,4 +217,6 @@ AC_OUTPUT(
|
|||
tests/v42bis/Makefile
|
||||
doc/Makefile
|
||||
doc/examples/Makefile
|
||||
contrib/Makefile
|
||||
contrib/systemd/Makefile
|
||||
Makefile)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
SUBDIRS = systemd
|
|
@ -0,0 +1,9 @@
|
|||
if HAVE_SYSTEMD
|
||||
SYSTEMD_SERVICES = \
|
||||
osmo-gbproxy.service \
|
||||
osmo-gtphub.service \
|
||||
osmo-sgsn.service
|
||||
|
||||
EXTRA_DIST = $(SYSTEMD_SERVICES)
|
||||
systemdsystemunit_DATA = $(SYSTEMD_SERVICES)
|
||||
endif
|
|
@ -4,6 +4,7 @@ Priority: extra
|
|||
Maintainer: Alexander Couzens <lynxis@fe80.eu>
|
||||
Build-Depends: debhelper (>=9),
|
||||
dh-autoreconf,
|
||||
dh-systemd (>= 1.5),
|
||||
autotools-dev,
|
||||
autoconf,
|
||||
automake,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
lib/systemd/system/osmo-gbproxy.service
|
||||
usr/bin/osmo-gbproxy
|
||||
usr/share/doc/osmo-sgsn/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg usr/share/doc/osmo-gbproxy/examples
|
||||
usr/share/doc/osmo-sgsn/examples/osmo-gbproxy/osmo-gbproxy.cfg usr/share/doc/osmo-gbproxy/examples
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
../contrib/systemd/osmo-gbproxy.service
|
|
@ -1,3 +1,4 @@
|
|||
lib/systemd/system/osmo-gtphub.service
|
||||
usr/bin/osmo-gtphub
|
||||
usr/share/doc/osmo-sgsn/examples/osmo-gtphub/osmo-gtphub-1iface.cfg usr/share/doc/osmo-gtphub/examples
|
||||
usr/share/doc/osmo-sgsn/examples/osmo-gtphub/osmo-gtphub.cfg usr/share/doc/osmo-gtphub/examples
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
../contrib/systemd/osmo-gtphub.service
|
|
@ -1,3 +1,4 @@
|
|||
lib/systemd/system/osmo-sgsn.service
|
||||
usr/bin/osmo-sgsn
|
||||
usr/share/doc/osmo-sgsn/examples/osmo-sgsn/osmo-sgsn.cfg usr/share/doc/osmo-sgsn/examples
|
||||
usr/share/doc/osmo-sgsn/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg usr/share/doc/osmo-sgsn/examples
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
../contrib/systemd/osmo-sgsn.service
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
# debmake generated override targets
|
||||
# Set options for ./configure
|
||||
CONFIGURE_FLAGS += --enable-iu
|
||||
CONFIGURE_FLAGS += --enable-iu --with-systemdsystemunitdir=/lib/systemd/system
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- $(CONFIGURE_FLAGS)
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue