<p>Pau Espin Pedrol has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10891">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Install systemd services with autotools<br><br>Change-Id: I90f1efc4433ec641a28931d5c19e2301a67cf1e9<br>---<br>M Makefile.am<br>M configure.ac<br>A contrib/Makefile.am<br>A contrib/systemd/Makefile.am<br>M debian/osmo-hnbgw.install<br>D debian/osmo-hnbgw.service<br>M debian/rules<br>7 files changed, 32 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/91/10891/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/Makefile.am b/Makefile.am</span><br><span>index 67445ee..2e59306 100644</span><br><span>--- a/Makefile.am</span><br><span>+++ b/Makefile.am</span><br><span>@@ -1,12 +1,15 @@</span><br><span> AUTOMAKE_OPTIONS = foreign dist-bzip2</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-SUBDIRS = src include doc</span><br><span style="color: hsl(120, 100%, 40%);">+SUBDIRS = src include doc contrib</span><br><span> </span><br><span> pkgconfigdir = $(libdir)/pkgconfig</span><br><span> pkgconfig_DATA = libosmo-ranap.pc</span><br><span> </span><br><span> EXTRA_DIST = asn1 .version README.md</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+DISTCHECK_CONFIGURE_FLAGS = \</span><br><span style="color: hsl(120, 100%, 40%);">+     --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> @RELMAKE@</span><br><span> </span><br><span> BUILT_SOURCES = $(top_srcdir)/.version</span><br><span>diff --git a/configure.ac b/configure.ac</span><br><span>index bb99dfb..559db39 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -79,6 +79,22 @@</span><br><span> CFLAGS="$CFLAGS -Wall"</span><br><span> CPPFLAGS="$CPPFLAGS -Wall"</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+# https://www.freedesktop.org/software/systemd/man/daemon.html</span><br><span style="color: hsl(120, 100%, 40%);">+AC_ARG_WITH([systemdsystemunitdir],</span><br><span style="color: hsl(120, 100%, 40%);">+     [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,</span><br><span style="color: hsl(120, 100%, 40%);">+     [with_systemdsystemunitdir=auto])</span><br><span style="color: hsl(120, 100%, 40%);">+AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [</span><br><span style="color: hsl(120, 100%, 40%);">+     def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     AS_IF([test "x$def_systemdsystemunitdir" = "x"],</span><br><span style="color: hsl(120, 100%, 40%);">+   [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],</span><br><span style="color: hsl(120, 100%, 40%);">+    [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])</span><br><span style="color: hsl(120, 100%, 40%);">+    with_systemdsystemunitdir=no],</span><br><span style="color: hsl(120, 100%, 40%);">+   [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])</span><br><span style="color: hsl(120, 100%, 40%);">+AS_IF([test "x$with_systemdsystemunitdir" != "xno"],</span><br><span style="color: hsl(120, 100%, 40%);">+      [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])</span><br><span style="color: hsl(120, 100%, 40%);">+AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> AC_MSG_RESULT([CFLAGS="$CFLAGS"])</span><br><span> AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])</span><br><span> </span><br><span>@@ -98,4 +114,6 @@</span><br><span>    include/osmocom/iuh/Makefile</span><br><span>         doc/Makefile</span><br><span>         doc/examples/Makefile</span><br><span style="color: hsl(120, 100%, 40%);">+ contrib/Makefile</span><br><span style="color: hsl(120, 100%, 40%);">+      contrib/systemd/Makefile</span><br><span>     )</span><br><span>diff --git a/contrib/Makefile.am b/contrib/Makefile.am</span><br><span>new file mode 100644</span><br><span>index 0000000..3439c97</span><br><span>--- /dev/null</span><br><span>+++ b/contrib/Makefile.am</span><br><span>@@ -0,0 +1 @@</span><br><span style="color: hsl(120, 100%, 40%);">+SUBDIRS = systemd</span><br><span>diff --git a/contrib/systemd/Makefile.am b/contrib/systemd/Makefile.am</span><br><span>new file mode 100644</span><br><span>index 0000000..507be2d</span><br><span>--- /dev/null</span><br><span>+++ b/contrib/systemd/Makefile.am</span><br><span>@@ -0,0 +1,5 @@</span><br><span style="color: hsl(120, 100%, 40%);">+if HAVE_SYSTEMD</span><br><span style="color: hsl(120, 100%, 40%);">+EXTRA_DIST = osmo-hnbgw.service</span><br><span style="color: hsl(120, 100%, 40%);">+systemdsystemunit_DATA = \</span><br><span style="color: hsl(120, 100%, 40%);">+  osmo-hnbgw.service</span><br><span style="color: hsl(120, 100%, 40%);">+endif</span><br><span>diff --git a/debian/osmo-hnbgw.install b/debian/osmo-hnbgw.install</span><br><span>index e230915..bb70ad5 100644</span><br><span>--- a/debian/osmo-hnbgw.install</span><br><span>+++ b/debian/osmo-hnbgw.install</span><br><span>@@ -1,2 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+lib/systemd/system/osmo-hnbgw.service</span><br><span> usr/bin/osmo-hnbgw</span><br><span> usr/share/doc/osmo-iuh/examples/osmo-hnbgw.cfg</span><br><span>diff --git a/debian/osmo-hnbgw.service b/debian/osmo-hnbgw.service</span><br><span>deleted file mode 120000</span><br><span>index e69ea55..0000000</span><br><span>--- a/debian/osmo-hnbgw.service</span><br><span>+++ /dev/null</span><br><span>@@ -1 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-../contrib/systemd/osmo-hnbgw.service</span><br><span>\ No newline at end of file</span><br><span>diff --git a/debian/rules b/debian/rules</span><br><span>index 9ebfdd0..6f20b3e 100755</span><br><span>--- a/debian/rules</span><br><span>+++ b/debian/rules</span><br><span>@@ -16,3 +16,6 @@</span><br><span> # Print test results in case of a failure</span><br><span> override_dh_auto_test:</span><br><span>  dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+override_dh_auto_configure:</span><br><span style="color: hsl(120, 100%, 40%);">+   dh_auto_configure -- --with-systemdsystemunitdir=/lib/systemd/system</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10891">change 10891</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/10891"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-iuh </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I90f1efc4433ec641a28931d5c19e2301a67cf1e9 </div>
<div style="display:none"> Gerrit-Change-Number: 10891 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>