Change in osmo-msc[master]: Install systemd services with autotools

2018-09-13 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10896 )

Change subject: Install systemd services with autotools
..

Install systemd services with autotools

Change-Id: I3a87d5ad4cb43efdcfc25828144f825f4d3b1594
---
M Makefile.am
M configure.ac
A contrib/Makefile.am
A contrib/systemd/Makefile.am
M debian/osmo-msc.install
D debian/osmo-msc.service
M debian/rules
7 files changed, 31 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Pau Espin Pedrol: Verified



diff --git a/Makefile.am b/Makefile.am
index 2f0a786..9f3644f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,12 +12,16 @@
doc \
include \
src \
+   contrib \
tests \
$(NULL)

 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/configure.ac b/configure.ac
index 03acc0c..2d8dc42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,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"])

@@ -203,4 +219,6 @@
 tests/msc_vlr/Makefile
 doc/Makefile
 doc/examples/Makefile
+contrib/Makefile
+contrib/systemd/Makefile
 Makefile)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
new file mode 100644
index 000..3439c97
--- /dev/null
+++ b/contrib/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = systemd
diff --git a/contrib/systemd/Makefile.am b/contrib/systemd/Makefile.am
new file mode 100644
index 000..8648172
--- /dev/null
+++ b/contrib/systemd/Makefile.am
@@ -0,0 +1,5 @@
+if HAVE_SYSTEMD
+EXTRA_DIST = osmo-msc.service
+systemdsystemunit_DATA = \
+  osmo-msc.service
+endif
diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install
index 6b84b8f..1e7f22f 100644
--- a/debian/osmo-msc.install
+++ b/debian/osmo-msc.install
@@ -1,3 +1,4 @@
+lib/systemd/system/osmo-msc.service
 usr/bin/osmo-msc
 usr/share/doc/osmo-msc/examples/osmo-msc/osmo-msc.cfg 
usr/share/doc/osmo-msc/examples
 usr/share/doc/osmo-msc/examples/osmo-msc/osmo-msc_custom-sccp.cfg 
usr/share/doc/osmo-msc/examples
diff --git a/debian/osmo-msc.service b/debian/osmo-msc.service
deleted file mode 12
index 784b8b5..000
--- a/debian/osmo-msc.service
+++ /dev/null
@@ -1 +0,0 @@
-../contrib/systemd/osmo-msc.service
\ No newline at end of file
diff --git a/debian/rules b/debian/rules
index 15e79da..1cf3a35 100755
--- a/debian/rules
+++ b/debian/rules
@@ -42,11 +42,11 @@

 # main packaging script based on dh7 syntax
 %:
-   dh $@ --with autoreconf
+   dh $@ --with autoreconf

 # debmake generated override targets
 # Set options for ./configure
-CONFIGURE_FLAGS += --enable-iu --enable-smpp
+CONFIGURE_FLAGS += --enable-iu --enable-smpp 
--with-systemdsystemunitdir=/lib/systemd/system
 override_dh_auto_configure:
dh_auto_configure -- $(CONFIGURE_FLAGS)
 #

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3a87d5ad4cb43efdcfc25828144f825f4d3b1594
Gerrit-Change-Number: 10896
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-msc[master]: Install systemd services with autotools

2018-09-13 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/10896 )

Change subject: Install systemd services with autotools
..


Patch Set 1: Verified+1


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3a87d5ad4cb43efdcfc25828144f825f4d3b1594
Gerrit-Change-Number: 10896
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Thu, 13 Sep 2018 13:59:09 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: Install systemd services with autotools

2018-09-13 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10896 )

Change subject: Install systemd services with autotools
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3a87d5ad4cb43efdcfc25828144f825f4d3b1594
Gerrit-Change-Number: 10896
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Comment-Date: Thu, 13 Sep 2018 13:58:23 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: Install systemd services with autotools

2018-09-12 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/10896


Change subject: Install systemd services with autotools
..

Install systemd services with autotools

Change-Id: I3a87d5ad4cb43efdcfc25828144f825f4d3b1594
---
M Makefile.am
M configure.ac
A contrib/Makefile.am
A contrib/systemd/Makefile.am
M debian/osmo-msc.install
D debian/osmo-msc.service
M debian/rules
7 files changed, 31 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/10896/1

diff --git a/Makefile.am b/Makefile.am
index 2f0a786..9f3644f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,12 +12,16 @@
doc \
include \
src \
+   contrib \
tests \
$(NULL)

 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/configure.ac b/configure.ac
index 03acc0c..2d8dc42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,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"])

@@ -203,4 +219,6 @@
 tests/msc_vlr/Makefile
 doc/Makefile
 doc/examples/Makefile
+contrib/Makefile
+contrib/systemd/Makefile
 Makefile)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
new file mode 100644
index 000..3439c97
--- /dev/null
+++ b/contrib/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = systemd
diff --git a/contrib/systemd/Makefile.am b/contrib/systemd/Makefile.am
new file mode 100644
index 000..8648172
--- /dev/null
+++ b/contrib/systemd/Makefile.am
@@ -0,0 +1,5 @@
+if HAVE_SYSTEMD
+EXTRA_DIST = osmo-msc.service
+systemdsystemunit_DATA = \
+  osmo-msc.service
+endif
diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install
index 6b84b8f..1e7f22f 100644
--- a/debian/osmo-msc.install
+++ b/debian/osmo-msc.install
@@ -1,3 +1,4 @@
+lib/systemd/system/osmo-msc.service
 usr/bin/osmo-msc
 usr/share/doc/osmo-msc/examples/osmo-msc/osmo-msc.cfg 
usr/share/doc/osmo-msc/examples
 usr/share/doc/osmo-msc/examples/osmo-msc/osmo-msc_custom-sccp.cfg 
usr/share/doc/osmo-msc/examples
diff --git a/debian/osmo-msc.service b/debian/osmo-msc.service
deleted file mode 12
index 784b8b5..000
--- a/debian/osmo-msc.service
+++ /dev/null
@@ -1 +0,0 @@
-../contrib/systemd/osmo-msc.service
\ No newline at end of file
diff --git a/debian/rules b/debian/rules
index 15e79da..1cf3a35 100755
--- a/debian/rules
+++ b/debian/rules
@@ -42,11 +42,11 @@

 # main packaging script based on dh7 syntax
 %:
-   dh $@ --with autoreconf
+   dh $@ --with autoreconf

 # debmake generated override targets
 # Set options for ./configure
-CONFIGURE_FLAGS += --enable-iu --enable-smpp
+CONFIGURE_FLAGS += --enable-iu --enable-smpp 
--with-systemdsystemunitdir=/lib/systemd/system
 override_dh_auto_configure:
dh_auto_configure -- $(CONFIGURE_FLAGS)
 #

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a87d5ad4cb43efdcfc25828144f825f4d3b1594
Gerrit-Change-Number: 10896
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol