TizenRefApp-5147 complex fix: 21/53421/3
authorAndrey Klimenko <and.klimenko@samsung.com>
Fri, 4 Dec 2015 16:54:05 +0000 (18:54 +0200)
committerAndrey Klimenko <and.klimenko@samsung.com>
Fri, 4 Dec 2015 17:09:15 +0000 (19:09 +0200)
- TizenRefApp-5150, TizenRefApp-5151 fixed issue with invisible settings ug(do not disturb + App Notifications)
- TizenRefApp-5173, modified default manifest
- returned back multiuser feature

Change-Id: Ic7492579a04e3cdcd7d0695ed2b57873f036b090
Signed-off-by: Andrey Klimenko <and.klimenko@samsung.com>
13 files changed:
CMakeLists.txt
packaging/ug-setting-notification-efl.manifest
packaging/ug-setting-notification-efl.spec
run.sh [new file with mode: 0755]
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 df1128880faa5dfac4784a31d46bc42749d8787b..0ec61c5d9783cce0f7ad97a3b62fead1f18440d7 100755 (executable)
@@ -4,7 +4,7 @@ ADD_SUBDIRECTORY(ug-setting-notification-efl)
 ADD_SUBDIRECTORY(ug-setting-notification-do-not-disturb-efl)
 ADD_SUBDIRECTORY(ug-setting-notification-app-notifications-efl)
 
-ADD_DEPENDENCIES(ug-setting-notification-do-not-disturb-efl ug-setting-notification-efl)
-ADD_DEPENDENCIES(ug-setting-notification-app-notifications-efl ug-setting-notification-efl)
+ADD_DEPENDENCIES(ug-ug-setting-notification-do-not-disturb-efl ug-setting-notification-efl)
+ADD_DEPENDENCIES(ug-ug-setting-notification-app-notifications-efl ug-setting-notification-efl)
 
 MESSAGE("notification-setting main End")
index cf497893f1a53a187dc6a0286d5cfef8014e49b3..97e8c3134908aa65aaf95cec6195b148dff5b49f 100755 (executable)
@@ -1,13 +1,5 @@
 <manifest>
-       <define>
-               <domain name="ug-setting-notification-efl" />
-       </define>
        <request>
-               <domain name="ug-setting-notification-efl" />
+               <domain name="_"/>
        </request>
-       <assign>
-               <filesystem path="/usr/share/icons/default/small/ug-setting-notification-efl.png" label="_"/>
-      <filesystem path="/opt/usr/apps/ug-setting-notification-efl/res/*" label="_"/>
-       </assign>
-
 </manifest>
index 008a72b5c17f4d9ce860263573323fd54f185c1e..db1835140c4ac975098091aa29ef5a2e834ce9f5 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
@@ -57,10 +57,7 @@ Description: do not disturb efl
 %setup -q
 cp %{SOURCE1001} .
 
-
-
 %build
-
 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
@@ -71,34 +68,27 @@ export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
 %endif
 
-%cmake .
+%cmake . -DCMAKE_INSTALL_PREFIX=%{TZ_SYS_RO_UG} \
+         -DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} \
+         -DSYS_SHARE_DIR=%{TZ_SYS_SHARE}
+
 make -j2
 
 %install
 %make_install
-mkdir -p %{buildroot}/usr/apps/ug-setting-notification-efl/bin
-ln -sf /usr/bin/ug-client %{buildroot}/usr/apps/ug-setting-notification-efl/bin/ug-setting-notification-efl
-ln -sf /usr/bin/ug-client %{buildroot}/usr/apps/ug-setting-notification-efl/bin/ug-setting-notification-do-not-disturb-efl
-ln -sf /usr/bin/ug-client %{buildroot}/usr/apps/ug-setting-notification-efl/bin/ug-setting-notification-app-notifications-efl
-
 
-#mkdir -p %{buildroot}/usr/ug/bin
-#ln -sf /usr/bin/ug-client %{buildroot}/usr/ug/bin/ug-setting-notification-efl
-
-mkdir -p %{buildroot}/usr/apps/ug-setting-notification-efl/res
+mkdir -p %{buildroot}%{TZ_SYS_RO_UG}/bin/
+ln -sf /usr/bin/ug-client %{buildroot}%{TZ_SYS_RO_UG}/bin/ug-setting-notification-efl
+ln -sf /usr/bin/ug-client %{buildroot}%{TZ_SYS_RO_UG}/bin/ug-setting-notification-do-not-disturb-efl
+ln -sf /usr/bin/ug-client %{buildroot}%{TZ_SYS_RO_UG}/bin/ug-setting-notification-app-notifications-efl
 
 %post -n %{name} -p /sbin/ldconfig
 
 %postun -n %{name} -p /sbin/ldconfig
 
-
 %files
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
-%{_prefix}/apps/%{name}/*
-%{_prefix}/share/packages/%{name}.xml
-%{_datarootdir}/license/%{name}
-%{_datadir}/icons/default/small/ug-setting-notification-efl.png
-
-/usr/apps/ug-setting-notification-efl/res/locale/*/LC_MESSAGES/*
-
+%{TZ_SYS_RO_UG}/*
+%{TZ_SYS_RO_PACKAGES}/*
+%{TZ_SYS_SHARE}/license/%{name}
diff --git a/run.sh b/run.sh
new file mode 100755 (executable)
index 0000000..da05045
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,413 @@
+#!/bin/bash
+
+usage()
+{
+echo "
+usage: sh run.sh [-h] [-b] [-i] [-r] [-t] [-d] [-A ARCH]
+                 [--help] [--build] [--install] [--run] [--test] [--debug] [--arch ARCH]
+
+optional arguments:
+  -h, --help             show this help message and exit
+
+action:
+  -b  --build           build project
+  -i, --install         install to device or emulator
+  -r, --run             run application. Don't use with -t option
+  -t, --test            builds unit-tests as well, ignored without -b option
+  -d, --debug           install debuginfo and debugsource packages
+  -l, --local          local incremental build(with --noinit --incremental kwys)
+
+build configuration options:
+  -A ARCH, --arch ARCH   build target arch. Default - armv7l
+  -b 'Keys', --build 'Keys'  build project with additional gbs build keys
+
+  examples:
+  'run.sh -b -t -i -A armv7l' will build application and try to install it to target-device, unit-tests will be also built
+  'run.sh -i -A armv7l[i586|aarch64]' will install latest build for tizen-2.4 device [emulator|tizen-3.0 device]
+"
+}
+
+##-------------- check options --------------##
+
+if [ -z "$1" ]; then usage; exit 0; fi
+
+BUILDOPTION=false
+BUILDKEYS=""
+INSTALLOPTION=false
+RUNOPTION=false
+DEBUGOPTION=false
+TESTOPTION=false
+PLATFORM=armv7l
+LOCALBUILD=false
+
+SHORTOPTS="hA:b::irdtl"
+LONGOPTS="arch:,build::,install,run,debug,test,help,local"
+SCRIPTNAME=`basename $0`
+
+ARGS=$(getopt -q --options "$SHORTOPTS" --longoptions "$LONGOPTS" --name $SCRIPTNAME -- "$@")
+
+while true; do
+   case $1 in
+      -h|--help)
+         usage
+         exit 0
+         ;;
+      -A|--arch)
+         val=`echo $2 | sed -e "s/-//g"`
+         if echo "$SHORTOPTS$LONGOPTS" | grep -q "$val"; then
+           echo "Wrong ARCH"
+           usage
+           exit 0;
+         fi
+         PLATFORM=$2
+         shift
+         ;;
+      -b|--build)
+         BUILDOPTION=true
+         key=`echo $2 | sed -e "s/-//g"`
+         if ! echo "$SHORTOPTS$LONGOPTS" | grep -q "$key"; then
+           BUILDKEYS=$2
+           shift
+         fi
+         ;;
+      -i|--install)
+         INSTALLOPTION=true
+         ;;
+      -r|--run)
+         RUNOPTION=true
+         ;;
+      -d|--debug)
+         DEBUGOPTION=true
+         ;;
+      -t|--test)
+         TESTOPTION=true
+         ;;
+      -l|--local)
+         LOCALBUILD=true
+         ;;
+      --)
+         break
+         ;;
+      *)
+         if [ ! -z "$1" ]; then usage; exit 0; fi
+         break
+         ;;
+   esac
+   shift
+done
+
+echo "BUILDOPTION=$BUILDOPTION"
+echo "BUILDKEYS=$BUILDKEYS"
+echo "INSTALLOPTION=$INSTALLOPTION"
+echo "RUNOPTION=$RUNOPTION"
+echo "DEBUGOPTION=$DEBUGOPTION"
+echo "TESTOPTION=$TESTOPTION"
+echo "PLATFORM=$PLATFORM"
+
+##------------- project config -------------##
+
+PREFIX="org.tizen"
+INSTALLDIR=/usr/apps
+SDB=~/tizen-sdk/tools/sdb
+TEMPDIR=/home/rpms # for keeping rpm packages on device
+GBSROOT=~/GBS-ROOT
+
+##------------------ spec ------------------##
+
+spec_file=`find -name *.spec`
+
+# org.tizen.message
+APPNAME=`cat "$spec_file" | grep ^Name    | awk '{print $2}'`
+# 0.8.52
+VERSION=`cat "$spec_file" | grep ^Version | awk '{print $2}'`
+# 1
+RELEASE=`cat "$spec_file" | grep ^Release | awk '{print $2}'`
+# message
+BINNAME=`echo $APPNAME | sed "s/$PREFIX\.//"`
+
+RPMSPATH=$GBSROOT/local/BUILD-ROOTS/scratch.$PLATFORM.0/home/abuild/rpmbuild/RPMS/$PLATFORM
+
+DEBUGSOURCEPKGNAME=$APPNAME-debugsource-$VERSION-$RELEASE.$PLATFORM
+DEBUGINFOPKGNAME=$APPNAME-debuginfo-$VERSION-$RELEASE.$PLATFORM
+
+##-----------------------------------------##
+
+hasPrefix()
+{
+  if echo "$1" | grep -q "$PREFIX"; then
+    return 0;
+  else
+    return 1;
+  fi
+}
+
+##--------------- sdb shell ---------------##
+
+SdbShell()
+{
+  ShowMessage "$1" -c yellow
+  $SDB shell su -c "$1"
+}
+
+##--------------- color echo --------------##
+
+# arguments:
+# $1 : message text
+# -c|--color : text color (red, green, blue, yellow). Default value - blue
+# -n|--noti : show GUI notification
+# -s|--secondary : secondary message text
+# example: ShowMessage "Message to show" -c red --noti -s "Some additional text"
+
+ShowMessage()
+{
+    show_noti=false
+    color_val=""
+    message_sec=""
+    message=""
+
+    while [[ $# > 0 ]]; do
+      key="$1"
+
+      case $key in
+        -c|--color)
+        color_val="$2"
+        shift # past argument
+        ;;
+        -s|--secondary)
+        message_sec="$2"
+        shift # past argument
+        ;;
+        -n|--noti)
+        show_noti=true
+        ;;
+        *)
+        message="$1"
+        ;;
+      esac
+      shift # past argument or value
+    done
+
+    case "$color_val" in
+    "green")
+      color="32m"
+      noti_icon="-i $PWD/edje/images/icon_emotion_sunglasses.png"
+      ;;
+    "red")
+      color="31m"
+      noti_icon="-i $PWD/edje/images/icon_emotion_angry.png"
+      ;;
+    "blue")
+      color="34m"
+      ;;
+    "yellow")
+      color="33m"
+      ;;
+    *)
+      color="34m"
+      ;;
+    esac
+
+    echo -e "\033[1;"$color$message $message_sec"\033[0m"
+    if [ $show_noti = "true" ]; then
+      notify-send -u critical $noti_icon "$message" "$message_sec"
+    fi
+}
+
+##----------- check connection ------------##
+
+checkConnection()
+{
+    sdbstate=$($SDB get-state)
+    if [ $sdbstate = "unknown" ]
+      then
+        ShowMessage "Connection error." -c red --noti -s "Make sure that only one device or emulator is connected."
+        exit 0
+    fi
+}
+
+##---------------- build ------------------##
+
+build()
+{
+    ShowMessage "Building application..."
+
+    gbsoutput="gbsoutput.log"
+
+    if [ $LOCALBUILD = "true" ];
+    then
+      BUILDKEYS="$BUILDKEYS --noinit --incremental"
+    fi
+
+    if [ $TESTOPTION = "true" ];
+    then
+      BUILDKEYS+=" --define 'TEST%20ON'"
+    fi
+
+    ShowMessage "gbs -v -d build -B $GBSROOT -A $PLATFORM --include-all --keep-packs $BUILDKEYS"
+    gbs -v -d build -B $GBSROOT -A $PLATFORM --include-all --keep-packs $BUILDKEYS 2>&1 | tee $gbsoutput
+
+    if cat "$gbsoutput" | grep -q "gbs:info: Done"; then
+      ShowMessage "Build successfull!" -s "In glory of Tizen!" -c green --noti
+      rm -f $gbsoutput;
+    else
+      comp_error=$(cat "$gbsoutput" | grep "error:"| sed '/Bad exit status/,//d; s/\[.*\/\(.*\) error:/\\nerror in \1/;')
+      ShowMessage "Build failed!" -s "$comp_error" -c red --noti
+      rm -f $gbsoutput
+      exit 0;
+    fi
+}
+
+##-----------------------------------------##
+
+# figure out which packages need to be installed
+
+initPackageList()
+{
+    packages_count=`cat "$spec_file" | grep -c %package`
+
+    # if packages count more then 1
+    if [ $packages_count -gt 1 ]
+      then
+        ShowMessage "When building the project is generated $packages_count (+ debuginfo and debugsource) RPM packages"
+        # case of multipackage project
+        PACKAGELIST=`cat "$spec_file" | grep %package | sed 's/-n//' |awk '{print $2}'`
+      else
+        ShowMessage "one package"
+        # only one package into package list
+        PACKAGELIST=$APPNAME
+    fi
+}
+
+##------------ Uninstalling ---------------##
+
+uninstall()
+{
+    ShowMessage "Stopping old application..."
+    SdbShell "pkill -f $APPNAME"
+
+    for current_package in $PACKAGELIST
+    do
+      ShowMessage "Uninstalling old application $current_package..."
+      if hasPrefix $current_package; then
+        # uninstall with pkgcmd
+        SdbShell "pkgcmd -q -u -n $current_package"
+      else
+        # uninstall with rpm
+        SdbShell "rpm -e --nodeps $current_package-*"
+      fi
+    done
+
+    if [ $DEBUGOPTION = "true" ]
+      then
+        SdbShell "rpm -e --nodeps $APPNAME-debugsource-*"
+        SdbShell "rpm -e --nodeps $APPNAME-debuginfo-*"
+    fi
+}
+
+##-------------- Pushing ------------------##
+
+push()
+{
+    SdbShell "mkdir -p $TEMPDIR/"
+
+    for current_package_name in $PACKAGELIST
+    do
+      current_package=$current_package_name-$VERSION-$RELEASE.$PLATFORM.rpm
+      ShowMessage "Pushing the package $current_package to device ..."
+      $SDB push $RPMSPATH/$current_package $TEMPDIR/
+    done
+
+    if [ $DEBUGOPTION = "true" ]
+      then
+        $SDB push $RPMSPATH/$DEBUGSOURCEPKGNAME.rpm $TEMPDIR/
+        $SDB push $RPMSPATH/$DEBUGINFOPKGNAME.rpm $TEMPDIR/
+    fi
+}
+
+##------------- Installing ----------------##
+
+install()
+{
+    for current_package_name in $PACKAGELIST
+    do
+      current_package=$current_package_name-$VERSION-$RELEASE.$PLATFORM.rpm
+      ShowMessage "Installing the package $current_package ..."
+      #$SDB install $RPMSPATH/$current_package
+      #if hasPrefix $current_package; then
+        # install with pkgcmd
+        #SdbShell "pkgcmd -q -i -t rpm -p $TEMPDIR/$current_package"
+      #else
+        # uninstall with rpm
+        SdbShell "rpm -ivh --force --nodeps $TEMPDIR/$current_package"
+      #fi
+    done
+
+    if [ $DEBUGOPTION = "true" ]
+      then
+        ShowMessage "Installing the package $DEBUGINFOPKGNAME.rpm ..."
+        SdbShell "rpm -i $TEMPDIR/$DEBUGINFOPKGNAME.rpm"
+        ShowMessage "Installing the package $DEBUGSOURCEPKGNAME.rpm ..."
+        SdbShell "rpm -i $TEMPDIR/$DEBUGSOURCEPKGNAME.rpm"
+    fi
+
+    SdbShell "pkg_initdb"
+}
+
+##--------------- Running ----------------##
+
+run()
+{
+  if hasPrefix $APPNAME; then
+    ABSOLUTEPATHTOAPP=$INSTALLDIR/$APPNAME/bin/$BINNAME
+  else
+    fullappname=`echo $APPNAME | sed "s/^/$PREFIX\./"`
+    ABSOLUTEPATHTOAPP=$INSTALLDIR/$fullappname/bin/$BINNAME
+  fi
+
+  if  [ $1 = "tests" ]
+    then
+      TESTAPP=$ABSOLUTEPATHTOAPP-test
+      # todo: stop old test-run
+      ShowMessage "running the $TESTAPP..."
+      SdbShell "$TESTAPP"
+    else
+      SdbShell "pkill -f $APPNAME"
+      ShowMessage "running the $ABSOLUTEPATHTOAPP..."
+      SdbShell "$ABSOLUTEPATHTOAPP"
+  fi
+}
+
+##-----------------------------------------##
+
+installApp()
+{
+  checkConnection
+  initPackageList
+
+  $SDB root on
+  #uninstall
+  push
+  install
+
+  $SDB root off
+}
+
+runApp()
+{
+  checkConnection
+  run
+}
+
+runTest()
+{
+  checkConnection
+  run tests
+}
+
+##------------------ main -----------------##
+
+if [ $BUILDOPTION = "true" ]; then build; fi
+if [ $INSTALLOPTION = "true" ]; then installApp; fi
+if [ $RUNOPTION = "true" ]; then runApp; fi
+
+##-----------------------------------------##
index 2f4cad2e9fedb0b85eec72574619cb32c6e27ca4..1eb9789ea02258a47249827087ec7f411ae9deda 100755 (executable)
@@ -1,19 +1,12 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(ug-setting-notification-app-notifications-efl C)
+PROJECT(ug-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(LIBDIR "${PREFIX}/lib")
 
 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,19 +33,17 @@ 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")
+MESSAGE("ug-ug-setting-notification-app-notifications-efl End")
 
 # End of a file
index e1ef7cf97fa1591b1fe55e18adb3587912bb6c37..380d1518718b39a8195d2b00487bd57431eaf2ed 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 69cbbbc3bdcbde78043570a18bd7ad7099bb79ed..b351d74eeb804b0d5de7483207e8445cd0e60d82 100755 (executable)
@@ -1,15 +1,9 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(ug-setting-notification-do-not-disturb-efl C)
+PROJECT(ug-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")
 
 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,8 +48,8 @@ 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")
+MESSAGE("ug-ug-setting-notification-do-not-disturb-efl End")
 
 # End of a file
index 1e8b1861d9b0a9201037816f1bae85e483766e82..d30dd803f307b6e584ffc9ec134dc3127ed94d97 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 3450559d74cb1ea448e20f5a083ac048921e7d61..ae02f808dc1e1d20cf6dcb18093578c66bcefde1 100755 (executable)
@@ -3,13 +3,14 @@ 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(DATADIR "${PREFIX}/apps/${PROJECT_NAME}/data")
-SET(LOCALEDIR "${RESDIR}/locale")
+
+SET(LIBDIR "${PREFIX}/lib")
+SET(RESDIR "${PREFIX}/res")
 SET(IMAGEDIR "${RESDIR}/images")
-SET(EDJEDIR "${RESDIR}/edje")
-SET(ETCDIR "${RESDIR}/etc")
+SET(LICENSEDIR "${SYS_SHARE_DIR}/license")
+SET(PACKAGEDIR ${TZ_SYS_RO_PACKAGES})
+SET(ICONDIR "${PREFIX}/default/small/")
+SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
 
 SET(VERSION_MAJOR 0)
 SET(VERSION "${VERSION_MAJOR}.0.1")
@@ -30,6 +31,7 @@ pkg_check_modules(pkgs REQUIRED
        capi-system-system-settings
        capi-appfw-app-manager
        capi-appfw-application
+       libtzplatform-config
 )
 
 SET(BUILD_SOURCE
@@ -41,23 +43,18 @@ 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(TARGETS ${PROJECT_NAME} DESTINATION /usr/apps/ug-setting-notification-efl/lib/ug)
+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(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION ${IMAGEDIR}) 
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR})
 
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION ${IMAGEDIR}) 
 
 MESSAGE("ug-setting-notification-efl End")
 
index 7f25a32e9bde99298713933fb8438f28cb4357f3..f539bc675e0488098ef890298063ccc6e1a447dc 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 bf14a3f95fa5ddee6c279d1e60f0e94e69a08a83..5741c545d72078ad3caea441e51dc1495765767d 100755 (executable)
 #include <tizen.h>
 #include "log.h"
 
-
-#define DEFAULT_ICON IMAGEDIR"/unknown.png"
-
-
 typedef struct {
        /* innate features */
        char *appid;
index a17438b17c652fb5de1049d2c91b6afff5b98809..3466f69a1eb3a4b03b6f031bd2256f9cd598daa8 100755 (executable)
@@ -1,5 +1,7 @@
 # for i18n
 
+SET(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/res/locale")
+
 SET(POFILES 
        ar.po
        az.po
@@ -78,7 +80,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 5e416bb08ac41216b1d5cc3be1bec99a4ed8c6f0..57bc6f2e68d8696a885ef1a30109f1053d155106 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);