Install systemd services with autotools

Change-Id: I103bf3468d53578045593eac31b61f7e0248495e
This commit is contained in:
Pau Espin 2018-09-10 12:40:56 +02:00
parent e17ae024fa
commit 97ba4062f8
12 changed files with 37 additions and 4 deletions

View File

@ -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:

View File

@ -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)

1
contrib/Makefile.am Normal file
View File

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

View File

@ -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

1
debian/control vendored
View File

@ -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,

View File

@ -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

View File

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

View File

@ -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

View File

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

View File

@ -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

View File

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

2
debian/rules vendored
View File

@ -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)
#