+++ /dev/null
-subdir('server')
+++ /dev/null
-[Unit]
-Description=Server for testing UI testing
-
-[Service]
-Type=simple
-ExecStart=/usr/bin/aurum_bootstrap
-EnvironmentFile=-/run/tizen-system-env
+++ /dev/null
-#include <iostream>
-#include <glib.h>
-
-#include <gio/gio.h>
-#include <grpcpp/grpcpp.h>
-#include "aurum.grpc.pb.h"
-
-#include "AurumServiceImpl.h"
-#include "config.h"
-#include "loguru.hpp"
-
-using namespace grpc;
-
-static gpointer
-_grpc_thread_func (gpointer data __attribute__((unused)))
-{
- std::string binding("0.0.0.0:50051");
- aurumServiceImpl service;
- ServerBuilder builder;
-
- LOG_F(INFO, "[T] Server Listening on %s", binding.c_str());
- builder.AddListeningPort(binding, grpc::InsecureServerCredentials());
- builder.RegisterService(&service);
- std::unique_ptr<Server> server(builder.BuildAndStart());
- server->Wait();
-
- return NULL;
-}
-
-int main(int argc, char **argv)
-{
- const char *logPath = "/tmp/ua.log";
- GMainLoop *loop;
-
- loguru::init(argc, argv);
- loguru::g_preamble = false;
- loguru::add_file(logPath, loguru::Append, loguru::Verbosity_MAX);
- LOG_SCOPE_F(INFO, "Log : %s", logPath);
-
- loop = g_main_loop_new ( NULL , FALSE );
- g_thread_new("grpc_thread", _grpc_thread_func, loop);
-
- g_main_loop_run (loop);
- g_main_loop_unref(loop);
-
- return 0;
-}
subdir('protocol')
subdir('libloguru')
subdir('libaurum')
-subdir('bootstrap')
+subdir('org.tizen.aurum-bootstrap')
subdir('tests')
configure_file(
value: false,
description: 'enable tizen specific dependancy'
)
-
-
+option('tzapp_path',
+ type: 'string',
+ value: '/usr/apps/',
+ description: 'installation path for tizen app binary'
+)
+option('tzpackage_path',
+ type: 'string',
+ value: '/usr/share/packages/',
+ description: 'installation path for registering tizen service app'
+)
dependency('capi-appfw-app-control'),
dependency('capi-appfw-app-manager'),
dependency('capi-appfw-package-manager'),
+ dependency('capi-appfw-service-application'),
]
endif
bootstrap_svr_bin = executable(
- 'aurum_bootstrap',
+ 'aurum-bootstrap',
[bootstrap_svr_src, grpc_src, grpc_pb_src],
dependencies: bootstrap_svr_dep,
include_directories: bootstrap_svr_inc,
link_with: libloguru,
install:true,
+ install_dir: join_paths(get_option('tzapp_path'), 'org.tizen.aurum-bootstrap', 'bin'),
pie:true,
)
-system_unit_dir = ''
-user_unit_dir = ''
-
-systemd = dependency('systemd', required: false)
-if systemd.found()
- user_unit_dir = systemd.get_pkgconfig_variable('systemduserunitdir')
-endif
-
-install_data('aurum-bootstrap.service', install_dir:user_unit_dir)
+install_data('org.tizen.aurum-bootstrap.xml', install_dir: get_option('tzpackage_path'))
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="5.5" package="org.tizen.aurum-bootstrap" version="0.1.0">
+ <label>aurum-bootstrap</label>
+ <author email="wonki_.kim@samsung.com" href="www.samsung.com">Wonki Kim</author>
+ <description>autofilld</description>
+ <service-application appid="org.tizen.aurum-bootstrap" exec="aurum-bootstrap" multiple="false" nodisplay="true" taskmanage="false" type="capp">
+ <label>aurum bootstrap daemon</label>
+ <background-category value="system"/>
+ </service-application>
+ <privileges>
+ <privilege>http://tizen.org/privilege/datasharing</privilege>
+ <privilege>http://tizen.org/privilege/externalstroage</privilege>
+ <privilege>http://tizen.org/privilege/mediastorage</privilege>
+ <privilege>http://tizen.org/privilege/message.read</privilege>
+ <privilege>http://tizen.org/privilege/application.info</privilege>
+ <privilege>http://tizen.org/privilege/application.launch</privilege>
+ </privileges>
+ <feature name="http://tizen.org/feature/network.ethernet">true</feature>
+</manifest>
--- /dev/null
+#include <iostream>
+#include <glib.h>
+
+#include <service_app.h>
+
+#include <gio/gio.h>
+#include <grpcpp/grpcpp.h>
+#include "aurum.grpc.pb.h"
+
+#include "AurumServiceImpl.h"
+#include "config.h"
+#include "loguru.hpp"
+
+using namespace grpc;
+
+typedef struct _ServiceContext {
+ GMainLoop *loop;
+ GThread *thread;
+ std::unique_ptr<Server> server;
+} ServiceContext;
+
+static gpointer
+_grpc_thread_func (gpointer data)
+{
+ ServiceContext *ctx = (ServiceContext*)data;
+ std::string binding("0.0.0.0:50051");
+ aurumServiceImpl service;
+ ServerBuilder builder;
+
+ LOG_F(INFO, "[T] Server Listening on %s", binding.c_str());
+ builder.AddListeningPort(binding, grpc::InsecureServerCredentials());
+ builder.RegisterService(&service);
+ //std::unique_ptr<Server> server(builder.BuildAndStart());
+ ctx->server = std::move(builder.BuildAndStart());
+ ctx->server->Wait();
+
+ return NULL;
+}
+
+bool service_app_create(void *data)
+{
+ ServiceContext *ctx = (ServiceContext*)data;
+ const char *logPath = "/tmp/ua.log";
+
+ loguru::g_preamble = false;
+ loguru::add_file(logPath, loguru::Append, loguru::Verbosity_MAX);
+ LOG_SCOPE_F(INFO, "Log : %s", logPath);
+
+ ctx->loop = g_main_loop_new ( NULL , FALSE );
+ ctx->thread = g_thread_new("grpc_thread", _grpc_thread_func, ctx);
+
+ return true;
+}
+
+void service_app_terminate(void *data)
+{
+ ServiceContext *ctx = (ServiceContext*)data;
+ ctx->server->Shutdown();
+ g_main_loop_unref(ctx->loop);
+ g_thread_join(ctx->thread);
+}
+
+void service_app_control(app_control_h app_control, void *data)
+{
+ ServiceContext *ctx = (ServiceContext*)data;
+}
+
+int main(int argc, char **argv)
+{
+ service_app_lifecycle_callback_s event_callback;
+ app_event_handler_h handlers[5] = {NULL, };
+ ServiceContext ctx = {0,};
+
+ event_callback.create = service_app_create;
+ event_callback.terminate = service_app_terminate;
+ event_callback.app_control = service_app_control;
+
+ return service_app_main(argc, argv, &event_callback, &ctx);
+}
BuildRequires: pkgconfig(capi-appfw-package-manager)
BuildRequires: pkgconfig(capi-appfw-app-control)
BuildRequires: pkgconfig(capi-appfw-app-manager)
+BuildRequires: pkgconfig(capi-appfw-service-application)
+BuildRequires: pkgconfig(libtzplatform-config)
+
+%if "%{?profile}" == "tv"
+ %define __hash_signing 0
+%else
+ %define __hash_signing 1
+%endif
+
+%if 0%{?__hash_signing}
+BuildRequires: hash-signer
+%if 0%{?sec_product_feature_profile_wearable}
+Requires(post): signing-client
+%endif
+%endif
%description
aurum is a project for testing ui.
--libdir %{_libdir} \
-Dcpp_std=c++17 \
-Dtizen=true \
+ -Dtzapp_path=%{TZ_SYS_RO_APP} \
+ -Dtzpackage_path=%{TZ_SYS_RO_PACKAGES} \
gbsbuild 2>&1 | sed \
-e 's%^.*: error: .*$%\x1b[37;41m&\x1b[m%' \
-e 's%^.*: warning: .*$%\x1b[30;43m&\x1b[m%'
export DESTDIR=%{buildroot}
ninja -C gbsbuild install
+%if 0%{?__hash_signing}
+%define tizen_sign 1
+%define tizen_sign_base /usr/apps/org.tizen.aurum-bootstrap
+%define tizen_sign_level platform
+%define tizen_author_sign 1
+%define tizen_dist_sign 1
+%endif
+
%post
sbin/ldconfig
sbin/ldconfig
%post bootstrap
-chsmack -e "User" %{_bindir}/aurum_bootstrap
-
+%if 0%{?sec_product_feature_profile_wearable}
+echo "signing %{TZ_SYS_RO_APP}/org.tizen.aurum-bootstrap"
+/usr/bin/signing-client/hash-signer-client.sh -a -d -p platform %{TZ_SYS_RO_APP}/org.tizen.aurum-bootstrap
+%endif
+#chsmack -e "User" %{_bindir}/aurum_bootstrap
%postun bootstrap
/sbin/ldconfig
+
%files
%manifest %{name}.manifest
%defattr(-,root,root)
%manifest %{name}.manifest
%defattr(-,root,root)
%license COPYING
-%{_bindir}/aurum_bootstrap
-%{_unitdir_user}/aurum-bootstrap.service
+#%{_bindir}/aurum_bootstrap
+#%{_unitdir_user}/aurum-bootstrap.service
+%{TZ_SYS_RO_PACKAGES}/org.tizen.aurum-bootstrap.xml
+%{TZ_SYS_RO_APP}/org.tizen.aurum-bootstrap/*
+