Install systemd services with autotools

Change-Id: I90f1efc4433ec641a28931d5c19e2301a67cf1e9
changes/91/10891/1
Pau Espin 4 years ago
parent b69c902fe0
commit a68b6828c8
  1. 5
      Makefile.am
  2. 18
      configure.ac
  3. 1
      contrib/Makefile.am
  4. 5
      contrib/systemd/Makefile.am
  5. 1
      debian/osmo-hnbgw.install
  6. 1
      debian/osmo-hnbgw.service
  7. 3
      debian/rules

@ -1,12 +1,15 @@
AUTOMAKE_OPTIONS = foreign dist-bzip2
SUBDIRS = src include doc
SUBDIRS = src include doc contrib
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libosmo-ranap.pc
EXTRA_DIST = asn1 .version README.md
DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
@RELMAKE@
BUILT_SOURCES = $(top_srcdir)/.version

@ -79,6 +79,22 @@ fi
CFLAGS="$CFLAGS -Wall"
CPPFLAGS="$CPPFLAGS -Wall"
# 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"])
@ -98,4 +114,6 @@ AC_OUTPUT(
include/osmocom/iuh/Makefile
doc/Makefile
doc/examples/Makefile
contrib/Makefile
contrib/systemd/Makefile
)

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

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

@ -1,2 +1,3 @@
lib/systemd/system/osmo-hnbgw.service
usr/bin/osmo-hnbgw
usr/share/doc/osmo-iuh/examples/osmo-hnbgw.cfg

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

3
debian/rules vendored

@ -16,3 +16,6 @@ override_dh_strip:
# Print test results in case of a failure
override_dh_auto_test:
dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false)
override_dh_auto_configure:
dh_auto_configure -- --with-systemdsystemunitdir=/lib/systemd/system

Loading…
Cancel
Save