<p>Pau Espin Pedrol has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10899">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Install systemd services with autotools<br><br>Change-Id: Ie4c7e81495181059d1dff1c194d52d11fb72ed03<br>---<br>M Makefile.am<br>M configure.ac<br>A contrib/Makefile.am<br>A contrib/systemd/Makefile.am<br>R contrib/systemd/osmo-pcu.service<br>M debian/osmo-pcu.install<br>D debian/osmo-pcu.service<br>M debian/rules<br>8 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-pcu refs/changes/99/10899/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 7a4e6c0..240e4ee 100644</span><br><span>--- a/Makefile.am</span><br><span>+++ b/Makefile.am</span><br><span>@@ -1,8 +1,11 @@</span><br><span> AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-SUBDIRS = include src examples tests</span><br><span style="color: hsl(120, 100%, 40%);">+SUBDIRS = include src examples tests contrib</span><br><span> EXTRA_DIST = osmoappdesc.py 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> pkgconfigdir = $(libdir)/pkgconfig</span><br><span>diff --git a/configure.ac b/configure.ac</span><br><span>index 7288c24..90394e1 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -157,6 +157,22 @@</span><br><span> STD_DEFINES_AND_INCLUDES="-Wall"</span><br><span> AC_SUBST(STD_DEFINES_AND_INCLUDES)</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([CPPFLAGS="$CPPFLAGS"])</span><br><span> AC_MSG_RESULT([CFLAGS="$CFLAGS"])</span><br><span> AC_MSG_RESULT([CXXFLAGS="$CXXFLAGS"])</span><br><span>@@ -168,4 +184,6 @@</span><br><span>     src/Makefile</span><br><span>     examples/Makefile</span><br><span>     tests/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>     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..f565234</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-pcu.service</span><br><span style="color: hsl(120, 100%, 40%);">+systemdsystemunit_DATA = \</span><br><span style="color: hsl(120, 100%, 40%);">+  osmo-pcu.service</span><br><span style="color: hsl(120, 100%, 40%);">+endif</span><br><span>diff --git a/contrib/osmo-pcu.service b/contrib/systemd/osmo-pcu.service</span><br><span>similarity index 100%</span><br><span>rename from contrib/osmo-pcu.service</span><br><span>rename to contrib/systemd/osmo-pcu.service</span><br><span>diff --git a/debian/osmo-pcu.install b/debian/osmo-pcu.install</span><br><span>index 80316ee..1b82e96 100644</span><br><span>--- a/debian/osmo-pcu.install</span><br><span>+++ b/debian/osmo-pcu.install</span><br><span>@@ -1,4 +1,5 @@</span><br><span> etc/osmocom/osmo-pcu.cfg</span><br><span style="color: hsl(120, 100%, 40%);">+lib/systemd/system/osmo-pcu.service</span><br><span> usr/bin/osmo-pcu</span><br><span> usr/include/osmocom/pcu/pcuif_proto.h</span><br><span> usr/lib/*/pkgconfig/osmo-pcu.pc</span><br><span>diff --git a/debian/osmo-pcu.service b/debian/osmo-pcu.service</span><br><span>deleted file mode 120000</span><br><span>index f077431..0000000</span><br><span>--- a/debian/osmo-pcu.service</span><br><span>+++ /dev/null</span><br><span>@@ -1 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-../contrib/osmo-pcu.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 cffb6ca..712dd75 100755</span><br><span>--- a/debian/rules</span><br><span>+++ b/debian/rules</span><br><span>@@ -22,3 +22,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/10899">change 10899</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/10899"/><meta itemprop="name" content="View Change"/></div></div>

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