diff --git a/configure.ac b/configure.ac index 43d83938..e2cd0681 100644 --- a/configure.ac +++ b/configure.ac @@ -55,6 +55,13 @@ AC_DEFINE([HAVE_DBUS], [], [dbus detected]), AM_CONDITIONAL(HAVE_DBUS, test "x$dbus_enabled" != xno) +if test "x$dbus_enabled" != xno;then +dbus_services_dir=$($PKG_CONFIG dbus-1 --variable=system_bus_services_dir) +AC_SUBST(DBUS_SERVICES_DIR, [$dbus_services_dir]) +dbus_conf_dir=$($PKG_CONFIG dbus-1 --variable=sysconfdir) +AC_SUBST(DBUS_CONFIG_DIR, [$dbus_conf_dir/etc/dbus-1/system.d/]) +fi + PKG_CHECK_MODULES([LIBPROTOBUF_C], [libprotobuf-c],, AC_CHECK_LIB(protobuf-c, [protobuf_c_message_pack], AC_SUBST(LIBPROTOBUF_C_LIBS, [-lprotobuf-c]), diff --git a/doc/Makefile.am b/doc/Makefile.am index 263f6bc3..f0bc9017 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,5 +1,6 @@ EXTRA_DIST = design.dia sample.config scripts/ocserv-script sample.passwd \ - systemd/ocserv.service systemd/ocserv.socket + systemd/ocserv.service systemd/ocserv.socket \ + dbus/org.infradead.ocserv.conf dist_man_MANS = ocserv.8 ocpasswd.8 @@ -12,3 +13,9 @@ ocpasswd.8: ../src/ocpasswd-args.def -sed 's/@subheading \(.*\)/@*\n@var{\1}\n@*/' $< > "$<".tmp && \ @AUTOGEN@ -L../src -DMAN_SECTION=8 -Tagman-cmd.tpl "$<".tmp && \ rm -f "$<".tmp + +install-data-local: + test -d "$(DBUS_SERVICES_DIR)" && $(INSTALL_DATA) dbus/org.infradead.ocserv.service $(DBUS_SERVICES_DIR) + test -d "$(DBUS_CONFIG_DIR)" && $(INSTALL_DATA) dbus/org.infradead.ocserv.conf $(DBUS_CONFIG_DIR) + test -d "/usr/lib/systemd/system/" && $(INSTALL_DATA) systemd/ocserv.service /usr/lib/systemd/system/ + test -d "/usr/lib/systemd/system/" && $(INSTALL_DATA) systemd/ocserv.socket /usr/lib/systemd/system/ diff --git a/doc/dbus/org.infradead.ocserv.conf b/doc/dbus/org.infradead.ocserv.conf new file mode 100644 index 00000000..8c69f939 --- /dev/null +++ b/doc/dbus/org.infradead.ocserv.conf @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/doc/dbus/org.infradead.ocserv.service b/doc/dbus/org.infradead.ocserv.service new file mode 100644 index 00000000..acf77a58 --- /dev/null +++ b/doc/dbus/org.infradead.ocserv.service @@ -0,0 +1,5 @@ +[D-BUS Service] +Name=org.infradead.ocserv.service +Exec=/bin/false +User=root +SystemdService=ocserv-org.infradead.ocserv.service