Merge with bangbang-sensor-pi 79/144679/1
authorJin Yoon <jinny.yoon@samsung.com>
Thu, 17 Aug 2017 11:04:54 +0000 (20:04 +0900)
committerJin Yoon <jinny.yoon@samsung.com>
Thu, 17 Aug 2017 11:04:54 +0000 (20:04 +0900)
Change-Id: I6b634047bf5de9b658a533332be020837f2077a3

.gitignore [new file with mode: 0644]
CMakeLists.txt
packaging/org.tizen.position-finder-client.spec
shared/res/default_icon.png [moved from shared/res/position_finder_client.png with 100% similarity]
tizen-manifest.xml [deleted file]
tizen-manifest.xml.in [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..e784509
--- /dev/null
@@ -0,0 +1 @@
+.vsproject
index 50865a2..afb2c10 100644 (file)
@@ -1,10 +1,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(position-finder-client 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-client/res")
-SET(INSTALL_OWNER_DATADIR "/home/owner/apps_rw/org.tizen.position-finder-client/data")
 SET(CMAKE_VERBOSE_MAKEFILE 0)
 
 SET(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}")
@@ -22,6 +19,9 @@ pkg_check_modules(APP_PKGS REQUIRED
        ecore
 )
 
+ADD_DEFINITIONS(-DCBOR_FILE_IN_RES="${INSTALL_OWNER_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)
@@ -40,12 +40,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-client.xml)
 INSTALL(DIRECTORY DESTINATION ${INSTALL_OWNER_DATADIR})
-INSTALL(FILES ${PROJECT_ROOT_DIR}/shared/res/position_finder_client.png DESTINATION ${SYS_ICONS_DIR})
-INSTALL(FILES ${PROJECT_ROOT_DIR}/res/iotcon-test-svr-db-client.dat DESTINATION ${INSTALL_OWNER_RESDIR})
+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_OWNER_RESDIR})
 
 # End of a file
index 0f86445..772d094 100644 (file)
@@ -1,11 +1,15 @@
-Name:       org.tizen.position-finder-client
-%define alias org.tizen.position-finder-client
-Summary:    Position Finder Client
+%define P_NAME position-finder-client
+%define APP_LABEL "Position Finder Client"
+%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-client = %{version}-%{release}
+Provides:   %{name} = %{version}-%{release}
 Source0:    %{name}-%{version}.tar.gz
 
 BuildRequires:  cmake
@@ -20,7 +24,7 @@ BuildRequires:  pkgconfig(eina)
 BuildRequires:  pkgconfig(ecore)
 
 %description
-Thing Illumination
+Client for Position Finder
 
 %prep
 %setup -q
@@ -30,11 +34,12 @@ Thing Illumination
 %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-client/data
-%define _pkg_res_dir /home/owner/apps_rw/org.tizen.position-finder-client/res
+%define _pkg_rw_data_dir /home/owner/apps_rw/%{alias}/data
+%define _pkg_res_dir /home/owner/apps_rw/%{alias}/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-client.dat
 
 %ifarch %{arm}
 export CFLAGS="$CFLAGS -DTIZEN_BUILD_TARGET"
@@ -46,9 +51,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_OWNER_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
@@ -63,22 +74,22 @@ make %{?jobs:-j%jobs}
 
 %post
 /sbin/ldconfig
-chsmack -a "User::Pkg::org.tizen.position-finder-client" %{_pkg_res_dir}/*.dat
+chsmack -a "User::Pkg::%{alias}" %{_pkg_res_dir}/*.dat
 chmod 444 %{_pkg_res_dir}/*.dat
 
-touch %{_pkg_res_dir}/iotcon-test-svr-db-client.dat
-chsmack -a "User::Pkg::org.tizen.position-finder-client" %{_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-client.manifest
 %{_pkg_res_dir}/*.dat
-%{_pkg_rw_data_dir}
+%manifest %{alias}.manifest
 %defattr(-,root,root,-)
-%{_pkg_dir}/bin/position-finder-client
-%{_sys_packages_dir}/org.tizen.position-finder-client.xml
-%{_sys_icons_dir}/position_finder_client.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/tizen-manifest.xml b/tizen-manifest.xml
deleted file mode 100644 (file)
index d80c783..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?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-client" version="1.0.0">
-    <profile name="mobile"/>
-    <service-application appid="org.tizen.position-finder-client" auto-restart="false" exec="position-finder-client" multiple="false" nodisplay="false" on-boot="true" taskmanage="true" type="capp">
-        <label>Position Filnder Client</label>
-        <icon>position_finder_client.png</icon>
-    </service-application>
-    <privileges>
-        <privilege>http://tizen.org/privilege/network.get</privilege>
-               <privilege>http://tizen.org/privilege/internet</privilege>
-    </privileges>
-</manifest>
diff --git a/tizen-manifest.xml.in b/tizen-manifest.xml.in
new file mode 100644 (file)
index 0000000..677801e
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<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_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>
+               <privilege>http://tizen.org/privilege/internet</privilege>
+    </privileges>
+</manifest>