Browse Source

Install systemd services with autotools

Change-Id: Ie4c7e81495181059d1dff1c194d52d11fb72ed03
changes/99/10899/1
Pau Espin 4 years ago
parent
commit
516697e29a
  1. 5
      Makefile.am
  2. 18
      configure.ac
  3. 1
      contrib/Makefile.am
  4. 5
      contrib/systemd/Makefile.am
  5. 0
      contrib/systemd/osmo-pcu.service
  6. 1
      debian/osmo-pcu.install
  7. 1
      debian/osmo-pcu.service
  8. 3
      debian/rules

5
Makefile.am

@ -1,8 +1,11 @@
AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
SUBDIRS = include src examples tests
SUBDIRS = include src examples tests contrib
EXTRA_DIST = osmoappdesc.py README.md
DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
@RELMAKE@
pkgconfigdir = $(libdir)/pkgconfig

18
configure.ac

@ -157,6 +157,22 @@ AM_CONDITIONAL(ENABLE_VTY_TESTS, test "x$enable_vty_tests" = "xyes")
STD_DEFINES_AND_INCLUDES="-Wall"
AC_SUBST(STD_DEFINES_AND_INCLUDES)
# 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([CPPFLAGS="$CPPFLAGS"])
AC_MSG_RESULT([CFLAGS="$CFLAGS"])
AC_MSG_RESULT([CXXFLAGS="$CXXFLAGS"])
@ -168,4 +184,6 @@ AC_OUTPUT(
src/Makefile
examples/Makefile
tests/Makefile
contrib/Makefile
contrib/systemd/Makefile
Makefile)

1
contrib/Makefile.am

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

5
contrib/systemd/Makefile.am

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

0
contrib/osmo-pcu.service → contrib/systemd/osmo-pcu.service

1
debian/osmo-pcu.install vendored

@ -1,4 +1,5 @@
etc/osmocom/osmo-pcu.cfg
lib/systemd/system/osmo-pcu.service
usr/bin/osmo-pcu
usr/include/osmocom/pcu/pcuif_proto.h
usr/lib/*/pkgconfig/osmo-pcu.pc

1
debian/osmo-pcu.service vendored

@ -1 +0,0 @@
../contrib/osmo-pcu.service

3
debian/rules vendored

@ -22,3 +22,6 @@ override_dh_clean:
# 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