<p>Pau Espin Pedrol <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/10892">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Harald Welte: Looks good to me, approved
  Pau Espin Pedrol: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Install systemd services with autotools<br><br>Change-Id: Id81ae8e2d8a2c9456ac0dac2c30c0d24dab3b694<br>---<br>M Makefile.am<br>M configure.ac<br>A contrib/Makefile.am<br>A contrib/systemd/Makefile.am<br>M debian/osmo-hlr.install<br>D debian/osmo-hlr.service<br>M debian/rules<br>7 files changed, 32 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/Makefile.am b/Makefile.am</span><br><span>index 8e18167..210e499 100644</span><br><span>--- a/Makefile.am</span><br><span>+++ b/Makefile.am</span><br><span>@@ -5,6 +5,7 @@</span><br><span>        src \</span><br><span>        include \</span><br><span>    sql \</span><br><span style="color: hsl(120, 100%, 40%);">+ contrib \</span><br><span>    tests \</span><br><span>      $(NULL)</span><br><span> </span><br><span>@@ -12,6 +13,9 @@</span><br><span>      .version \</span><br><span>   $(NULL)</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> pkgconfigdir = $(libdir)/pkgconfig</span><br><span> pkgconfig_DATA = libosmo-gsup-client.pc</span><br><span> </span><br><span>diff --git a/configure.ac b/configure.ac</span><br><span>index 16c8b51..368f1cc 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -92,6 +92,22 @@</span><br><span> AC_MSG_RESULT([$enable_ext_tests])</span><br><span> AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")</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>@@ -103,6 +119,8 @@</span><br><span>   include/Makefile</span><br><span>     libosmo-gsup-client.pc</span><br><span>       sql/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>     tests/Makefile</span><br><span>       tests/auc/Makefile</span><br><span>   tests/auc/gen_ts_55_205_test_sets/Makefile</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..520e720</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-hlr.service</span><br><span style="color: hsl(120, 100%, 40%);">+systemdsystemunit_DATA = \</span><br><span style="color: hsl(120, 100%, 40%);">+  osmo-hlr.service</span><br><span style="color: hsl(120, 100%, 40%);">+endif</span><br><span>diff --git a/debian/osmo-hlr.install b/debian/osmo-hlr.install</span><br><span>index 7991522..5a7c37b 100644</span><br><span>--- a/debian/osmo-hlr.install</span><br><span>+++ b/debian/osmo-hlr.install</span><br><span>@@ -1,3 +1,4 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/lib/systemd/system/osmo-hlr.service</span><br><span> /usr/bin/osmo-hlr</span><br><span> /usr/bin/osmo-hlr-db-tool</span><br><span> /usr/share/doc/osmo-hlr/sql/hlr.sql</span><br><span>diff --git a/debian/osmo-hlr.service b/debian/osmo-hlr.service</span><br><span>deleted file mode 120000</span><br><span>index 184f5aa..0000000</span><br><span>--- a/debian/osmo-hlr.service</span><br><span>+++ /dev/null</span><br><span>@@ -1 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-../contrib/systemd/osmo-hlr.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 1d8d8ab..9e97c6c 100755</span><br><span>--- a/debian/rules</span><br><span>+++ b/debian/rules</span><br><span>@@ -15,3 +15,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/10892">change 10892</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/10892"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-hlr </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Id81ae8e2d8a2c9456ac0dac2c30c0d24dab3b694 </div>
<div style="display:none"> Gerrit-Change-Number: 10892 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>