Add skeleton for PolicyKit plugin
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 12 Aug 2008 22:49:21 +0000 (00:49 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 12 Aug 2008 22:49:21 +0000 (00:49 +0200)
configure.ac
plugins/Makefile.am
plugins/polkit.c [new file with mode: 0644]

index c9534a2..096711f 100644 (file)
@@ -77,6 +77,7 @@ AM_CONDITIONAL(HAL, test "${hal_found}" = "yes")
 PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, polkit_found=yes, polkit_found=no)
 AC_SUBST(POLKIT_CFLAGS)
 AC_SUBST(POLKIT_LIBS)
+AM_CONDITIONAL(POLKIT, test "${polkit_found}" = "yes")
 
 PKG_CHECK_MODULES(SQLITE, sqlite3, sqlite_found=yes, sqlite_found=no)
 AC_SUBST(SQLITE_CFLAGS)
index 2358d33..96b59b3 100644 (file)
@@ -4,14 +4,6 @@ plugindir = $(libdir)/connman/plugins
 plugin_LTLIBRARIES = rtnllink.la ethernet.la wifi.la bluetooth.la \
                        dhclient.la ipv4.la resolvconf.la resolvfile.la
 
-if HAL
-plugin_LTLIBRARIES += hal.la
-
-hal_la_SOURCES = hal.c
-hal_la_LIBADD = @HAL_LIBS@
-hal_la_CFLAGS = @GLIB_CFLAGS@ @HAL_CFLAGS@
-endif
-
 rtnllink_la_SOURCES = rtnllink.c
 
 ethernet_la_SOURCES = ethernet.c
@@ -30,6 +22,22 @@ resolvconf_la_SOURCES = resolvconf.c
 
 resolvfile_la_SOURCES = resolvfile.c
 
+if HAL
+plugin_LTLIBRARIES += hal.la
+
+hal_la_SOURCES = hal.c
+hal_la_LIBADD = @HAL_LIBS@
+hal_la_CFLAGS = @GLIB_CFLAGS@ @HAL_CFLAGS@
+endif
+
+if POLKIT
+plugin_LTLIBRARIES += polkit.la
+
+polkit_la_SOURCES = polkit.c
+polkit_la_LIBADD = @POLKIT_LIBS@
+polkit_la_CFLAGS = @GLIB_CFLAGS@ @POLKIT_CFLAGS@
+endif
+
 AM_LDFLAGS = -no-undefined -module -avoid-version \
                                -export-symbols-regex connman_plugin_desc
 
diff --git a/plugins/polkit.c b/plugins/polkit.c
new file mode 100644 (file)
index 0000000..76e6452
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ *
+ *  Connection Manager
+ *
+ *  Copyright (C) 2007-2008  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 <connman/plugin.h>
+#include <connman/log.h>
+
+static int polkit_init(void)
+{
+       return 0;
+}
+
+static void polkit_exit(void)
+{
+}
+
+CONNMAN_PLUGIN_DEFINE("polkit", "PolicyKit authorization plugin", VERSION,
+                                               polkit_init, polkit_exit)