install D-BUS and systemd files.

This commit is contained in:
Nikos Mavrogiannopoulos
2014-01-08 16:46:58 +01:00
parent 55ecb6233f
commit 8485b727d5
4 changed files with 34 additions and 1 deletions

View File

@@ -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]),

View File

@@ -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/

View File

@@ -0,0 +1,14 @@
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy user="root">
<allow own="org.infradead.ocserv"/>
<allow send_destination="org.infradead.ocserv"/>
</policy>
<policy context="default">
<deny own="org.infradead.ocserv"/>
<deny send_destination="org.infradead.ocserv"/>
</policy>
</busconfig>

View File

@@ -0,0 +1,5 @@
[D-BUS Service]
Name=org.infradead.ocserv.service
Exec=/bin/false
User=root
SystemdService=ocserv-org.infradead.ocserv.service