From 5190ffa41272e449e6bb6d38cd98cff576d9b4b9 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Tue, 30 Jul 2013 01:52:52 +0200 Subject: Add support for Apache HTTPD 2.4 --- data/Makefile.am | 2 +- data/dav_user_2.2.conf | 2 +- data/dav_user_2.4.conf | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 data/dav_user_2.4.conf diff --git a/data/Makefile.am b/data/Makefile.am index 953fa83..85367cb 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -10,7 +10,7 @@ autostart_DATA = $(autostart_in_files:.desktop.in=.desktop) autostart_in_files = mate-user-share.desktop.in appdir = $(datadir)/mate-user-share -app_DATA=dav_user_2.0.conf dav_user_2.2.conf dav_groupfile file-share-properties.ui +app_DATA=dav_user_2.0.conf dav_user_2.2.conf dav_user_2.4.conf dav_groupfile file-share-properties.ui gsettings_SCHEMAS = org.mate.FileSharing.gschema.xml @GSETTINGS_RULES@ diff --git a/data/dav_user_2.2.conf b/data/dav_user_2.2.conf index f38d9ee..785aeab 100644 --- a/data/dav_user_2.2.conf +++ b/data/dav_user_2.2.conf @@ -31,7 +31,7 @@ DNSSDAutoRegisterUserDir Off AuthDigestProvider file AuthUserFile ${XDG_CONFIG_HOME}/user-share/passwd - AuthGroupFile /usr/share/gnome-user-share/dav_groupfile + AuthGroupFile /usr/share/mate-user-share/dav_groupfile Require user guest diff --git a/data/dav_user_2.4.conf b/data/dav_user_2.4.conf new file mode 100644 index 0000000..c7a88a1 --- /dev/null +++ b/data/dav_user_2.4.conf @@ -0,0 +1,78 @@ +ServerRoot ${XDG_CONFIG_HOME}/user-share +DefaultRuntimeDir ${XDG_CONFIG_HOME}/user-share +PidFile pid +LogLevel crit +#LogLevel info +ErrorLog log +DAVLockDB lock + +LimitXMLRequestBody 100000 + +LoadModule unixd_module ${HTTP_MODULES_PATH}/mod_unixd.so +LoadModule mpm_prefork_module ${HTTP_MODULES_PATH}/mod_mpm_prefork.so +LoadModule dav_module ${HTTP_MODULES_PATH}/mod_dav.so +LoadModule dav_fs_module ${HTTP_MODULES_PATH}/mod_dav_fs.so +LoadModule authn_core_module ${HTTP_MODULES_PATH}/mod_authn_core.so +LoadModule authn_file_module ${HTTP_MODULES_PATH}/mod_authn_file.so +LoadModule auth_digest_module ${HTTP_MODULES_PATH}/mod_auth_digest.so +LoadModule authz_core_module ${HTTP_MODULES_PATH}/mod_authz_core.so +LoadModule authz_user_module ${HTTP_MODULES_PATH}/mod_authz_user.so +LoadModule authz_groupfile_module ${HTTP_MODULES_PATH}/mod_authz_groupfile.so +LoadModule dnssd_module ${HTTP_MODULES_PATH}/mod_dnssd.so + +DNSSDEnable on +DNSSDAutoRegisterVHosts Off +DNSSDAutoRegisterUserDir Off + + + DocumentRoot ${XDG_PUBLICSHARE_DIR} + + + DAV On + + AuthType Digest + AuthName "${GUS_LOGIN_LABEL}" + AuthDigestDomain / + + AuthDigestProvider file + AuthUserFile ${XDG_CONFIG_HOME}/user-share/passwd + AuthGroupFile /usr/share/mate-user-share/dav_groupfile + + + Require user guest + Require group guest + + + + + Require user guest + Require group guest + + + + DNSSDServiceName "${GUS_SHARE_NAME}" + DNSSDServiceTypes _webdav._tcp + DNSSDServiceTxtRecord u=guest + + + +StartServers 1 +MaxClients 3 + + + MinSpareServers 1 + MaxSpareServers 1 + + + + MinSpareThreads 1 + MaxSpareThreads 1 + ThreadsPerChild 3 + + + + MinSpareThreads 1 + MaxSpareThreads 1 + ThreadsPerChild 3 + + -- cgit v1.2.1 From 21f1837929f4e7416ffac87c019e96baef7a8cc0 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Tue, 30 Jul 2013 12:19:04 +0200 Subject: Use mate-session to track the active session --- configure.ac | 2 +- src/user_share.c | 178 +++++++++++++++++-------------------------------------- 2 files changed, 54 insertions(+), 126 deletions(-) diff --git a/configure.ac b/configure.ac index de9b590..9db592b 100644 --- a/configure.ac +++ b/configure.ac @@ -56,7 +56,7 @@ if $have_dbus_1_1 ; then AC_DEFINE(HAVE_DBUS_1_1, 1, [Set to true if we have D-BUS 1.1]) fi -PKG_CHECK_MODULES(USER_SHARE, glib-2.0 >= 2.15.2 gio-2.0 >= 2.25.0 gdk-x11-2.0 gtk+-2.0 dbus-glib-1 libnotify >= 0.7.0 libcanberra-gtk $DBUS_MODULES) +PKG_CHECK_MODULES(USER_SHARE, glib-2.0 >= 2.15.2 gio-2.0 >= 2.26 gdk-x11-2.0 gtk+-2.0 dbus-glib-1 libnotify >= 0.7.0 libcanberra-gtk $DBUS_MODULES) AC_SUBST(USER_SHARE_CFLAGS) AC_SUBST(USER_SHARE_LIBS) diff --git a/src/user_share.c b/src/user_share.c index 53ceec1..d33cd67 100644 --- a/src/user_share.c +++ b/src/user_share.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include "user_share.h" @@ -61,14 +62,12 @@ static GSettings* settings; #define GSETTINGS_KEY_FILE_SHARING_REQUIRE_PASSWORD "require-password" #ifdef HAVE_BLUETOOTH -/* ConsoleKit */ -#define CK_NAME "org.freedesktop.ConsoleKit" -#define CK_INTERFACE "org.freedesktop.ConsoleKit" -#define CK_MANAGER_PATH "/org/freedesktop/ConsoleKit/Manager" -#define CK_MANAGER_INTERFACE "org.freedesktop.ConsoleKit.Manager" -#define CK_SEAT_INTERFACE "org.freedesktop.ConsoleKit.Seat" -#define CK_SESSION_INTERFACE "org.freedesktop.ConsoleKit.Session" +/* MATE Session */ +#define MATE_SESSION_DBUS_NAME "org.mate.SessionManager" +#define MATE_SESSION_DBUS_OBJECT "/org/mate/SessionManager" +#define MATE_SESSION_DBUS_INTERFACE "org.mate.SessionManager" +static GDBusProxy *session_proxy = NULL; static gboolean has_console = TRUE; static BluetoothClient *client = NULL; @@ -113,136 +112,65 @@ obex_services_shutdown (void) } static void -sessionchanged_cb (void) +session_properties_changed_cb (GDBusProxy *session, + GVariant *changed, + char **invalidated, + gpointer user_data) { - DBusGConnection *dbus_connection; - DBusGProxy *proxy_ck_manager; - DBusGProxy *proxy_ck_session; + GVariant *v; - gchar *ck_session_path; - gboolean is_active = FALSE; - GError *error = NULL; + v = g_variant_lookup_value (changed, "SessionIsActive", G_VARIANT_TYPE_BOOLEAN); + if (v) { + has_console = g_variant_get_boolean (v); + g_debug ("Received session is active change: now %s", has_console ? "active" : "inactive"); - g_message ("Active session changed"); + if (has_console) + obex_services_start (); + else + obex_services_shutdown (); - dbus_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); - if (!dbus_connection) { - g_warning ("Unable to connect to dbus"); - dbus_g_connection_unref (dbus_connection); - return; - } - - proxy_ck_manager = dbus_g_proxy_new_for_name (dbus_connection, - CK_NAME, - CK_MANAGER_PATH, - CK_MANAGER_INTERFACE); - if (dbus_g_proxy_call (proxy_ck_manager, "GetCurrentSession", - &error, G_TYPE_INVALID, - DBUS_TYPE_G_OBJECT_PATH, &ck_session_path, - G_TYPE_INVALID) == FALSE) { - g_warning ("Couldn't request the name: %s", error->message); - dbus_g_connection_unref (dbus_connection); - g_object_unref (proxy_ck_manager); - g_error_free (error); - return; - } - - proxy_ck_session = dbus_g_proxy_new_for_name (dbus_connection, - CK_NAME, - ck_session_path, - CK_SESSION_INTERFACE); - - if (dbus_g_proxy_call (proxy_ck_session, "IsActive", - &error, G_TYPE_INVALID, - G_TYPE_BOOLEAN, &is_active, - G_TYPE_INVALID) == FALSE) { - - g_warning ("Couldn't request the name: %s", error->message); - dbus_g_connection_unref (dbus_connection); - g_object_unref (proxy_ck_manager); - g_object_unref (proxy_ck_session); - g_error_free (error); - return; - } - - has_console = is_active; - if (is_active) { - obex_services_start (); - } else { - obex_services_shutdown (); + g_variant_unref (v); } +} - dbus_g_connection_unref (dbus_connection); - g_free (ck_session_path); - g_object_unref (proxy_ck_manager); - g_object_unref (proxy_ck_session); - if (error != NULL) { - g_error_free (error); - } +static gboolean +is_session_active (void) +{ + GVariant *variant; + gboolean is_session_active = FALSE; + + variant = g_dbus_proxy_get_cached_property (session_proxy, + "SessionIsActive"); + if (variant) { + is_session_active = g_variant_get_boolean (variant); + g_variant_unref (variant); + } + + return is_session_active; } static void -consolekit_init (void) +session_init (void) { - DBusGConnection *dbus_connection; - DBusGProxy *proxy_ck_manager; - DBusGProxy *proxy_ck_session; - DBusGProxy *proxy_ck_seat; - gchar *ck_session_path; - gchar *ck_seat_path; GError *error = NULL; - dbus_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL); - - if (!dbus_connection) { - g_warning ("Unable to connect to dbus"); - dbus_g_connection_unref (dbus_connection); - return; - } - - proxy_ck_manager = dbus_g_proxy_new_for_name (dbus_connection, - CK_NAME, - CK_MANAGER_PATH, - CK_MANAGER_INTERFACE); - if (dbus_g_proxy_call (proxy_ck_manager, "GetCurrentSession", - &error, G_TYPE_INVALID, - DBUS_TYPE_G_OBJECT_PATH, &ck_session_path, - G_TYPE_INVALID) == FALSE) { - - g_warning ("Couldn't request the name: %s", error->message); - g_object_unref (proxy_ck_manager); - return; - } - - proxy_ck_session = dbus_g_proxy_new_for_name (dbus_connection, - CK_NAME, - ck_session_path, - CK_SESSION_INTERFACE); - if (dbus_g_proxy_call (proxy_ck_session, "GetSeatId", - &error, G_TYPE_INVALID, - DBUS_TYPE_G_OBJECT_PATH, &ck_seat_path, - G_TYPE_INVALID) == FALSE) { - - g_warning ("Couldn't request the name: %s", error->message); - g_object_unref (proxy_ck_session); - return; - } - - proxy_ck_seat = dbus_g_proxy_new_for_name (dbus_connection, - CK_NAME, - ck_seat_path, - CK_SEAT_INTERFACE); - dbus_g_proxy_add_signal (proxy_ck_seat, "ActiveSessionChanged", - G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (proxy_ck_seat, "ActiveSessionChanged", - G_CALLBACK (sessionchanged_cb), NULL, NULL); - if (error != NULL) { - g_error_free (error); + session_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, + G_DBUS_PROXY_FLAGS_NONE, + NULL, + MATE_SESSION_DBUS_NAME, + MATE_SESSION_DBUS_OBJECT, + MATE_SESSION_DBUS_INTERFACE, + NULL, + &error); + if (session_proxy == NULL) { + g_warning ("Failed to get session proxy: %s", error->message); + g_error_free (error); + return; } - g_object_unref (proxy_ck_manager); - g_object_unref (proxy_ck_session); - g_free (ck_seat_path); - dbus_g_connection_unref (dbus_connection); + g_signal_connect (session_proxy, "g-properties-changed", + G_CALLBACK (session_properties_changed_cb), + NULL); + has_console = is_session_active (); } static void @@ -549,7 +477,7 @@ main (int argc, char **argv) G_CALLBACK (file_sharing_bluetooth_obexpush_notify_changed), NULL); bluez_init (); - consolekit_init (); + session_init (); #endif /* HAVE_BLUETOOTH */ /* Initial setting */ -- cgit v1.2.1 From 5f09ce6843a1d1a96db95a1d9fe487d4a2afb4d7 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Tue, 30 Jul 2013 16:10:58 +0200 Subject: Require dbus >= 1.1.1 --- configure.ac | 8 +------- src/http.c | 9 --------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 9db592b..5450ed6 100644 --- a/configure.ac +++ b/configure.ac @@ -50,13 +50,7 @@ fi AC_SUBST(HTTPD) -PKG_CHECK_EXISTS(dbus-1 >= 1.1.1, have_dbus_1_1=true, have_dbus_1_1=false) -if $have_dbus_1_1 ; then - DBUS_MODULES=dbus-1 - AC_DEFINE(HAVE_DBUS_1_1, 1, [Set to true if we have D-BUS 1.1]) -fi - -PKG_CHECK_MODULES(USER_SHARE, glib-2.0 >= 2.15.2 gio-2.0 >= 2.26 gdk-x11-2.0 gtk+-2.0 dbus-glib-1 libnotify >= 0.7.0 libcanberra-gtk $DBUS_MODULES) +PKG_CHECK_MODULES(USER_SHARE, glib-2.0 >= 2.15.2 gio-2.0 >= 2.26 gdk-x11-2.0 gtk+-2.0 dbus-1 >= 1.1.1 dbus-glib-1 libnotify >= 0.7.0 libcanberra-gtk $DBUS_MODULES) AC_SUBST(USER_SHARE_CFLAGS) AC_SUBST(USER_SHARE_LIBS) diff --git a/src/http.c b/src/http.c index c07a202..13b11eb 100644 --- a/src/http.c +++ b/src/http.c @@ -26,10 +26,7 @@ #include #include #include - -#ifdef HAVE_DBUS_1_1 #include -#endif #include @@ -57,9 +54,7 @@ #define GSETTINGS_SCHEMA "org.mate.FileSharing" -#ifdef HAVE_DBUS_1_1 static char *dbus_session_id; -#endif static pid_t httpd_pid = 0; @@ -155,7 +150,6 @@ get_share_name (void) return name; } -#ifdef HAVE_DBUS_1_1 static void init_dbus() { /* The only use we make of D-BUS is to fetch the session BUS ID so we can export @@ -190,7 +184,6 @@ init_dbus() { dbus_connection_close(connection); dbus_connection_unref(connection); } -#endif static void ensure_conf_dir (void) @@ -470,9 +463,7 @@ http_down (void) gboolean http_init (void) { -#ifdef HAVE_DBUS_1_1 init_dbus(); -#endif return TRUE; } -- cgit v1.2.1 From cf632626d056a8a221c0295c62aa5509d3484172 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Wed, 21 Aug 2013 22:41:35 +0200 Subject: Fix turning on sharing not starting mate-user-share --- configure.ac | 4 +++- data/Makefile.am | 6 ++++-- data/mate-user-share.desktop.in.in | 9 --------- po/POTFILES.in | 4 +++- po/POTFILES.skip | 4 +++- 5 files changed, 13 insertions(+), 14 deletions(-) delete mode 100644 data/mate-user-share.desktop.in.in diff --git a/configure.ac b/configure.ac index 5450ed6..93c00a9 100644 --- a/configure.ac +++ b/configure.ac @@ -199,7 +199,9 @@ data/icons/16x16/Makefile data/icons/22x22/Makefile data/icons/32x32/Makefile data/icons/48x48/Makefile -data/mate-user-share.desktop.in +data/mate-user-share-webdav.desktop.in +data/mate-user-share-obexftp.desktop.in +data/mate-user-share-obexpush.desktop.in po/Makefile.in src/Makefile man/Makefile diff --git a/data/Makefile.am b/data/Makefile.am index 85367cb..665cf93 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -7,7 +7,7 @@ desktop_in_files = mate-user-share-properties.desktop.in autostartdir = $(sysconfdir)/xdg/autostart/ autostart_DATA = $(autostart_in_files:.desktop.in=.desktop) -autostart_in_files = mate-user-share.desktop.in +autostart_in_files = mate-user-share-obexftp.desktop.in mate-user-share-obexpush.desktop.in mate-user-share-webdav.desktop.in appdir = $(datadir)/mate-user-share app_DATA=dav_user_2.0.conf dav_user_2.2.conf dav_user_2.4.conf dav_groupfile file-share-properties.ui @@ -21,7 +21,9 @@ convert_DATA = mate-user-share.convert EXTRA_DIST = $(gsettings_SCHEMAS) \ $(app_DATA) \ $(desktop_in_files) \ - mate-user-share.desktop.in.in \ + mate-user-share-obexftp.desktop.in.in \ + mate-user-share-obexpush.desktop.in.in \ + mate-user-share-webdav.desktop.in.in \ file-share-properties.ui CLEANFILES = $(desktop_DATA) $(autostart_DATA) diff --git a/data/mate-user-share.desktop.in.in b/data/mate-user-share.desktop.in.in deleted file mode 100644 index 39fe98c..0000000 --- a/data/mate-user-share.desktop.in.in +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -_Name=Personal File Sharing -_Comment=Launch Personal File Sharing if enabled -Icon=folder-remote -Exec=@installdir@/mate-user-share -Terminal=false -Type=Application -Categories= -OnlyShowIn=MATE; diff --git a/po/POTFILES.in b/po/POTFILES.in index 32c02d6..fc6d9b6 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -3,7 +3,9 @@ data/desktop_mate_file_sharing.schemas.in [type: gettext/glade]data/file-share-properties.ui data/mate-user-share-properties.desktop.in -data/mate-user-share.desktop.in.in +data/mate-user-share-obexftp.desktop.in.in +data/mate-user-share-obexpush.desktop.in.in +data/mate-user-share-webdav.desktop.in.in src/caja-share-bar.c src/share-extension.c src/file-share-properties.c diff --git a/po/POTFILES.skip b/po/POTFILES.skip index 3b9469f..a315670 100644 --- a/po/POTFILES.skip +++ b/po/POTFILES.skip @@ -1,4 +1,6 @@ # List of source files that should NOT be translated. # Please keep this file sorted alphabetically. data/file-share-properties.ui -data/mate-user-share.desktop.in +data/mate-user-share-obexftp.desktop.in.in +data/mate-user-share-obexpush.desktop.in.in +data/mate-user-share-webdav.desktop.in.in -- cgit v1.2.1 From 1f1f66fc0bf276baa9896b96ba31d814b509e3cc Mon Sep 17 00:00:00 2001 From: raveit65 Date: Wed, 21 Aug 2013 22:44:49 +0200 Subject: OpenBSD suffers from the same httpd race condition as the other BSDs --- src/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http.c b/src/http.c index 13b11eb..71161cd 100644 --- a/src/http.c +++ b/src/http.c @@ -89,7 +89,7 @@ get_port (void) return -1; } -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__OpenBSD__) /* XXX This exposes a potential race condition, but without this, * httpd will not start on the above listed platforms due to the fact * that SO_REUSEADDR is also needed when Apache binds to the listening -- cgit v1.2.1 From 8701e25197a994f544c8b65561f25478dafc0b5b Mon Sep 17 00:00:00 2001 From: raveit65 Date: Wed, 21 Aug 2013 22:53:14 +0200 Subject: build: Add build options summary --- configure.ac | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 93c00a9..758d4b3 100644 --- a/configure.ac +++ b/configure.ac @@ -191,7 +191,7 @@ else AC_MSG_RESULT(no) fi -AC_OUTPUT([ +AC_CONFIG_FILES([ Makefile data/Makefile data/icons/Makefile @@ -207,6 +207,12 @@ src/Makefile man/Makefile ]) +AC_OUTPUT +AC_MSG_NOTICE([mate-user-share was configured with the following options:]) +AC_MSG_NOTICE([** httpd location: $HTTP]) +AC_MSG_NOTICE([** httpd modules path: $MODULES_PATH]) +AC_MSG_NOTICE([** caja extension path: $ac_with_cajadir]) + echo " Do note Apache 2.2 and mod_dnssd 0.6 are required to use mate-user-share. " -- cgit v1.2.1 From 6b2d9e48c82b8b73fd2af640fce4c1ba27eb7b50 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Wed, 21 Aug 2013 23:46:40 +0200 Subject: make bluetooth really optional --- configure.ac | 33 ++++++++++++++++++++------------- src/share-extension.c | 13 ++++++++++++- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 758d4b3..5b9b489 100644 --- a/configure.ac +++ b/configure.ac @@ -50,20 +50,20 @@ fi AC_SUBST(HTTPD) -PKG_CHECK_MODULES(USER_SHARE, glib-2.0 >= 2.15.2 gio-2.0 >= 2.26 gdk-x11-2.0 gtk+-2.0 dbus-1 >= 1.1.1 dbus-glib-1 libnotify >= 0.7.0 libcanberra-gtk $DBUS_MODULES) -AC_SUBST(USER_SHARE_CFLAGS) -AC_SUBST(USER_SHARE_LIBS) - -PKG_CHECK_MODULES(BLUETOOTH, mate-bluetooth-1.0 >= 1.2.0, - have_bluetooth=true, have_bluetooth=false) -AC_SUBST(BLUETOOTH_CFLAGS) -AC_SUBST(BLUETOOTH_LIBS) -if $have_bluetooth; then - AC_DEFINE(HAVE_BLUETOOTH, 1, [Set to true if mate-bluetooth support is available]) +BLUETOOTH_PKG="mate-bluetooth-1.0 >= 1.2.0" +AC_ARG_ENABLE(bluetooth, AS_HELP_STRING([--disable-bluetooth],[compile without bluetooth support]),,enable_bluetooth=yes) +if test "x$enable_bluetooth" = "xyes"; then + PKG_CHECK_MODULES(BLUETOOTH, $BLUETOOTH_PKG) + AC_DEFINE(HAVE_BLUETOOTH, 1, [Set to true if mate-bluetooth support is available]) else - AC_MSG_WARN([Bluetooth support is disabled.]) + BLUETOOTH_PKG="" + AC_MSG_WARN([Bluetooth support is disabled.]) fi -AM_CONDITIONAL(USE_BLUETOOTH, [test "$have_bluetooth" = "true"]) +AM_CONDITIONAL(USE_BLUETOOTH, [test "$enable_bluetooth" = "yes"]) + +PKG_CHECK_MODULES(USER_SHARE, glib-2.0 >= 2.15.2 gio-2.0 >= 2.26 gdk-x11-2.0 gtk+-2.0 dbus-1 >= 1.1.1 dbus-glib-1 libnotify >= 0.7.0 libcanberra-gtk $DBUS_MODULES $BLUETOOTH_PKG) +AC_SUBST(USER_SHARE_CFLAGS) +AC_SUBST(USER_SHARE_LIBS) PKG_CHECK_MODULES(USER_SHARE_CONFIG, glib-2.0 >= 2.15.2 gio-2.0 >= 2.25.0 gtk+-2.0 >= 2.12.0 unique-1.0) AC_SUBST(USER_SHARE_CONFIG_CFLAGS) @@ -139,7 +139,7 @@ AC_ARG_WITH(cajadir, [ac_with_cajadir=""]) PKG_CHECK_MODULES(EXTENSION, - libcaja-extension mate-bluetooth-1.0) + libcaja-extension $BLUETOOTH_PKG) if test "${ac_with_cajadir}" = ""; then ac_with_cajadir=`pkg-config --variable=extensiondir libcaja-extension` fi @@ -208,6 +208,13 @@ man/Makefile ]) AC_OUTPUT + +if test "x$enable_bluetooth" = "xyes"; then + AC_MSG_NOTICE([** Bluetooth support enabled (ObexPush and ObexFTP)]) +else + AC_MSG_NOTICE([ Bluetooth support disabled]) +fi + AC_MSG_NOTICE([mate-user-share was configured with the following options:]) AC_MSG_NOTICE([** httpd location: $HTTP]) AC_MSG_NOTICE([** httpd modules path: $MODULES_PATH]) diff --git a/src/share-extension.c b/src/share-extension.c index 188c559..b3b2952 100644 --- a/src/share-extension.c +++ b/src/share-extension.c @@ -27,10 +27,13 @@ #include #include #include -#include #include #include +#ifdef HAVE_BLUETOOTH +#include +#endif + #include "caja-share-bar.h" #include "user_share-common.h" @@ -101,6 +104,7 @@ bar_response_cb (CajaShareBar *bar, } } ++#ifdef HAVE_BLUETOOTH static void downloads_bar_set_from_bluetooth_status (GtkWidget *bar) { @@ -121,6 +125,7 @@ default_adapter_powered_cb (GObject *gobject, { downloads_bar_set_from_bluetooth_status (bar); } +#endif /* HAVE_BLUETOOTH */ static GtkWidget * caja_user_share_get_location_widget (CajaLocationWidgetProvider *iface, @@ -163,8 +168,13 @@ caja_user_share_get_location_widget (CajaLocationWidgetProvider *iface, if (is_dir[0] != FALSE && is_dir[1] != FALSE) { bar = caja_share_bar_new (_("May be used to share or receive files")); } else if (is_dir[0] != FALSE) { +#ifndef HAVE_BLUETOOTH bar = caja_share_bar_new (_("May be shared over the network or Bluetooth")); +#else + bar = caja_share_bar_new (_("May be shared over the network")); +#endif /* !HAVE_BLUETOOTH */ } else { +#ifdef HAVE_BLUETOOTH BluetoothClient *client; bar = caja_share_bar_new (_("May be used to receive files over Bluetooth")); @@ -175,6 +185,7 @@ caja_user_share_get_location_widget (CajaLocationWidgetProvider *iface, g_signal_connect (G_OBJECT (client), "notify::default-adapter-powered", G_CALLBACK (default_adapter_powered_cb), bar); downloads_bar_set_from_bluetooth_status (bar); +#endif /* HAVE_BLUETOOTH */ } g_signal_connect (bar, "response", -- cgit v1.2.1 From 472993545c41fa1c77e672b3e4d0df205a6fa98f Mon Sep 17 00:00:00 2001 From: raveit65 Date: Tue, 10 Sep 2013 14:34:04 +0200 Subject: add desktop files for autostart folder --- data/mate-user-share-obexftp.desktop.in.in | 11 +++++++++++ data/mate-user-share-obexpush.desktop.in.in | 11 +++++++++++ data/mate-user-share-webdav.desktop.in.in | 11 +++++++++++ 3 files changed, 33 insertions(+) create mode 100644 data/mate-user-share-obexftp.desktop.in.in create mode 100644 data/mate-user-share-obexpush.desktop.in.in create mode 100644 data/mate-user-share-webdav.desktop.in.in diff --git a/data/mate-user-share-obexftp.desktop.in.in b/data/mate-user-share-obexftp.desktop.in.in new file mode 100644 index 0000000..d9be7e4 --- /dev/null +++ b/data/mate-user-share-obexftp.desktop.in.in @@ -0,0 +1,11 @@ +[Desktop Entry] +_Name=Personal File Sharing obexftp +_Comment=Launch Personal File Sharing if enabled +_Keywords=share;files;bluetooth;obex;http;network;copy;send; +AutostartCondition=GSettings org.mate.FileSharing bluetooth-enabled +Icon=folder-remote +Exec=@installdir@/mate-user-share +Terminal=false +Type=Application +Categories= +OnlyShowIn=MATE; diff --git a/data/mate-user-share-obexpush.desktop.in.in b/data/mate-user-share-obexpush.desktop.in.in new file mode 100644 index 0000000..19625e6 --- /dev/null +++ b/data/mate-user-share-obexpush.desktop.in.in @@ -0,0 +1,11 @@ +[Desktop Entry] +_Name=Personal File Sharing obexpush +_Comment=Launch Personal File Sharing if enabled +_Keywords=share;files;bluetooth;obex;http;network;copy;send; +AutostartCondition=GSettings org.mate.FileSharing bluetooth-obexpush-enabled +Icon=folder-remote +Exec=@installdir@/mate-user-share +Terminal=false +Type=Application +Categories= +OnlyShowIn=MATE; diff --git a/data/mate-user-share-webdav.desktop.in.in b/data/mate-user-share-webdav.desktop.in.in new file mode 100644 index 0000000..112140d --- /dev/null +++ b/data/mate-user-share-webdav.desktop.in.in @@ -0,0 +1,11 @@ +[Desktop Entry] +_Name=Personal File Sharing webdav +_Comment=Launch Personal File Sharing if enabled +_Keywords=share;files;bluetooth;obex;http;network;copy;send; +AutostartCondition=GSettings org.mate.FileSharing enabled +Icon=folder-remote +Exec=@installdir@/mate-user-share +Terminal=false +Type=Application +Categories= +OnlyShowIn=MATE; -- cgit v1.2.1