diff --git a/mms-engine/Makefile b/mms-engine/Makefile index 97ef940..3b047a7 100644 --- a/mms-engine/Makefile +++ b/mms-engine/Makefile @@ -17,7 +17,7 @@ include ../mms-lib/Config.mak # Required packages # -PKGS = gio-unix-2.0 gio-2.0 libdbusaccess libglibutil +PKGS = gio-unix-2.0 gio-2.0 libdbusaccess libglibutil libdbuslogserver-gio LIB_PKGS = libwspcodec gmime-2.6 libgofono libsoup-2.4 dconf ifdef SAILFISH @@ -36,7 +36,7 @@ all: debug release # Sources # -SRC = main.c mms_engine.c +SRC = main.c mms_engine.c mms_log.c GEN_SRC = org.nemomobile.MmsEngine.c # diff --git a/mms-engine/main.c b/mms-engine/main.c index a4121a3..dd28290 100644 --- a/mms-engine/main.c +++ b/mms-engine/main.c @@ -1,6 +1,6 @@ /* - * Copyright (C) 2013-2019 Jolla Ltd. - * Copyright (C) 2013-2019 Slava Monich + * Copyright (C) 2013-2020 Jolla Ltd. + * Copyright (C) 2013-2020 Slava Monich * Copyright (C) 2019 Open Mobile Platform LLC. * * This program is free software; you can redistribute it and/or modify @@ -57,6 +57,7 @@ typedef struct mms_app_dbus_policy { #define MMS_ENGINE_DBUS_METHOD_SET_LOG_TYPE "setLogType" #define MMS_ENGINE_DBUS_METHOD_GET_VERSION "getVersion" #define MMS_ENGINE_DBUS_METHOD_MIGRATE_SETTINGS "migrateSettings" +#define MMS_ENGINE_DBUS_METHOD_EXIT "exit" static const DA_ACTION mms_engine_dbus_actions[] = { #define INIT_DA_ACTION(id) \ @@ -74,7 +75,8 @@ static const MMSAppDBusPolicy mms_engine_default_dbus_policy = { MMS_ENGINE_DBUS_METHOD_SEND_MESSAGE"()|" MMS_ENGINE_DBUS_METHOD_SET_LOG_LEVEL"()|" MMS_ENGINE_DBUS_METHOD_SET_LOG_TYPE"()|" - MMS_ENGINE_DBUS_METHOD_MIGRATE_SETTINGS"()))|" + MMS_ENGINE_DBUS_METHOD_MIGRATE_SETTINGS"()|" + MMS_ENGINE_DBUS_METHOD_EXIT"()))|" "((!(user("RADIO_USER")&group("RADIO_GROUP")))&(" MMS_ENGINE_DBUS_METHOD_PUSH"()|" MMS_ENGINE_DBUS_METHOD_PUSH_NOTIFY "()))=deny", @@ -302,6 +304,7 @@ void mms_app_dbus_config_init( MMSEngineDbusConfig* dbus) { + dbus->type = G_BUS_TYPE_SYSTEM; dbus->engine_access = mms_app_dbus_policy_new(&mms_engine_default_dbus_policy); dbus->tx_list_access = @@ -327,7 +330,21 @@ mms_app_dbus_config_parse( MMSEngineDbusConfig* dbus) { const char* group = SETTINGS_DBUS_GROUP; + char* type = g_key_file_get_string(file, group, SETTINGS_DBUS_TYPE, NULL); + if (type) { + static const char SYSTEM_BUS[] = "system"; + static const char SESSION_BUS[] = "session"; + + if (!g_strcmp0(type, SYSTEM_BUS)) { + dbus->type = G_BUS_TYPE_SYSTEM; + } else if (!g_strcmp0(type, SESSION_BUS)) { + dbus->type = G_BUS_TYPE_SESSION; + } else { + GWARN("Invalid D-Bys type \"%s\"", type); + } + g_free(type); + } dbus->engine_access = mms_app_dbus_config_update(dbus->engine_access, file, group, SETTINGS_DBUS_ENGINE_ACCESS, &mms_engine_default_dbus_policy); @@ -383,6 +400,7 @@ mms_app_parse_options( char* root_dir = NULL; gboolean log_modules = FALSE; gboolean keep_running = FALSE; + gboolean disable_dbus_log = FALSE; gint size_limit_kb = -1; gdouble megapixels = -1; char* root_dir_help = g_strdup_printf( @@ -440,6 +458,8 @@ mms_app_parse_options( "Log output (stdout|syslog|glib) [stdout]", "TYPE" }, { "log-level", 'l', 0, G_OPTION_ARG_CALLBACK, mms_app_option_loglevel, "Set log level (repeatable)", "[MODULE:]LEVEL" }, + { "disable-dbus-log", 'D', 0, G_OPTION_ARG_NONE, &disable_dbus_log, + "Disable logging over D-Bus", NULL }, { "log-modules", 0, 0, G_OPTION_ARG_NONE, &log_modules, "List available log modules", NULL }, #ifdef MMS_VERSION_STRING @@ -493,6 +513,7 @@ mms_app_parse_options( } if (ok) { /* Parse the rest of the command line */ + session_bus = (opt->dbus.type == G_BUS_TYPE_SESSION); ok = g_option_context_parse(options, &argc, &argv, &error); } else if (error) { /* Improve error message by prepending the file name */ @@ -564,6 +585,7 @@ mms_app_parse_options( root_dir = NULL; } if (keep_running) opt->flags |= MMS_ENGINE_FLAG_KEEP_RUNNING; + if (disable_dbus_log) opt->flags |= MMS_ENGINE_FLAG_DISABLE_DBUS_LOG; if (session_bus) { GDEBUG("Attaching to session bus"); opt->dbus.type = G_BUS_TYPE_SESSION; diff --git a/mms-engine/mms-engine.pro b/mms-engine/mms-engine.pro index fb92da4..900b015 100644 --- a/mms-engine/mms-engine.pro +++ b/mms-engine/mms-engine.pro @@ -1,7 +1,7 @@ TEMPLATE = app CONFIG += link_pkgconfig PKGCONFIG += gmime-2.6 gio-unix-2.0 gio-2.0 glib-2.0 libsoup-2.4 dconf -PKGCONFIG += libwspcodec libgofono libdbusaccess libglibutil +PKGCONFIG += libwspcodec libgofono libdbusaccess libglibutil libdbuslogserver-gio QMAKE_CFLAGS += -Wno-unused-parameter include(../mms-lib/mms-lib-config.pri) @@ -34,9 +34,11 @@ INCLUDEPATH += $$MMS_TRANSFER_LIST_DIR/include SOURCES += \ main.c \ - mms_engine.c + mms_engine.c \ + mms_log.c HEADERS += \ mms_engine.h \ + mms_log.h \ mms_version.h OTHER_FILES += \ org.nemomobile.MmsEngine.push.conf \ diff --git a/mms-engine/mms_engine.c b/mms-engine/mms_engine.c index 89c3fd3..f3f60d8 100644 --- a/mms-engine/mms_engine.c +++ b/mms-engine/mms_engine.c @@ -1,6 +1,6 @@ /* - * Copyright (C) 2013-2019 Jolla Ltd. - * Copyright (C) 2013-2019 Slava Monich + * Copyright (C) 2013-2020 Jolla Ltd. + * Copyright (C) 2013-2020 Slava Monich * Copyright (C) 2019 Open Mobile Platform LLC. * * This program is free software; you can redistribute it and/or modify @@ -14,6 +14,8 @@ */ #include "mms_engine.h" +#include "mms_log.h" + #include "mms_dispatcher.h" #include "mms_settings.h" #include "mms_lib_util.h" @@ -32,6 +34,8 @@ /* Generated code */ #include "org.nemomobile.MmsEngine.h" +#include + #include #include @@ -54,7 +58,7 @@ struct mms_engine { MMSSettings* settings; MMSDispatcher* dispatcher; MMSDispatcherDelegate dispatcher_delegate; - MMSLogModule** log_modules; + MMSLog* log; DAPolicy* dbus_access; DA_BUS da_bus; GDBusConnection* engine_bus; @@ -63,6 +67,7 @@ struct mms_engine { gboolean stopped; gboolean stop_requested; gboolean keep_running; + gboolean disable_dbus_log; guint idle_timer_id; gulong proxy_signal_id[MMS_ENGINE_METHOD_COUNT]; }; @@ -453,20 +458,9 @@ mms_engine_handle_set_log_level( if (mms_engine_dbus_access_allowed(engine, call, MMS_ENGINE_ACTION_SET_LOG_LEVEL)) { GDEBUG_("%s:%d", module, level); - if (module && module[0]) { - MMSLogModule** ptr = engine->log_modules; - - while (*ptr) { - MMSLogModule* log = *ptr++; - - if (log->name && log->name[0] && !strcmp(log->name, module)) { - log->level = level; - break; - } - } - } else { - gutil_log_default.level = level; - } + dbus_log_server_set_category_level(engine->log->server, + module[0] ? module : gutil_log_default.name, + dbus_log_level_from_gutil(level)); org_nemomobile_mms_engine_complete_set_log_level(proxy, call); } mms_engine_idle_timer_check(engine); @@ -553,6 +547,23 @@ mms_engine_handle_migrate_settings( return TRUE; } +/* org.nemomobile.MmsEngine.exit */ +static +gboolean +mms_engine_handle_exit( + OrgNemomobileMmsEngine* proxy, + GDBusMethodInvocation* call, + MMSEngine* engine) +{ + /* mms_engine_dbus_access_allowed completes the call if access is denied */ + if (mms_engine_dbus_access_allowed(engine, call, MMS_ENGINE_ACTION_EXIT)) { + GDEBUG("Exit requested over D-Bus"); + mms_engine_stop(engine); + org_nemomobile_mms_engine_complete_exit(proxy, call); + } + return TRUE; +} + MMSEngine* mms_engine_new( const MMSConfig* config, @@ -599,10 +610,14 @@ mms_engine_new( mms->keep_running = TRUE; } + if (flags & MMS_ENGINE_FLAG_DISABLE_DBUS_LOG) { + mms->disable_dbus_log = TRUE; + } + mms->cm = cm; mms->config = config; mms->settings = settings; - mms->log_modules = log_modules; + mms->log = mms_log_new(dbus->type, log_modules); mms->dbus_access = da_policy_ref(dbus->engine_access); mms->da_bus = (dbus->type == G_BUS_TYPE_SESSION) ? DA_BUS_SESSION : DA_BUS_SYSTEM; @@ -638,6 +653,9 @@ mms_engine_new( mms->proxy_signal_id[MMS_ENGINE_METHOD_MIGRATE_SETTINGS] = g_signal_connect(mms->proxy, "handle-migrate-settings", G_CALLBACK(mms_engine_handle_migrate_settings), mms); + mms->proxy_signal_id[MMS_ENGINE_METHOD_EXIT] = + g_signal_connect(mms->proxy, "handle-exit", + G_CALLBACK(mms_engine_handle_exit), mms); return mms; } @@ -664,14 +682,19 @@ mms_engine_run( MMSEngine* engine, GMainLoop* loop) { + DBusLogServer* logger = engine->disable_dbus_log ? NULL : + engine->log->server; + GASSERT(!engine->loop); engine->loop = loop; engine->stopped = FALSE; engine->stop_requested = FALSE; mms_dispatcher_start(engine->dispatcher); + dbus_log_server_start(logger); mms_engine_idle_timer_check(engine); g_main_loop_run(loop); mms_engine_idle_timer_stop(engine); + dbus_log_server_stop(logger); engine->loop = NULL; } @@ -777,10 +800,24 @@ mms_engine_dispose( mms_connman_unref(mms->cm); mms->cm = NULL; } - da_policy_unref(mms->dbus_access); G_OBJECT_CLASS(mms_engine_parent_class)->dispose(object); } +/** + * Final stage of deinitialization + */ +static +void +mms_engine_finalize( + GObject* object) +{ + MMSEngine* engine = MMS_ENGINE(object); + GVERBOSE_("%p", engine); + da_policy_unref(engine->dbus_access); + mms_log_free(engine->log); + G_OBJECT_CLASS(mms_engine_parent_class)->finalize(object); +} + /** * Per class initializer */ @@ -792,6 +829,7 @@ mms_engine_class_init( GObjectClass* object_class = G_OBJECT_CLASS(klass); GASSERT(object_class); object_class->dispose = mms_engine_dispose; + object_class->finalize = mms_engine_finalize; GVERBOSE_("done"); } diff --git a/mms-engine/mms_engine.h b/mms-engine/mms_engine.h index 822d71e..11e4aeb 100644 --- a/mms-engine/mms_engine.h +++ b/mms-engine/mms_engine.h @@ -1,6 +1,6 @@ /* - * Copyright (C) 2013-2019 Jolla Ltd. - * Copyright (C) 2013-2019 Slava Monich + * Copyright (C) 2013-2020 Jolla Ltd. + * Copyright (C) 2013-2020 Slava Monich * Copyright (C) 2019 Open Mobile Platform LLC. * * This program is free software; you can redistribute it and/or modify @@ -32,6 +32,7 @@ #define MMS_ENGINE_FLAG_OVERRIDE_SIZE_LIMIT (0x04) #define MMS_ENGINE_FLAG_OVERRIDE_MAX_PIXELS (0x08) #define MMS_ENGINE_FLAG_OVERRIDE_UAPROF (0x10) +#define MMS_ENGINE_FLAG_DISABLE_DBUS_LOG (0x20) #ifndef MMS_ENGINE_CONFIG_FILE /* Default config file */ @@ -48,7 +49,8 @@ m(SET_LOG_LEVEL) \ m(SET_LOG_TYPE) \ m(GET_VERSION) \ - m(MIGRATE_SETTINGS) + m(MIGRATE_SETTINGS) \ + m(EXIT) typedef enum mms_engine_action { /* Action ids must be non-zero, shift those by one */ diff --git a/mms-engine/mms_log.c b/mms-engine/mms_log.c new file mode 100644 index 0000000..8578815 --- /dev/null +++ b/mms-engine/mms_log.c @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2020 Jolla Ltd. + * Copyright (C) 2020 Slava Monich + * + * 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. + */ + +#include "mms_log.h" + +#include +#include + +#include +#include + +enum { + DBUSLOG_EVENT_CATEGORY_ENABLED, + DBUSLOG_EVENT_CATEGORY_DISABLED, + DBUSLOG_EVENT_CATEGORY_LEVEL_CHANGED, + DBUSLOG_EVENT_DEFAULT_LEVEL_CHANGED, + DBUSLOG_EVENT_COUNT +}; + +typedef struct mms_log_priv { + MMSLog log; + GHashTable* map; + gulong event_id[DBUSLOG_EVENT_COUNT]; + GLogProc2 default_func; +} MMSLogPriv; + +static MMSLogPriv* mms_log_active = NULL; + +static +void +mms_log_func( + MMSLogPriv* self, + const GLogModule* log, + int level, + const char* format, + va_list va) +{ + va_list va2; + + va_copy(va2, va); + dbus_log_server_logv(self->log.server, dbus_log_level_from_gutil(level), + log->name, format, va2); + va_end(va2); + if (self->default_func) { + self->default_func(log, level, format, va); + } +} + +static +void +mms_log_hook( + const GLogModule* log, + int level, + const char* format, + va_list va) +{ + if (mms_log_active) { + mms_log_func(mms_log_active, log, level, format, va); + } +} + +static +void +mms_log_add_category( + MMSLogPriv* self, + GLogModule* module) +{ + gulong flags = 0; + + GVERBOSE("Adding \"%s\"", module->name); + g_hash_table_replace(self->map, (gpointer)module->name, module); + if (!(module->flags & GLOG_FLAG_DISABLE)) { + flags |= (DBUSLOG_CATEGORY_FLAG_ENABLED | + DBUSLOG_CATEGORY_FLAG_ENABLED_BY_DEFAULT); + } + if (module->flags & GLOG_FLAG_HIDE_NAME) { + flags |= DBUSLOG_CATEGORY_FLAG_HIDE_NAME; + } + dbus_log_server_add_category(self->log.server, module->name, + dbus_log_level_from_gutil(module->level), flags); +} + +/*==========================================================================* + * Events + *==========================================================================*/ + +static +void +mms_log_category_enabled( + DBusLogServer* server, + const char* name, + gpointer user_data) +{ + MMSLogPriv* self = user_data; + GLogModule* module = g_hash_table_lookup(self->map, name); + + GASSERT(module); + if (module) { + module->flags &= ~GLOG_FLAG_DISABLE; + } +} + +static +void +mms_log_category_disabled( + DBusLogServer* server, + const char* name, + gpointer user_data) +{ + MMSLogPriv* self = user_data; + GLogModule* module = g_hash_table_lookup(self->map, name); + + GASSERT(module); + if (module) { + module->flags |= GLOG_FLAG_DISABLE; + } +} + +static +void +mms_log_category_level_changed( + DBusLogServer* server, + const char* name, + DBUSLOG_LEVEL dbus_level, + gpointer user_data) +{ + MMSLogPriv* self = user_data; + GLogModule* module = g_hash_table_lookup(self->map, name); + const int level = dbus_log_level_to_gutil(dbus_level); + + GASSERT(module); + if (module && level != GLOG_LEVEL_NONE) { + module->level = level; + } +} + +static +void +mms_log_default_level_changed( + DBusLogServer* server, + DBUSLOG_LEVEL dbus_level, + gpointer user_data) +{ + const int level = dbus_log_level_to_gutil(dbus_level); + + if (level != GLOG_LEVEL_NONE) { + gutil_log_default.level = level; + } +} + +/*==========================================================================* + * Interface + *==========================================================================*/ + +MMSLog* +mms_log_new( + GBusType bus, + GLogModule* modules[]) /* NULL terminated */ +{ + MMSLogPriv* self = g_new0(MMSLogPriv, 1); + GLogModule** ptr = modules; + + self->log.server = dbus_log_server_new(bus, NULL, "/"); + self->map = g_hash_table_new(g_str_hash, g_str_equal); + while (*ptr) { + mms_log_add_category(self, *ptr++); + } + + self->event_id[DBUSLOG_EVENT_CATEGORY_ENABLED] = + dbus_log_server_add_category_enabled_handler(self->log.server, + mms_log_category_enabled, self); + self->event_id[DBUSLOG_EVENT_CATEGORY_DISABLED] = + dbus_log_server_add_category_disabled_handler(self->log.server, + mms_log_category_disabled, self); + self->event_id[DBUSLOG_EVENT_CATEGORY_LEVEL_CHANGED] = + dbus_log_server_add_category_level_handler(self->log.server, + mms_log_category_level_changed, self); + self->event_id[DBUSLOG_EVENT_DEFAULT_LEVEL_CHANGED] = + dbus_log_server_add_default_level_handler(self->log.server, + mms_log_default_level_changed, self); + + mms_log_active = self; + self->default_func = gutil_log_func2; + gutil_log_func2 = mms_log_hook; + dbus_log_server_set_default_level(self->log.server, + dbus_log_level_from_gutil(gutil_log_default.level)); + return &self->log; +} + +void +mms_log_free( + MMSLog* log) +{ + MMSLogPriv* self = G_CAST(log,MMSLogPriv,log); + + if (mms_log_active == self) { + mms_log_active = NULL; + gutil_log_func2 = self->default_func; + } + dbus_log_server_remove_all_handlers(log->server, self->event_id); + dbus_log_server_unref(log->server); + g_hash_table_destroy(self->map); + g_free(self); +} + +/* + * Local Variables: + * mode: C + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/mms-engine/mms_log.h b/mms-engine/mms_log.h new file mode 100644 index 0000000..aa9b977 --- /dev/null +++ b/mms-engine/mms_log.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2020 Jolla Ltd. + * Copyright (C) 2020 Slava Monich + * + * 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. + */ + +#ifndef JOLLA_MMS_LOG_H +#define JOLLA_MMS_LOG_H + +#include +#include +#include + +typedef struct mms_log { + DBusLogServer* server; +} MMSLog; + +MMSLog* +mms_log_new( + GBusType bus, + GLogModule* modules[]); /* NULL terminated */ + +void +mms_log_free( + MMSLog* log); + +#endif /* JOLLA_MMS_LOG_H */ + +/* + * Local Variables: + * mode: C + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/mms-engine/org.nemomobile.MmsEngine.xml b/mms-engine/org.nemomobile.MmsEngine.xml index ff68a6f..a47e7d3 100644 --- a/mms-engine/org.nemomobile.MmsEngine.xml +++ b/mms-engine/org.nemomobile.MmsEngine.xml @@ -211,5 +211,8 @@ + + + diff --git a/mms-lib/src/mms_task.c b/mms-lib/src/mms_task.c index a058b7b..0f1969c 100644 --- a/mms-lib/src/mms_task.c +++ b/mms-lib/src/mms_task.c @@ -1,6 +1,6 @@ /* - * Copyright (C) 2013-2016 Jolla Ltd. - * Contact: Slava Monich + * Copyright (C) 2013-2020 Jolla Ltd. + * Copyright (C) 2013-2020 Slava Monich * * 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 @@ -12,6 +12,8 @@ * GNU General Public License for more details. */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #include "mms_task.h" #include "mms_handler.h" #include "mms_file_util.h" diff --git a/mms-lib/src/mms_task_http.c b/mms-lib/src/mms_task_http.c index 64c0fad..65472bc 100644 --- a/mms-lib/src/mms_task_http.c +++ b/mms-lib/src/mms_task_http.c @@ -1,6 +1,6 @@ /* - * Copyright (C) 2013-2017 Jolla Ltd. - * Contact: Slava Monich + * Copyright (C) 2013-2020 Jolla Ltd. + * Copyright (C) 2013-2020 Slava Monich * * 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 @@ -12,6 +12,8 @@ * GNU General Public License for more details. */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #include "mms_task_http.h" #include "mms_connection.h" #include "mms_settings.h" diff --git a/mms-lib/src/mms_util.h b/mms-lib/src/mms_util.h index f992364..5d9726c 100644 --- a/mms-lib/src/mms_util.h +++ b/mms-lib/src/mms_util.h @@ -1,6 +1,6 @@ /* - * Copyright (C) 2013-2015 Jolla Ltd. - * Contact: Slava Monich + * Copyright (C) 2013-2020 Jolla Ltd. + * Copyright (C) 2013-2020 Slava Monich * * 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 @@ -35,7 +35,7 @@ mms_decode_bytes( GBytes* bytes); /* NULL-resistant variant of g_strstrip */ -G_INLINE_FUNC char* mms_strip(char* str) +static inline char* mms_strip(char* str) { return str ? g_strstrip(str) : NULL; } /* Address type suffices */ diff --git a/mms-transfer-list-dbus/src/mms_transfer_dbus.c b/mms-transfer-list-dbus/src/mms_transfer_dbus.c index 7fe47a3..8fd790f 100644 --- a/mms-transfer-list-dbus/src/mms_transfer_dbus.c +++ b/mms-transfer-list-dbus/src/mms_transfer_dbus.c @@ -1,6 +1,6 @@ /* - * Copyright (C) 2016-2019 Jolla Ltd. - * Copyright (C) 2016-2019 Slava Monich + * Copyright (C) 2016-2020 Jolla Ltd. + * Copyright (C) 2016-2020 Slava Monich * Copyright (C) 2019 Open Mobile Platform LLC. * * This program is free software; you can redistribute it and/or modify @@ -13,6 +13,8 @@ * GNU General Public License for more details. */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #include "mms_transfer_dbus.h" #include "mms_transfer_list_dbus_log.h" diff --git a/rpm/mms-engine.spec b/rpm/mms-engine.spec index 1a98ae8..e14e58d 100644 --- a/rpm/mms-engine.spec +++ b/rpm/mms-engine.spec @@ -5,33 +5,46 @@ Release: 1 License: GPLv2 URL: https://git.sailfishos.org/mer-core/mms-engine Source0: %{name}-%{version}.tar.bz2 + +%define glib_version 2.32 +%define libsoup_version 2.38 +%define libwspcodec_version 2.2 +%define libgofono_version 2.0.0 +%define libgofonoext_version 1.0.4 +%define libglibutil_version 1.0.11 +%define libdbusaccess_version 1.0.10 +%define libdbuslog_version 1.0.19 + Requires: dbus Requires: ofono -Requires: libsoup >= 2.38 -Requires: libwspcodec >= 2.2 -Requires: libgofono >= 2.0.0 -Requires: libgofonoext >= 1.0.4 -Requires: libglibutil >= 1.0.5 -Requires: libdbusaccess >= 1.0.10 +Requires: glib2 >= %{glib_version} +Requires: libsoup >= %{libsoup_version} +Requires: libwspcodec >= %{libwspcodec_version} +Requires: libgofono >= %{libgofono_version} +Requires: libgofonoext >= %{libgofonoext_version} +Requires: libglibutil >= %{libglibutil_version} +Requires: libdbusaccess >= %{libdbusaccess_version} +Requires: libdbuslogserver-gio >= %{libdbuslog_version} Requires(post): glib2 Requires(postun): glib2 +BuildRequires: systemd BuildRequires: file-devel BuildRequires: libjpeg-turbo-devel BuildRequires: pkgconfig(dconf) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libexif) BuildRequires: pkgconfig(gmime-2.6) -BuildRequires: pkgconfig(glib-2.0) >= 2.32 -BuildRequires: pkgconfig(libsoup-2.4) >= 2.38 -BuildRequires: pkgconfig(libwspcodec) >= 2.2 -BuildRequires: pkgconfig(libgofono) >= 2.0.0 -BuildRequires: pkgconfig(libgofonoext) >= 1.0.4 -BuildRequires: pkgconfig(libglibutil) >= 1.0.11 -BuildRequires: pkgconfig(libdbusaccess) +BuildRequires: pkgconfig(glib-2.0) >= %{glib_version} +BuildRequires: pkgconfig(libsoup-2.4) >= %{libsoup_version} +BuildRequires: pkgconfig(libwspcodec) >= %{libwspcodec_version} +BuildRequires: pkgconfig(libgofono) >= %{libgofono_version} +BuildRequires: pkgconfig(libgofonoext) >= %{libgofonoext_version} +BuildRequires: pkgconfig(libglibutil) >= %{libglibutil_version} +BuildRequires: pkgconfig(libdbusaccess) >= %{libdbusaccess_version} +BuildRequires: pkgconfig(libdbuslogserver-gio) >= %{libdbuslog_version} #BuildRequires: pkgconfig(ImageMagick) BuildRequires: pkgconfig(Qt5Gui) -BuildRequires: systemd %define src mms-engine %define exe mms-engine