Skip to content

Commit

Permalink
[Build] enable tizen feature
Browse files Browse the repository at this point in the history
1. Add option to set DB path.
2. Enable tizen feature in spec.

Signed-off-by: Jaeyun Jung <[email protected]>
  • Loading branch information
jaeyun-jung authored and wooksong committed Jan 23, 2024
1 parent 0085010 commit 2f4fc2a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 7 additions & 1 deletion daemon/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
static GMainLoop *g_mainloop = NULL;
static gboolean verbose = FALSE;
static gboolean is_session = FALSE;
static gchar *db_path = NULL;

/**
* @brief Handle the SIGTERM signal and quit the main loop
Expand Down Expand Up @@ -71,6 +72,7 @@ parse_args (gint *argc, gchar ***argv)
static GOptionEntry entries[] = {
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
{ "session", 's', 0, G_OPTION_ARG_NONE, &is_session, "Bus type is session", NULL },
{ "path", 'p', 0, G_OPTION_ARG_STRING, &db_path, "Path to database", NULL },
{ NULL }
};

Expand Down Expand Up @@ -109,7 +111,9 @@ main (int argc, char **argv)
}

/* path to database */
svcdb_initialize (DB_PATH);
if (!db_path)
db_path = g_strdup (DB_PATH);
svcdb_initialize (db_path);

g_mainloop = g_main_loop_new (NULL, FALSE);
gdbus_get_system_connection (is_session);
Expand Down Expand Up @@ -137,5 +141,7 @@ main (int argc, char **argv)
svcdb_finalize ();

is_session = verbose = FALSE;
g_free (db_path);
db_path = NULL;
return ret;
}
8 changes: 1 addition & 7 deletions packaging/machine-learning-agent.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Default features for Tizen release
# If you want to build RPM for other Linux distro, you may need to
# touch these values for your needs.
%if %{with tizen}
%endif
%bcond_with tizen

# Below features are used for unittest.
# Do not add neural network dependency to ML-Agent.
Expand All @@ -25,11 +24,6 @@
%if 0%{?_with_da_profile}
%endif

# If it is tizen, we can export Tizen API packages.
%if %{with tizen}
%bcond_with tizen
%endif

# Note that debug packages generate an additional build and storage cost.
# If you do not need debug packages, run '$ gbs build ... --define "_skip_debug_rpm 1"'.
%if "%{?_skip_debug_rpm}" == "1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[D-BUS Service]
Name=org.tizen.machinelearning.service
Exec=@build_dir@/machine-learning-agent-test --session
Exec=@build_dir@/machine-learning-agent-test --session --path=.

0 comments on commit 2f4fc2a

Please sign in to comment.