TizenRefApp-5010 moved to usage of tzplatform-config pzckage in build 86/52686/2 accepted/tizen/mobile/20151127.013053 submit/tizen/20151126.133222
authorAndrey Klimenko <and.klimenko@samsung.com>
Wed, 25 Nov 2015 16:01:42 +0000 (18:01 +0200)
committerAndrey Klimenko <and.klimenko@samsung.com>
Thu, 26 Nov 2015 09:09:22 +0000 (11:09 +0200)
Change-Id: Ifc2748f8f4af65d386743ae42109e3767839b820
Signed-off-by: Andrey Klimenko <and.klimenko@samsung.com>
packaging/ug-setting-notification-efl.spec
ug-setting-notification-app-notifications-efl/CMakeLists.txt
ug-setting-notification-app-notifications-efl/src/app-notificatons-efl.c
ug-setting-notification-do-not-disturb-efl/CMakeLists.txt
ug-setting-notification-do-not-disturb-efl/src/do-not-disturb-efl.c
ug-setting-notification-efl/CMakeLists.txt
ug-setting-notification-efl/inc/log.h
ug-setting-notification-efl/inc/pkgmgr-setting-info.h
ug-setting-notification-efl/res/po/CMakeLists.txt
ug-setting-notification-efl/src/common-efl.c

index 38917ad..045b2b3 100755 (executable)
@@ -27,7 +27,6 @@ BuildRequires: pkgconfig(dlog)
 BuildRequires: edje-bin
 BuildRequires: cmake
 BuildRequires: gettext-tools
-#BuildRequires: model-build-features
 BuildRequires: pkgconfig(notification)
 BuildRequires: pkgconfig(pkgmgr)
 BuildRequires: pkgconfig(pkgmgr-info)
@@ -35,6 +34,7 @@ BuildRequires: pkgconfig(capi-appfw-package-manager)
 BuildRequires: pkgconfig(capi-system-system-settings)
 BuildRequires: pkgconfig(capi-appfw-app-manager)
 BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(libtzplatform-config)
 
 
 %description
@@ -58,13 +58,22 @@ cp %{SOURCE1001} .
 
 
 %build
-%define bin_path /usr/apps/%{name}/bin
-%define lib_path /usr/apps/%{name}/lib/ug
-%define link_path /home/owner/apps_rw/%{name}/lib/ug
+%define _pkg_dir %{TZ_SYS_RO_APP}/%{name}
+%define _pkg_lib_dir %{_pkg_dir}/lib
+
+%define _sys_icons_dir %{TZ_SYS_RO_ICONS}
+%define _sys_packages_dir %{TZ_SYS_RO_PACKAGES}
+%define _sys_license_dir %{TZ_SYS_SHARE}/license
+%define _sys_smack_dir %{TZ_SYS_SMACK}/accesses.d
+
+%define _bin_path %{TZ_SYS_RO_APP}/%{name}/bin
+%define _link_path /home/owner/apps_rw/%{name}/lib/ug
 
 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
+export LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--rpath=%{_pkg_lib_dir} -Wl,--as-needed -Wl,-zdefs"
+
 
 %if 0%{?tizen_build_binary_release_type_eng}
 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
@@ -72,21 +81,23 @@ export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
 %endif
 
-%cmake .
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_pkg_dir} \
+       -DENABLE_ATTACH_PANEL=%{_enable_attach_panel} \
+       -DSYS_ICONS_DIR=%{_sys_icons_dir} \
+       -DSYS_PACKAGES_DIR=%{_sys_packages_dir} \
+       -DSYS_LICENSE_DIR=%{_sys_license_dir} \
+       -DSYS_SMACK_DIR=%{_sys_smack_dir}
+
 make -j2
 
 %install
 %make_install
-mkdir -p %{buildroot}%{bin_path}
-mkdir -p %{buildroot}%{link_path}
-mkdir -p /etc/smack/accesses.d/
-ln -sf /usr/bin/ug-client %{buildroot}%{bin_path}/ug-setting-notification-efl
-ln -sf /usr/bin/ug-client %{buildroot}%{bin_path}/ug-setting-notification-do-not-disturb-efl
-ln -sf /usr/bin/ug-client %{buildroot}%{bin_path}/ug-setting-notification-app-notifications-efl
-ln -sf %{lib_path}/libug-setting-notification-do-not-disturb-efl.so %{buildroot}%{link_path}/libug-setting-notification-do-not-disturb-efl.so
-
-
-mkdir -p %{buildroot}/usr/apps/%{name}/res
+mkdir -p %{buildroot}%{_bin_path}
+mkdir -p %{buildroot}%{_link_path}
+ln -sf %{TZ_SYS_BIN}/ug-client %{buildroot}%{_bin_path}/ug-setting-notification-efl
+ln -sf %{TZ_SYS_BIN}/ug-client %{buildroot}%{_bin_path}/ug-setting-notification-do-not-disturb-efl
+ln -sf %{TZ_SYS_BIN}/ug-client %{buildroot}%{_bin_path}/ug-setting-notification-app-notifications-efl
+ln -sf %{lib_path}/libug-setting-notification-do-not-disturb-efl.so %{buildroot}%{_link_path}/libug-setting-notification-do-not-disturb-efl.so
 
 %post -n %{name} -p /sbin/ldconfig
 
@@ -96,12 +107,10 @@ mkdir -p %{buildroot}/usr/apps/%{name}/res
 %files
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
-%{_prefix}/apps/%{name}/*
-%{link_path}/*
+%{_pkg_dir}/*
+%{_link_path}/*
 %{_prefix}/share/packages/%{name}.xml
-/etc/smack/accesses.d/%{name}.efl
+%{_sys_smack_dir}/%{name}.efl
 %{_datarootdir}/license/%{name}
 %{_datadir}/icons/default/small/%{name}.png
-
-/usr/apps/%{name}/res/locale/*/LC_MESSAGES/*
-
+%{_pkg_dir}/res/locale/*/LC_MESSAGES/*
index 2f4cad2..81f08cb 100755 (executable)
@@ -3,17 +3,10 @@ PROJECT(ug-setting-notification-app-notifications-efl C)
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(PROJECT_NAME "${PROJECT_NAME}")
 SET(LIBDIR "${PREFIX}/apps/${PROJECT_NAME}/lib/ug")
-SET(RESDIR "${PREFIX}/apps/${PROJECT_NAME}/res")
-SET(DATADIR "${PREFIX}/apps/${PROJECT_NAME}/data")
-#SET(LOCALEDIR "${RESDIR}/locale")
-SET(IMAGEDIR "${RESDIR}/images")
-SET(EDJEDIR "${RESDIR}/edje")
-SET(ETCDIR "${RESDIR}/etc")
 
 SET(VERSION_MAJOR 0)
 SET(VERSION "${VERSION_MAJOR}.0.1")
 
-
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs REQUIRED
        elementary
@@ -30,6 +23,7 @@ pkg_check_modules(pkgs REQUIRED
        capi-system-system-settings
        capi-appfw-app-manager
        capi-appfw-application
+       libtzplatform-config
 )
 
 SET(BUILD_SOURCE
@@ -39,18 +33,16 @@ SET(BUILD_SOURCE
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inc)
 ADD_DEFINITIONS(${pkgs_CFLAGS})
 ADD_DEFINITIONS("-DPKGNAME=\"${PROJECT_NAME}\"")
-#ADD_DEFINITIONS("-DLOCALE=\"${LOCALEDIR}\"")
-ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
 
 ADD_LIBRARY(${PROJECT_NAME} SHARED ${BUILD_SOURCE})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ug-setting-notification-efl) 
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ug-setting-notification-efl)
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inc)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ug-setting-notification-efl/inc) 
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ug-setting-notification-efl/inc)
 
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/apps/ug-setting-notification-efl/lib/ug)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR})
 
 MESSAGE("ug-setting-notification-do-not-disturb-efl End")
 
index e1ef7cf..380d151 100755 (executable)
@@ -21,6 +21,7 @@
 #include <libintl.h>
 #include <ui-gadget-module.h>
 #include <package_manager.h>
+#include <tzplatform_config.h>
 #include "notification-setting-info.h"
 #include "common-efl.h"
 
@@ -242,7 +243,7 @@ int UG_MODULE_INIT(struct ug_module_ops *ops)
        ops->priv = ugd;
        ops->opt = UG_OPT_INDICATOR_ENABLE;
 
-       if (bindtextdomain(PKGNAME, "/usr/apps/ug-setting-notification-efl/res/locale") == NULL) {
+       if (bindtextdomain(PKGNAME, tzplatform_mkpath(TZ_SYS_RO_APP, "ug-setting-notification-efl/res/locale")) == NULL) {
                /* Failed to allocate memory for allocating heap for store the path of LOCALE directory */
        }
 
index 69cbbbc..083d58f 100755 (executable)
@@ -3,14 +3,8 @@ PROJECT(ug-setting-notification-do-not-disturb-efl C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(PROJECT_NAME "${PROJECT_NAME}")
-SET(LIBDIR "${PREFIX}/apps/${PROJECT_NAME}/lib/ug")
-SET(RESDIR "${PREFIX}/apps/${PROJECT_NAME}/res")
-SET(DATADIR "${PREFIX}/apps/${PROJECT_NAME}/data")
-#SET(LOCALEDIR "${RESDIR}/locale")
-SET(IMAGEDIR "${RESDIR}/images")
-SET(EDJEDIR "${RESDIR}/edje")
-SET(ETCDIR "${RESDIR}/etc")
 
+SET(LIBDIR "${PREFIX}/lib/ug")
 SET(VERSION_MAJOR 0)
 SET(VERSION "${VERSION_MAJOR}.0.1")
 
@@ -30,6 +24,7 @@ pkg_check_modules(pkgs REQUIRED
        capi-system-system-settings
        capi-appfw-app-manager
        capi-appfw-application
+       libtzplatform-config
 )
 
 SET(BUILD_SOURCE
@@ -43,8 +38,6 @@ SET(BUILD_SOURCE
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inc)
 ADD_DEFINITIONS(${pkgs_CFLAGS})
 ADD_DEFINITIONS("-DPKGNAME=\"${PROJECT_NAME}\"")
-#ADD_DEFINITIONS("-DLOCALE=\"${LOCALEDIR}\"")
-ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
 
 ADD_LIBRARY(${PROJECT_NAME} SHARED ${BUILD_SOURCE})
 
@@ -55,7 +48,7 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inc)
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ug-setting-notification-efl/inc) 
 
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/apps/ug-setting-notification-efl/lib/ug)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR})
 
 MESSAGE("ug-setting-notification-do-not-disturb-efl End")
 
index 1e8b186..d30dd80 100755 (executable)
@@ -21,6 +21,7 @@
 #include <libintl.h>
 #include <ui-gadget-module.h>
 #include <package_manager.h>
+#include <tzplatform_config.h>
 #include "do-not-disturb-efl.h"
 #include "pkgmgr-setting-info.h"
 #include "excepted-apps-efl.h"
@@ -279,7 +280,7 @@ int UG_MODULE_INIT(struct ug_module_ops *ops)
        ops->priv = ugd;
        ops->opt = UG_OPT_INDICATOR_ENABLE;
 
-       if (bindtextdomain(PKGNAME, "/usr/apps/ug-setting-notification-efl/res/locale") == NULL) {
+       if (bindtextdomain(PKGNAME, tzplatform_mkpath(TZ_SYS_RO_APP, "ug-setting-notification-efl/res/locale"))== NULL) {
                /* Failed to allocate memory for allocating heap for store the path of LOCALE directory */
        }
 
index d181b55..d08bb0a 100755 (executable)
@@ -3,14 +3,20 @@ PROJECT(ug-setting-notification-efl C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(PROJECT_NAME "${PROJECT_NAME}")
-SET(LIBDIR "${PREFIX}/apps/${PROJECT_NAME}/lib/ug")
-SET(RESDIR "${PREFIX}/apps/${PROJECT_NAME}/res")
+SET(LIBDIR "${PREFIX}/lib/ug")
+SET(RESDIR "${PREFIX}/res")
 SET(DATADIR "${PREFIX}/apps/${PROJECT_NAME}/data")
-SET(LOCALEDIR "${RESDIR}/locale")
 SET(IMAGEDIR "${RESDIR}/images")
 SET(EDJEDIR "${RESDIR}/edje")
 SET(ETCDIR "${RESDIR}/etc")
 
+SET(LOCALEDIR "${RESDIR}/locale")
+SET(LICENSEDIR ${SYS_LICENSE_DIR})
+SET(PACKAGEDIR ${SYS_PACKAGES_DIR})
+SET(ICONDIR ${SYS_ICONS_DIR}/default/small/)
+SET(SMACKDIR ${SYS_SMACK_DIR})
+SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+
 SET(VERSION_MAJOR 0)
 SET(VERSION "${VERSION_MAJOR}.0.1")
 
@@ -30,6 +36,7 @@ pkg_check_modules(pkgs REQUIRED
        capi-system-system-settings
        capi-appfw-app-manager
        capi-appfw-application
+       libtzplatform-config
 )
 
 SET(BUILD_SOURCE
@@ -41,25 +48,20 @@ SET(BUILD_SOURCE
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inc)
 ADD_DEFINITIONS(${pkgs_CFLAGS} "-fPIC")
 ADD_DEFINITIONS("-DPKGNAME=\"${PROJECT_NAME}\"")
-#ADD_DEFINITIONS("-DLOCALE=\"${LOCALEDIR}\"")
 ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
 
 ADD_LIBRARY(${PROJECT_NAME} STATIC ${BUILD_SOURCE})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
-#TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${bin_pkgs_LDFLAGS})
-#SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
-#SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
 
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "${PROJECT_NAME}")
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.xml DESTINATION /usr/share/packages)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/${PROJECT_NAME}.png DESTINATION /usr/share/icons/default/small/)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.efl DESTINATION /etc/smack/accesses.d)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION ${LICENSEDIR} RENAME "${PROJECT_NAME}")
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.xml DESTINATION ${PACKAGEDIR})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/${PROJECT_NAME}.png DESTINATION ${ICONDIR})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.efl DESTINATION ${SMACKDIR})
 
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/apps/ug-setting-notification-efl/lib/ug)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR})
 
 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION ${IMAGEDIR}) 
 
-
 MESSAGE("ug-setting-notification-efl End")
 
 ADD_SUBDIRECTORY(res/po)
index 7f25a32..f539bc6 100755 (executable)
 #define _APPS_SE(fmt, arg...)  SECURE_LOG(LOG_ERROR, LOG_TAG_APPS, " "fmt, ##arg)
 #endif
 
-#ifdef ADD_FILE_LOG
-#define _F(fmt, arg...) do { \
-       FILE *fp;\
-       fp = fopen("/opt/usr/apps/org.tizen.w-home/data/logs", "a+");\
-       if (NULL == fp) break;\
-       fprintf(fp, "[%s:%d] "fmt"\n", __func__, __LINE__, ##arg); \
-       fclose(fp);\
-} while (0)
-#else
-#define _F(fmt, arg...) ;
-#endif
-
 #define retvm_if_timer(timer, expr, val, fmt, arg...) do { \
        if (expr) { \
                _E(fmt, ##arg); \
index bf14a3f..5741c54 100755 (executable)
 #include <tizen.h>
 #include "log.h"
 
-
-#define DEFAULT_ICON IMAGEDIR"/unknown.png"
-
-
 typedef struct {
        /* innate features */
        char *appid;
index a17438b..9ad1ce6 100755 (executable)
@@ -78,7 +78,7 @@ FOREACH(pofile ${POFILES})
                DEPENDS ${absPofile}
        )
 
-       INSTALL(FILES ${moFile} DESTINATION /usr/apps/${PROJECT_NAME}/res/locale/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo)
+       INSTALL(FILES ${moFile} DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo)
        SET(moFiles ${moFiles} ${moFile})
 ENDFOREACH(pofile)
 
index 5e416bb..cdf21e9 100755 (executable)
@@ -15,6 +15,7 @@
  *
  */
 
+#include <tzplatform_config.h>
 #include "pkgmgr-setting-info.h"
 #include "common-efl.h"
 
@@ -122,7 +123,7 @@ Evas_Object* create_icon(Evas_Object *parent, char* icon)
        Evas_Object *img = elm_image_add(parent);
 
        if(access(icon, 0) == -1) {
-               icon = strdup("/usr/share/icons/default/small/ug-setting-notification-efl.png");
+               icon = strdup(tzplatform_mkpath(TZ_SYS_RO_ICONS, "default/small/ug-setting-notification-efl.png"));
        }
        
        elm_image_file_set(img, icon, NULL);
@@ -133,9 +134,6 @@ Evas_Object* create_icon(Evas_Object *parent, char* icon)
        return img;
 }
 
-
-
-
 static char *gl_group_index_text_get_cb(void *data, Evas_Object *obj, const char *part)
 {
        char *text = (char*)data;