diff options
author | Lukasz Stanislawski <l.stanislaws@samsung.com> | 2018-04-24 15:42:23 +0200 |
---|---|---|
committer | Lukasz Stanislawski <l.stanislaws@samsung.com> | 2018-04-24 16:11:34 +0200 |
commit | 336e2c6ba9c23a18420dabc8a2e7f2fe614b5151 (patch) | |
tree | 5a6edad40922f1438439184cdd93af23d3b6750d | |
parent | a9d95b6db0ab2b62109a7d2720828d27589ac0f9 (diff) | |
download | ttsd-worker-task-336e2c6ba9c23a18420dabc8a2e7f2fe614b5151.tar.gz ttsd-worker-task-336e2c6ba9c23a18420dabc8a2e7f2fe614b5151.tar.bz2 ttsd-worker-task-336e2c6ba9c23a18420dabc8a2e7f2fe614b5151.zip |
Create project structure
Change-Id: Ic584cc92fce3d408a8484b6f13bc86c8d88e2e5a
-rw-r--r-- | .gitignore | 11 | ||||
-rw-r--r-- | CMakeLists.txt | 32 | ||||
-rw-r--r-- | org.tizen.task-worker.xml | 9 | ||||
-rw-r--r-- | packaging/task-worker.spec | 65 | ||||
-rw-r--r-- | src/task_worker.c | 21 | ||||
-rw-r--r-- | task-worker.manifest | 5 |
6 files changed, 143 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b304841 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +.vscode +*.swp diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..122bee6 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,32 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(package-manager-worker C) + +INCLUDE(FindPkgConfig) +pkg_check_modules(APP_PKGS REQUIRED + dlog + capi-appfw-service-application +) + +FOREACH (flag ${APP_PKGS_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Winline -g -fno-builtin-malloc -fPIE") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/inc) + +SET(SRCS + src/task_worker.c +) +ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lm ${APP_PKGS_LDFLAGS}) + +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(BINDIR "${PREFIX}/bin") + +# application xml +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/${PKGNAME}.xml DESTINATION ${SYS_PACKAGES_DIR}) diff --git a/org.tizen.task-worker.xml b/org.tizen.task-worker.xml new file mode 100644 index 0000000..ae02385 --- /dev/null +++ b/org.tizen.task-worker.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns="http://tizen.org/ns/packages" api-version="4.0" package="org.tizen.task-worker" version="1.0.0"> + <service-application appid="org.tizen.task-worker" exec="task-worker" type="capp" multiple="false" taskmanage="false" nodisplay="true"> + <label>task-worker</label> + <background-category value="background-network"/> + </service-application> + <privileges> + </privileges> +</manifest> diff --git a/packaging/task-worker.spec b/packaging/task-worker.spec new file mode 100644 index 0000000..74d0131 --- /dev/null +++ b/packaging/task-worker.spec @@ -0,0 +1,65 @@ +Name: org.tizen.task-worker +Summary: Process and Memory Tizen Things Worker +Version: 0.0.1 +Release: 0 +Group: Service App +License: Flora-1.1 +Source0: %{name}-%{version}.tar.gz + +BuildRequires: cmake +BuildRequires: hash-signer +BuildRequires: pkgconfig(libtzplatform-config) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(capi-appfw-service-application) + +%description +Process and Memory Tizen Things Daemon Worker + +%prep +%setup -q + +%define _pkg_dir %{TZ_SYS_RO_APP}/%{name} +%define _pkg_shared_dir %{_pkg_dir}/shared +%define _pkg_data_dir %{_pkg_dir}/data +%define _pkg_res_dir %{_pkg_dir}/res +%define _sys_icons_dir %{_pkg_shared_dir}/res +%define _sys_packages_dir %{TZ_SYS_RO_PACKAGES} + +%build + +%ifarch %{arm} +export CFLAGS="$CFLAGS -DTIZEN_BUILD_TARGET" +export CXXFLAGS="$CXXFLAGS -DTIZEN_BUILD_TARGET" +export FFLAGS="$FFLAGS -DTIZEN_BUILD_TARGET" +%else +export CFLAGS="$CFLAGS -DTIZEN_BUILD_EMULATOR" +export CXXFLAGS="$CXXFLAGS -DTIZEN_BUILD_EMULATOR" +export FFLAGS="$FFLAGS -DTIZEN_BUILD_EMULATOR" +%endif + +cmake . -DCMAKE_INSTALL_PREFIX="%{_pkg_dir}" \ + -DSYS_PACKAGES_DIR=%{_sys_packages_dir} \ + -DPKGNAME=%{name} + +make %{?jobs:-j%jobs} + +%install +rm -rf %{buildroot} +%make_install + +%define tizen_sign 1 +%define tizen_sign_base %{_pkg_dir} +%define tizen_sign_level platform +%define tizen_author_sign 1 +%define tizen_dist_sign 1 + +%post +/sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%manifest task-worker.manifest +%defattr(-,root,root,-) +%{_pkg_dir}/* +%{_sys_packages_dir}/%{name}.xml diff --git a/src/task_worker.c b/src/task_worker.c new file mode 100644 index 0000000..14bbd50 --- /dev/null +++ b/src/task_worker.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +int main(int argc, char *argv[]) +{ + return 0; +} diff --git a/task-worker.manifest b/task-worker.manifest new file mode 100644 index 0000000..a76fdba --- /dev/null +++ b/task-worker.manifest @@ -0,0 +1,5 @@ +<manifest> + <request> + <domain name="_" /> + </request> +</manifest> |