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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Install systemd services with autotools<br><br>Change-Id: Ie77ee4b32a75e2d207030ddc78d39fb664103d33<br>---<br>M Makefile.am<br>M configure.ac<br>A contrib/Makefile.am<br>A contrib/systemd/Makefile.am<br>M debian/osmo-stp.install<br>D debian/osmo-stp.service<br>M debian/rules<br>7 files changed, 29 insertions(+), 3 deletions(-)<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 3f4de13..7d09259 100644</span><br><span>--- a/Makefile.am</span><br><span>+++ b/Makefile.am</span><br><span>@@ -1,13 +1,16 @@</span><br><span> AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6</span><br><span> </span><br><span> AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include</span><br><span style="color: hsl(0, 100%, 40%);">-SUBDIRS = include src tests examples stp doc</span><br><span style="color: hsl(120, 100%, 40%);">+SUBDIRS = include src tests examples stp doc contrib</span><br><span> </span><br><span> pkgconfigdir = $(libdir)/pkgconfig</span><br><span> pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc libosmo-sigtran.pc libosmo-xua.pc</span><br><span> </span><br><span> EXTRA_DIST = .version git-version-gen osmoappdesc.py doc/examples/osmo-stp.cfg</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 c0cc488..af64bc0 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -98,6 +98,21 @@</span><br><span> AC_PATH_PROG(DOXYGEN,doxygen,false)</span><br><span> AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "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%);">+     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>@@ -122,5 +137,7 @@</span><br><span>     stp/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>     Doxyfile</span><br><span>     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..e7d846f</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-stp.service</span><br><span style="color: hsl(120, 100%, 40%);">+systemdsystemunit_DATA = \</span><br><span style="color: hsl(120, 100%, 40%);">+  osmo-stp.service</span><br><span style="color: hsl(120, 100%, 40%);">+endif</span><br><span>diff --git a/debian/osmo-stp.install b/debian/osmo-stp.install</span><br><span>index b2f8077..2c250b0 100644</span><br><span>--- a/debian/osmo-stp.install</span><br><span>+++ b/debian/osmo-stp.install</span><br><span>@@ -1,2 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/lib/sytemd/system/osmo-stp.service</span><br><span> /usr/bin/osmo-stp</span><br><span> /usr/share/doc/libosmo-sccp/examples/osmo-stp/osmo-stp.cfg</span><br><span>diff --git a/debian/osmo-stp.service b/debian/osmo-stp.service</span><br><span>deleted file mode 120000</span><br><span>index 55f37c2..0000000</span><br><span>--- a/debian/osmo-stp.service</span><br><span>+++ /dev/null</span><br><span>@@ -1 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-../contrib/systemd/osmo-stp.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 bea0a76..c0c9f0c 100755</span><br><span>--- a/debian/rules</span><br><span>+++ b/debian/rules</span><br><span>@@ -24,7 +24,7 @@</span><br><span>       dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false)</span><br><span> </span><br><span> override_dh_auto_configure:</span><br><span style="color: hsl(0, 100%, 40%);">- dh_auto_configure -- --enable-static</span><br><span style="color: hsl(120, 100%, 40%);">+  dh_auto_configure -- --enable-static --with-systemdsystemunitdir=/lib/sytemd/system</span><br><span> </span><br><span> # Print test results in case of a failure</span><br><span> override_dh_auto_test:</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10843">change 10843</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/10843"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-sccp </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ie77ee4b32a75e2d207030ddc78d39fb664103d33 </div>
<div style="display:none"> Gerrit-Change-Number: 10843 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </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: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>