From: Jaeyun Jung Date: Tue, 23 Jan 2024 04:57:50 +0000 (+0900) Subject: [Build] enable tizen feature X-Git-Tag: accepted/tizen/unified/20240214.163929~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f4fc2a100656dffeeb4c6236a4a2fa5cd6d0a94;p=platform%2Fcore%2Fml%2Fmlops-agent.git [Build] enable tizen feature 1. Add option to set DB path. 2. Enable tizen feature in spec. Signed-off-by: Jaeyun Jung --- diff --git a/daemon/main.c b/daemon/main.c index 0968d56..1a46de0 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -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 @@ -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 } }; @@ -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); @@ -137,5 +141,7 @@ error: svcdb_finalize (); is_session = verbose = FALSE; + g_free (db_path); + db_path = NULL; return ret; } diff --git a/packaging/machine-learning-agent.spec b/packaging/machine-learning-agent.spec index 23d838d..a30eb2e 100644 --- a/packaging/machine-learning-agent.spec +++ b/packaging/machine-learning-agent.spec @@ -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. @@ -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" diff --git a/tests/services/org.tizen.machinelearning.service.service.in b/tests/services/org.tizen.machinelearning.service.service.in index 5d72a39..e02d334 100644 --- a/tests/services/org.tizen.machinelearning.service.service.in +++ b/tests/services/org.tizen.machinelearning.service.service.in @@ -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=.