Change in openbsc[master]: Install systemd services with autotools

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Wed Sep 12 12:19:54 UTC 2018


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10902


Change subject: Install systemd services with autotools
......................................................................

Install systemd services with autotools

Change-Id: I9bc40cf9e9a901d28d1f1629f6f1d55e8ba0c0b6
---
M debian/osmo-bsc-mgcp.install
D debian/osmo-bsc-mgcp.service
M debian/osmocom-bsc-nat.install
D debian/osmocom-bsc-nat.service
M debian/osmocom-bsc-sccplite.install
D debian/osmocom-bsc-sccplite.service
M debian/osmocom-nitb.install
D debian/osmocom-nitb.service
M openbsc/Makefile.am
M openbsc/configure.ac
A openbsc/contrib/Makefile.am
A openbsc/contrib/systemd/Makefile.am
D openbsc/debian/osmo-bsc-mgcp.service
13 files changed, 42 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/02/10902/1

diff --git a/debian/osmo-bsc-mgcp.install b/debian/osmo-bsc-mgcp.install
index 1550437..828fb31 100644
--- a/debian/osmo-bsc-mgcp.install
+++ b/debian/osmo-bsc-mgcp.install
@@ -1 +1,2 @@
+lib/systemd/system/osmo-bsc-mgcp.service
 usr/bin/osmo-bsc_mgcp
diff --git a/debian/osmo-bsc-mgcp.service b/debian/osmo-bsc-mgcp.service
deleted file mode 120000
index 0f8700b..0000000
--- a/debian/osmo-bsc-mgcp.service
+++ /dev/null
@@ -1 +0,0 @@
-../openbsc/contrib/systemd/osmo-bsc-mgcp.service
\ No newline at end of file
diff --git a/debian/osmocom-bsc-nat.install b/debian/osmocom-bsc-nat.install
index b561a7e..d6cabe2 100644
--- a/debian/osmocom-bsc-nat.install
+++ b/debian/osmocom-bsc-nat.install
@@ -1 +1,2 @@
+/lib/systemd/system/osmo-bsc-nat.service
 /usr/bin/osmo-bsc_nat
diff --git a/debian/osmocom-bsc-nat.service b/debian/osmocom-bsc-nat.service
deleted file mode 120000
index 0d5b3be..0000000
--- a/debian/osmocom-bsc-nat.service
+++ /dev/null
@@ -1 +0,0 @@
-../openbsc/contrib/systemd/osmo-bsc-nat.service
\ No newline at end of file
diff --git a/debian/osmocom-bsc-sccplite.install b/debian/osmocom-bsc-sccplite.install
index 9ce795c..67c50cb 100644
--- a/debian/osmocom-bsc-sccplite.install
+++ b/debian/osmocom-bsc-sccplite.install
@@ -1,2 +1,2 @@
-/usr/bin/osmo-bsc_mgcp
+/lib/systemd/system/osmo-bsc-sccplite.service
 /usr/bin/osmo-bsc-sccplite
diff --git a/debian/osmocom-bsc-sccplite.service b/debian/osmocom-bsc-sccplite.service
deleted file mode 120000
index f30a9db..0000000
--- a/debian/osmocom-bsc-sccplite.service
+++ /dev/null
@@ -1 +0,0 @@
-../openbsc/contrib/systemd/osmo-bsc-sccplite.service
\ No newline at end of file
diff --git a/debian/osmocom-nitb.install b/debian/osmocom-nitb.install
index 26caf71..78e8f77 100644
--- a/debian/osmocom-nitb.install
+++ b/debian/osmocom-nitb.install
@@ -1,2 +1,3 @@
+/lib/systemd/system/osmo-nitb.service
 /usr/bin/osmo-nitb
-openbsc/contrib/*.py usr/bin/
\ No newline at end of file
+openbsc/contrib/*.py usr/bin/
diff --git a/debian/osmocom-nitb.service b/debian/osmocom-nitb.service
deleted file mode 120000
index eaecd9d..0000000
--- a/debian/osmocom-nitb.service
+++ /dev/null
@@ -1 +0,0 @@
-../openbsc/contrib/systemd/osmo-nitb.service
\ No newline at end of file
diff --git a/openbsc/Makefile.am b/openbsc/Makefile.am
index dc53929..792dcf2 100644
--- a/openbsc/Makefile.am
+++ b/openbsc/Makefile.am
@@ -13,6 +13,7 @@
 	include \
 	src \
 	tests \
+	contrib \
 	$(NULL)
 
 pkgconfigdir = $(libdir)/pkgconfig
@@ -21,6 +22,9 @@
 BUILT_SOURCES = $(top_srcdir)/.version
 EXTRA_DIST = git-version-gen osmoappdesc.py .version
 
+DISTCHECK_CONFIGURE_FLAGS = \
+	--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
+
 @RELMAKE@
 
 $(top_srcdir)/.version:
diff --git a/openbsc/configure.ac b/openbsc/configure.ac
index c3615d6..75dd5d3 100644
--- a/openbsc/configure.ac
+++ b/openbsc/configure.ac
@@ -220,6 +220,22 @@
 AC_MSG_RESULT([$enable_ext_tests])
 AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
 
+# 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([CFLAGS="$CFLAGS"])
 AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
 
@@ -262,4 +278,6 @@
     tests/nanobts_omlattr/Makefile
     doc/Makefile
     doc/examples/Makefile
+    contrib/Makefile
+    contrib/systemd/Makefile
     Makefile)
diff --git a/openbsc/contrib/Makefile.am b/openbsc/contrib/Makefile.am
new file mode 100644
index 0000000..3439c97
--- /dev/null
+++ b/openbsc/contrib/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = systemd
diff --git a/openbsc/contrib/systemd/Makefile.am b/openbsc/contrib/systemd/Makefile.am
new file mode 100644
index 0000000..69f973e
--- /dev/null
+++ b/openbsc/contrib/systemd/Makefile.am
@@ -0,0 +1,14 @@
+if HAVE_SYSTEMD
+SYSTEMD_SERVICES = osmo-nitb.service osmo-bsc-mgcp.service
+
+if BUILD_NAT
+SYSTEMD_SERVICES += osmo-bsc-nat.service
+endif
+
+if BUILD_BSC
+SYSTEMD_SERVICES += osmo-bsc-sccplite.service
+endif
+
+EXTRA_DIST = $(SYSTEMD_SERVICES)
+systemdsystemunit_DATA = $(SYSTEMD_SERVICES)
+endif # HAVE_SYSTEMD
diff --git a/openbsc/debian/osmo-bsc-mgcp.service b/openbsc/debian/osmo-bsc-mgcp.service
deleted file mode 120000
index eb73b7b..0000000
--- a/openbsc/debian/osmo-bsc-mgcp.service
+++ /dev/null
@@ -1 +0,0 @@
-../contrib/systemd/osmo-bsc-mgcp.service
\ No newline at end of file

-- 
To view, visit https://gerrit.osmocom.org/10902
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9bc40cf9e9a901d28d1f1629f6f1d55e8ba0c0b6
Gerrit-Change-Number: 10902
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180912/f13871d2/attachment.htm>


More information about the gerrit-log mailing list