+SUBDIRS = src
+
MAINTAINERCLEANFILES = Makefile.in \
aclocal.m4 configure config.h.in config.sub config.guess \
ltmain.sh depcomp missing install-sh mkinstalldirs
AC_PROG_CC_PIE
AC_PROG_INSTALL
-AC_OUTPUT(Makefile)
+PKG_CHECK_MODULES(GDBUS, gdbus, dummy=yes,
+ AC_MSG_ERROR(libgdbus is required))
+AC_SUBST(GDBUS_CFLAGS)
+AC_SUBST(GDBUS_LIBS)
+
+AC_OUTPUT(Makefile src/Makefile)
--- /dev/null
+
+dbusdir = $(sysconfdir)/dbus-1/system.d
+
+dbus_DATA = connman.conf
+
+sbin_PROGRAMS = connmand
+
+connmand_SOURCES = main.c connman.h
+
+connmand_LDADD = @GDBUS_LIBS@
+
+AM_CFLAGS = @GDBUS_CFLAGS@
+
+EXTRA_DIST = $(dbus_DATA)
+
+MAINTAINERCLEANFILES = Makefile.in
--- /dev/null
+<!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.freedesktop.connman"/>
+ </policy>
+ <policy at_console="true">
+ <allow send_interface="org.freedesktop.connman"/>
+ <allow send_destination="org.freedesktop.connman"/>
+ </policy>
+</busconfig>
--- /dev/null
+/*
+ *
+ * Connection Manager
+ *
+ * Copyright (C) 2007 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#define CONNMAN_SERVICE "org.freedesktop.connman"
+
+#define CONNMAN_MANAGER_PATH "/"
+#define CONNMAN_MANAGER_INTERFACE CONNMAN_SERVICE ".Manager"
--- /dev/null
+/*
+ *
+ * Connection Manager
+ *
+ * Copyright (C) 2007 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+
+#include <gdbus.h>
+
+#include "connman.h"
+
+static GMainLoop *main_loop = NULL;
+
+static void sig_term(int sig)
+{
+ g_main_loop_quit(main_loop);
+}
+
+int main(int argc, char *argv[])
+{
+ DBusConnection *conn;
+ struct sigaction sa;
+
+ main_loop = g_main_loop_new(NULL, FALSE);
+
+ conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, CONNMAN_SERVICE);
+ if (conn == NULL) {
+ fprintf(stderr, "Can't register with system bus\n");
+ exit(1);
+ }
+
+ g_dbus_register_object(conn, CONNMAN_MANAGER_PATH, NULL, NULL);
+
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler = sig_term;
+ sigaction(SIGINT, &sa, NULL);
+ sigaction(SIGTERM, &sa, NULL);
+
+ g_main_loop_run(main_loop);
+
+ g_dbus_unregister_object(conn, CONNMAN_MANAGER_PATH);
+
+ g_dbus_cleanup_connection(conn);
+
+ g_main_loop_unref(main_loop);
+
+ return 0;
+}