diff options
author | Jin Yoon <jinny.yoon@samsung.com> | 2017-08-17 21:01:00 +0900 |
---|---|---|
committer | Jin Yoon <jinny.yoon@samsung.com> | 2017-08-17 21:01:00 +0900 |
commit | 857b9a762db2fef8a5b9bb0f073c541f2bfae27e (patch) | |
tree | 10981000a580be7a7c90423b0e19dfd46f3f4ac7 | |
parent | 6f5dddadc8219f09c3ea05dd6634c2b517249688 (diff) | |
download | rcc-857b9a762db2fef8a5b9bb0f073c541f2bfae27e.tar.gz rcc-857b9a762db2fef8a5b9bb0f073c541f2bfae27e.tar.bz2 rcc-857b9a762db2fef8a5b9bb0f073c541f2bfae27e.zip |
CBOR file in res dir and auto-naming in spec
Change-Id: Ibefe191bd86c6cb54e88df188f09959102c317ac
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 20 | ||||
-rw-r--r-- | packaging/org.tizen.position-finder-server.spec | 43 | ||||
-rwxr-xr-x | shared/res/default_icon.png (renamed from shared/res/position_finder_server.png) | bin | 57662 -> 57662 bytes | |||
-rw-r--r-- | src/connectivity.c | 2 | ||||
-rw-r--r-- | tizen-manifest.xml.in (renamed from tizen-manifest.xml) | 8 |
6 files changed, 43 insertions, 31 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e784509 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vsproject diff --git a/CMakeLists.txt b/CMakeLists.txt index 54c7f72..a496dd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(position-finder-server C) +PROJECT(${P_NAME} C) SET(INSTALL_EXEC_PREFIX "${INSTALL_PREFIX}/bin") -SET(INSTALL_RESDIR "${INSTALL_PREFIX}/res") -SET(INSTALL_OWNER_RESDIR "/home/owner/apps_rw/org.tizen.position-finder-server/res") -SET(INSTALL_OWNER_DATADIR "/home/owner/apps_rw/org.tizen.position-finder-server/data") SET(CMAKE_VERBOSE_MAKEFILE 0) SET(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}") @@ -23,6 +20,9 @@ pkg_check_modules(APP_PKGS REQUIRED gio-2.0 ) +ADD_DEFINITIONS(-DCBOR_FILE_IN_RES="${INSTALL_RESDIR}/${CBOR_FILE}") +ADD_DEFINITIONS(-DCBOR_FILE_IN_DATA="${INSTALL_OWNER_DATADIR}/${CBOR_FILE}") + FOREACH (flag ${APP_PKGS_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) @@ -49,12 +49,14 @@ ADD_EXECUTABLE(${PROJECT_NAME} TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lm) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${APP_PKGS_LDFLAGS}) +Message("APP_LABEL : ${APP_LABEL}") + +CONFIGURE_FILE(${PROJECT_ROOT_DIR}/tizen-manifest.xml.in ${ORG_PREFIX}.${PROJECT_NAME}.xml @ONLY) # Install INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_EXEC_PREFIX}) - -INSTALL(FILES ${PROJECT_ROOT_DIR}/tizen-manifest.xml DESTINATION ${SYS_PACKAGES_DIR} RENAME org.tizen.position-finder-server.xml) -INSTALL(DIRECTORY DESTINATION ${PREFIX}/data) -INSTALL(FILES ${PROJECT_ROOT_DIR}/shared/res/position_finder_server.png DESTINATION ${SYS_ICONS_DIR}) -INSTALL(FILES ${PROJECT_ROOT_DIR}/res/iotcon-test-svr-db-server.dat DESTINATION ${INSTALL_OWNER_RESDIR}) +INSTALL(DIRECTORY DESTINATION ${INSTALL_OWNER_DATADIR}) +INSTALL(FILES ${ORG_PREFIX}.${PROJECT_NAME}.xml DESTINATION ${SYS_PACKAGES_DIR}) +INSTALL(FILES ${PROJECT_ROOT_DIR}/shared/res/default_icon.png DESTINATION ${SYS_ICONS_DIR} RENAME ${PROJECT_NAME}.png) +INSTALL(FILES ${PROJECT_ROOT_DIR}/res/${CBOR_FILE} DESTINATION ${INSTALL_RESDIR}) # End of a file diff --git a/packaging/org.tizen.position-finder-server.spec b/packaging/org.tizen.position-finder-server.spec index 76835bb..6937d79 100644 --- a/packaging/org.tizen.position-finder-server.spec +++ b/packaging/org.tizen.position-finder-server.spec @@ -1,11 +1,15 @@ -Name: org.tizen.position-finder-server -%define alias org.tizen.position-finder-server +%define P_NAME position-finder-server +%define APP_LABEL "Position Finder Server" +%define ORG_PREFIX org.tizen + +Name: %{ORG_PREFIX}.%{P_NAME} +%define alias %{name} Summary: IoTivity Application Group: Applications/Core Applications Version: 0.0.1 Release: 1 License: Flora-1.1 -Provides: org.tizen.position-finder-server = %{version}-%{release} +Provides: %{name} = %{version}-%{release} Source0: %{name}-%{version}.tar.gz BuildRequires: cmake @@ -31,11 +35,12 @@ Server for Position Finder %define _pkg_dir %{TZ_SYS_RO_APP}/%{alias} %define _pkg_shared_dir %{_pkg_dir}/shared %define _pkg_data_dir %{_pkg_dir}/data -%define _pkg_rw_data_dir /home/owner/apps_rw/org.tizen.position-finder-server/data -%define _pkg_res_dir /home/owner/apps_rw/org.tizen.position-finder-server/res +%define _pkg_rw_data_dir /home/owner/apps_rw/%{alias}/data +%define _pkg_res_dir %{_pkg_dir}/res %define _sys_icons_dir %{_pkg_shared_dir}/res %define _sys_packages_dir %{TZ_SYS_RO_PACKAGES} %define _sys_license_dir %{TZ_SYS_SHARE}/license +%define _cbor_file iotcon-test-svr-db-server.dat %ifarch %{arm} export CFLAGS="$CFLAGS -DTIZEN_BUILD_TARGET" @@ -47,9 +52,15 @@ export CXXFLAGS="$CXXFLAGS -DTIZEN_BUILD_EMULATOR" export FFLAGS="$FFLAGS -DTIZEN_BUILD_EMULATOR" %endif -cmake . -DINSTALL_PREFIX=%{_pkg_dir} \ +cmake . -DP_NAME=%{P_NAME} \ + -DORG_PREFIX=%{ORG_PREFIX} \ + -DAPP_LABEL=%{APP_LABEL} \ + -DINSTALL_PREFIX=%{_pkg_dir} \ + -DINSTALL_OWNER_DATADIR=%{_pkg_rw_data_dir} \ + -DINSTALL_RESDIR=%{_pkg_res_dir} \ -DSYS_ICONS_DIR=%{_sys_icons_dir} \ - -DSYS_PACKAGES_DIR=%{_sys_packages_dir} + -DSYS_PACKAGES_DIR=%{_sys_packages_dir} \ + -DCBOR_FILE=%{_cbor_file} make %{?jobs:-j%jobs} %install @@ -64,22 +75,22 @@ make %{?jobs:-j%jobs} %post /sbin/ldconfig -chsmack -a "User::Pkg::org.tizen.position-finder-server" %{_pkg_res_dir}/*.dat -chmod 666 %{_pkg_res_dir}/*.dat +chsmack -a "User::Pkg::%{alias}" %{_pkg_res_dir}/*.dat +chmod 444 %{_pkg_res_dir}/*.dat -mkdir -p %{_pkg_rw_data_dir} -touch %{_pkg_rw_data_dir}/iotcon-test-svr-db-server.dat -chsmack -a "User::Pkg::org.tizen.position-finder-server" %{_pkg_rw_data_dir}/*.dat +touch %{_pkg_rw_data_dir}/%{_cbor_file} +chsmack -a "User::Pkg::%{alias}" %{_pkg_rw_data_dir}/*.dat chmod 666 %{_pkg_rw_data_dir}/*.dat %postun -p /sbin/ldconfig %files -%manifest org.tizen.position-finder-server.manifest %{_pkg_res_dir}/*.dat +%manifest %{alias}.manifest %defattr(-,root,root,-) -%{_pkg_dir}/bin/position-finder-server -%{_sys_packages_dir}/org.tizen.position-finder-server.xml -%{_sys_icons_dir}/position_finder_server.png +%{_pkg_rw_data_dir} +%{_pkg_dir}/bin/%{P_NAME} +%{_sys_packages_dir}/%{alias}.xml +%{_sys_icons_dir}/*.png %{_pkg_dir}/author-signature.xml %{_pkg_dir}/signature1.xml diff --git a/shared/res/position_finder_server.png b/shared/res/default_icon.png Binary files differindex 9765b1b..9765b1b 100755 --- a/shared/res/position_finder_server.png +++ b/shared/res/default_icon.png diff --git a/src/connectivity.c b/src/connectivity.c index 51f3a49..7a4ae94 100644 --- a/src/connectivity.c +++ b/src/connectivity.c @@ -31,8 +31,6 @@ #include "connectivity.h" #define ULTRASONIC_RESOURCE_TYPE "org.tizen.door" -#define CBOR_FILE_IN_RES "/home/owner/apps_rw/org.tizen.position-finder-server/res/iotcon-test-svr-db-server.dat" -#define CBOR_FILE_IN_DATA "/home/owner/apps_rw/org.tizen.position-finder-server/data/iotcon-test-svr-db-server.dat" #define BUFSIZE 1024 static void _request_resource_handler(iotcon_resource_h resource, iotcon_request_h request, void *user_data); diff --git a/tizen-manifest.xml b/tizen-manifest.xml.in index 2cd9c25..677801e 100644 --- a/tizen-manifest.xml +++ b/tizen-manifest.xml.in @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="org.tizen.position-finder-server" version="1.0.0"> +<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="@ORG_PREFIX@.@PROJECT_NAME@" version="1.0.0"> <profile name="mobile"/> <author email="jinny.yoon@samsung.com" href="www.samsung.com">Jin Yoon</author> <author email="gs86.lee@samsung.com" href="www.samsung.com">Geunsun Lee</author> <author email="ey928.lee@samsung.com" href="www.samsung.com">Eunyoung Lee</author> <author email="junkyu.han@samsung.com" href="www.samsung.com">Junkyu Han</author> - <service-application appid="org.tizen.position-finder-server" auto-restart="true" exec="position-finder-server" multiple="false" nodisplay="true" on-boot="true" taskmanage="false" type="capp"> - <label>Position Finder</label> - <icon>position_finder_server.png</icon> + <service-application appid="@ORG_PREFIX@.@PROJECT_NAME@" auto-restart="true" exec="@PROJECT_NAME@" multiple="false" nodisplay="true" on-boot="true" taskmanage="false" type="capp"> + <label>@APP_LABEL@</label> + <icon>@PROJECT_NAME@.png</icon> </service-application> <privileges> <privilege>http://tizen.org/privilege/network.get</privilege> |