summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Schmidt <philschmidt@gmx.net>2013-06-26 10:53:15 +0200
committerPhilipp Schmidt <philschmidt@gmx.net>2013-06-26 10:53:15 +0200
commit903ea5d96de75715327318fcf203f9d0218ec6ac (patch)
tree6effe2158ddbc8cfedb0faa80321b384d144073c
parentd4b28a885cdb3e44c633244a2a8cf16d30c8106f (diff)
downloadlibmtp-903ea5d96de75715327318fcf203f9d0218ec6ac.tar.gz
Initial skeleton for the DBus daemon by Philip Langdale
-rw-r--r--daemon/Makefile.am51
-rw-r--r--daemon/dbus-interface.xml31
-rw-r--r--daemon/mtpd.c27
-rw-r--r--daemon/mtpd.service.in0
4 files changed, 109 insertions, 0 deletions
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
new file mode 100644
index 0000000..bfc2a8f
--- /dev/null
+++ b/daemon/Makefile.am
@@ -0,0 +1,51 @@
+if BUILD_MTPD
+
+NULL =
+
+INCLUDES = \
+ -I$(top_builddir)/src \
+ $(GLIB_CFLAGS) \
+ $(NULL)
+
+libraries = \
+ $(top_builddir)/src/libmtp.la \
+ $(GLIB_LIBS) \
+ $(NULL)
+
+dbus_built_sources = mtp-dbus.c mtp-dbus.h
+BUILT_SOURCES = $(dbus_built_sources)
+
+$(dbus_built_sources) : Makefile.am dbus-interface.xml
+ $(AM_V_GEN) gdbus-codegen \
+ --interface-prefix org.libmtp. \
+ --c-namespace MTP \
+ --generate-c-code mtp-dbus \
+ $(srcdir)/dbus-interface.xml \
+ $(NULL)
+
+sbin_PROGRAMS = mtpd
+
+mtpd_SOURCES = mtpd.c
+mtpd_LDADD = $(libraries)
+
+# D-BUS service file
+%.service: %.service.in ../config.log
+ $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+
+servicedir = $(DBUS_SERVICE_DIR)
+service_in_files = mtpd.service.in
+service_DATA = mtpd.service
+
+EXTRA_DIST = \
+ mtpd.service.in \
+ dbus-interface.xml \
+ $(NULL)
+
+clean-local:
+ rm -f mtpd.service
+
+CLEANFILES = \
+ $(dbus_built_sources) \
+ $(NULL)
+
+endif
diff --git a/daemon/dbus-interface.xml b/daemon/dbus-interface.xml
new file mode 100644
index 0000000..dc5badb
--- /dev/null
+++ b/daemon/dbus-interface.xml
@@ -0,0 +1,31 @@
+<!DOCTYPE node PUBLIC
+"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+
+<!--
+ DBus Interface to libmtp
+
+ Copyright (C) 2013 Philip Langdale <philipl@overt.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General
+ Public License along with this library; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+-->
+
+<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
+ <interface name='org.libmtp'>
+
+ </interface>
+</node>
+
diff --git a/daemon/mtpd.c b/daemon/mtpd.c
new file mode 100644
index 0000000..7ff54e2
--- /dev/null
+++ b/daemon/mtpd.c
@@ -0,0 +1,27 @@
+/**
+ * \file mtpd.c
+ *
+ * Copyright (C) 2013 Philip Langdale <philipl@overt.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+
+int
+main (int argc, char *argv[])
+{
+ return 0;
+}
diff --git a/daemon/mtpd.service.in b/daemon/mtpd.service.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/daemon/mtpd.service.in