Skip to content

Commit

Permalink
Move DBusBridge functionality into DBusIPCServerPrivate.
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen-Webb committed Jul 19, 2019
1 parent 480d38d commit aa97914
Show file tree
Hide file tree
Showing 9 changed files with 722 additions and 1,132 deletions.
57 changes: 15 additions & 42 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ libusbguard_la_SOURCES=\
src/Library/KeyValueParserPrivate.hpp \
src/Library/LocaltimeCondition.cpp \
src/Library/LocaltimeCondition.hpp \
src/Library/QBIPCServerPrivate.cpp \
src/Library/QBIPCServerPrivate.hpp \
src/Library/RandomStateCondition.cpp \
src/Library/RandomStateCondition.hpp \
src/Library/RuleAppliedCondition.cpp \
Expand Down Expand Up @@ -437,45 +439,33 @@ usbguard_rule_parser_LDADD=\
# DBus Bridge
#
if DBUS_ENABLED
sbin_PROGRAMS+= usbguard-dbus
libusbguard_la_SOURCES+= \
src/Library/DBusIPCServerPrivate.cpp \
src/Library/DBusIPCServerPrivate.hpp

libusbguard_la_CPPFLAGS+=\
-I$(top_builddir)/src/DBus \
@dbus_CFLAGS@

libusbguard_la_LIBADD+=\
@dbus_LIBS@

if DOCS_ENABLED
man8_MANS+=\
$(top_builddir)/doc/man/usbguard-dbus.8
endif

BUILT_SOURCES+=\
src/DBus/DBusInterface.xml.cstr \
src/DBus/org.usbguard.service \
src/DBus/usbguard-dbus.service
src/DBus/DBusInterface.xml.cstr

EXTRA_DIST+=\
src/DBus/org.usbguard.conf \
src/DBus/org.usbguard.service.in \
src/DBus/usbguard-dbus.service.in \
src/DBus/org.usbguard.policy \
src/DBus/DBusInterface.xml

CLEANFILES+=\
$(top_builddir)/src/DBus/org.usbguard.service \
$(top_builddir)/src/DBus/usbguard-dbus.service \
$(top_builddir)/src/DBus/DBusInterface.xml.cstr

usbguard_dbus_SOURCES=\
src/DBus/gdbus-server.cpp \
src/DBus/DBusBridge.cpp \
src/DBus/DBusBridge.hpp

usbguard_dbus_CPPFLAGS=\
-fPIE \
$(AM_CPPFLAGS) \
-I$(top_builddir)/src/DBus \
@dbus_CFLAGS@

usbguard_dbus_LDADD=\
$(top_builddir)/libusbguard.la \
@dbus_LIBS@

%.xml:
xmllint "$(top_srcdir)/$@" > /dev/null

Expand All @@ -486,15 +476,11 @@ usbguard_dbus_LDADD=\
%.service: %.service.in
sed -e "s|%{sbindir}%|$(sbindir)|" "$<" > "$(top_builddir)/$@"

install-data-dbus: $(top_builddir)/src/DBus/org.usbguard.service install-polkit-policy install-systemd-dbus-service
$(MKDIR_P) $(DESTDIR)$(DBUS_SERVICES_DIR) && \
$(INSTALL_DATA) $(top_builddir)/src/DBus/org.usbguard.service $(DESTDIR)$(DBUS_SERVICES_DIR)
install-data-dbus: $(top_builddir)/src/DBus/org.usbguard.service install-polkit-policy
$(MKDIR_P) $(DESTDIR)$(DBUS_BUSCONFIG_DIR) && \
$(INSTALL_DATA) $(top_srcdir)/src/DBus/org.usbguard.conf $(DESTDIR)$(DBUS_BUSCONFIG_DIR)

uninstall-data-dbus: uninstall-polkit-policy uninstall-systemd-dbus-service
rm -f $(DESTDIR)$(DBUS_SERVICES_DIR)/org.usbguard.service
rmdir $(DESTDIR)$(DBUS_SERVICES_DIR)
uninstall-data-dbus: uninstall-polkit-policy
rm -f $(DESTDIR)$(DBUS_BUSCONFIG_DIR)/org.usbguard.conf
rmdir $(DESTDIR)$(DBUS_BUSCONFIG_DIR)

Expand Down Expand Up @@ -529,19 +515,6 @@ install-polkit-policy:
uninstall-polkit-policy:
endif

if SYSTEMD_SUPPORT_ENABLED
install-systemd-dbus-service: $(top_builddir)/src/DBus/usbguard-dbus.service
$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) && \
$(INSTALL_DATA) $(top_builddir)/src/DBus/usbguard-dbus.service $(DESTDIR)$(SYSTEMD_UNIT_DIR)

uninstall-systemd-dbus-service:
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/usbguard-dbus.service
rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR)

else
install-systemd-dbus-service:
uninstall-systemd-dbus-service:
endif
else
install-data-dbus:
uninstall-data-dbus:
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ esac
#
# GLib D-Bus
#
AC_ARG_WITH([dbus], AC_HELP_STRING([--with-dbus], [Build the DBus Bridge service]), [], [with_dbus=yes])
AC_ARG_WITH([dbus], AC_HELP_STRING([--with-dbus], [Build with DBus support]), [], [with_dbus=yes])
if test "x$with_dbus" = xyes; then
#
# Check for required D-Bus modules
Expand Down
Loading

0 comments on commit aa97914

Please sign in to comment.