--- /dev/null
+cmake_minimum_required(VERSION 2.6)
+project(${PACKAGE} C CXX)
+
+include(FindPkgConfig)
+pkg_check_modules(TIZEN_PACKAGES REQUIRED
+ capi-appfw-application
+ contacts-service2
+ dlog
+ efl-extension
+ elementary
+)
+
+set(INCLUDES "${TIZEN_PACKAGES_INCLUDE_DIRS};inc")
+set(LIBRARY_DIRS "${TIZEN_PACKAGES_LIBRARY_DIRS}")
+set(LIBRARIES "${TIZEN_PACKAGES_LIBRARIES};dl;rt;")
+
+include_directories(${INCLUDES})
+link_directories(${LIBRARY_DIRS})
+
+set(CMAKE_INSTALL_RPATH ${LIBDIR})
+set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+
+set(COMPILER_FLAGS "-fpie -fPIC -Wall")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILER_FLAGS} -std=gnu99")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS} -std=c++11")
+
+add_definitions("-DPACKAGE=\"${PACKAGE}\"")
+add_definitions("-DLABEL=\"${LABEL}\"")
+add_definitions("-DRESDIR=\"${RESDIR}\"")
+add_definitions("-DEDJDIR=\"${EDJDIR}\"")
+add_definitions("-DIMGDIR=\"${IMGDIR}\"")
+
+add_subdirectory(lib-common)
+add_subdirectory(contacts)
--- /dev/null
+#!/bin/bash
+
+usage()
+{
+ echo "Usage: `basename $0` [-h|--help] [-e|--emulator] | [-d|--device] [-2|--tizen2] | [-3|--tizen3] [-i|--init] [-t|--test]
+ -h, --help Show this message.
+ -e, --emulator Build for emulator (default).
+ -d, --device Build for device.
+ -2, --tizen2 Build for Tizen 2.x (32-bit)
+ -3, --tizen3 Build for Tizen 3.0 (64-bit, default)
+ -i, --init Build online (without --noinit).
+ -t, --test Build with tests."
+}
+
+TARGET="e"
+TIZEN="3"
+NOINIT="--noinit"
+OPTS=$(getopt -o "edith23" -l "emulator,device,tizen2,tizen3,init,test,help" -- "$@" 2> /dev/null)
+
+if [ $? -ne 0 ]
+then
+ usage
+ exit 1
+fi
+
+for opt in $OPTS
+do
+ case $opt in
+ -e|--emulator)
+ TARGET="e"
+ ;;
+ -d|--device)
+ TARGET="d"
+ ;;
+ -2|--tizen2)
+ TIZEN="2"
+ ;;
+ -3|--tizen3)
+ TIZEN="3"
+ ;;
+ -i|--init)
+ NOINIT=""
+ ;;
+ -t|--test)
+ TEST=1
+ ;;
+ -h|--help)
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+if [ $TIZEN = "2" ]
+then
+ if [ $TARGET = "e" ]
+ then
+ ARCH="i586"
+ else
+ ARCH="armv7l"
+ fi
+else
+ if [ $TARGET = "e" ]
+ then
+ ARCH="x86_64"
+ else
+ ARCH="aarch64"
+ fi
+fi
+
+if [ -z $TEST ]
+then
+ gbs build -A $ARCH --include-all --keep-packs $NOINIT
+else
+ gbs build -A $ARCH --include-all --keep-packs $NOINIT --define 'TEST ON'
+fi
+
--- /dev/null
+cmake_minimum_required(VERSION 2.6)
+project(contacts C CXX)
+
+file(GLOB_RECURSE SOURCES src/*.c src/*.cpp)
+include_directories(
+ ${CMAKE_SOURCE_DIR}/lib-common/inc
+ ${CMAKE_CURRENT_SOURCE_DIR}/inc
+)
+
+add_executable(${PROJECT_NAME} ${SOURCES})
+target_link_libraries(${PROJECT_NAME} ${LIBRARIES} common -pie)
+
+install(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
+
+configure_file(tizen-manifest.xml.in ${PACKAGE}.xml)
+configure_file(smack.manifest.in ${CMAKE_SOURCE_DIR}/${PACKAGE}.manifest)
+configure_file(smack.efl.in ${PACKAGE}.efl)
+
+install(DIRECTORY shared/res/ DESTINATION ${ICONDIR})
+install(FILES ${PACKAGE}.xml DESTINATION ${MANIFESTDIR})
+install(FILES ${PACKAGE}.efl DESTINATION ${SMACKDIR})
--- /dev/null
+@PACKAGE@ device::app_logging rw---- ------
+@PACKAGE@ device::sys_logging rw---- ------
--- /dev/null
+<manifest>
+ <define>
+ <domain name="@PACKAGE@" />
+ </define>
+ <request>
+ <domain name="@PACKAGE@" />
+ </request>
+</manifest>
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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;
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="2.4" package="@PACKAGE@" version="1.0.0">
+ <profile name="mobile"/>
+ <ui-application appid="@PACKAGE@" exec="@BINDIR@/contacts" hw-acceleration="use-GL" multiple="false" nodisplay="false" taskmanage="true" type="capp">
+ <label>Contacts</label>
+ <label xml:lang="ar-ae">الأسماء</label>
+ <label xml:lang="az-az">Adlar</label>
+ <label xml:lang="bg-bg">Телефонен указател</label>
+ <label xml:lang="ca-es">Contactes</label>
+ <label xml:lang="cs-cz">Kontakty</label>
+ <label xml:lang="da-dk">Kontakter</label>
+ <label xml:lang="de-de">Kontakte</label>
+ <label xml:lang="el-gr">Επαφές</label>
+ <label xml:lang="en-gb">Contacts</label>
+ <label xml:lang="en-ph">Contacts</label>
+ <label xml:lang="en-us">Contacts</label>
+ <label xml:lang="es-es">Contactos</label>
+ <label xml:lang="es-mx">Contactos</label>
+ <label xml:lang="et-ee">Kontaktid</label>
+ <label xml:lang="eu-es">Kontaktuak</label>
+ <label xml:lang="fi-fi">Yhteystiedot</label>
+ <label xml:lang="fr-ca">Contacts</label>
+ <label xml:lang="fr-fr">Contacts</label>
+ <label xml:lang="ga-ie">Teagmhálaithe</label>
+ <label xml:lang="gl-es">Contactos</label>
+ <label xml:lang="hi-in">संपर्क</label>
+ <label xml:lang="hr-hr">Imenik</label>
+ <label xml:lang="hu-hu">Névjegyek</label>
+ <label xml:lang="hy-am">Կոնտակտներ</label>
+ <label xml:lang="is-is">Tengiliðir</label>
+ <label xml:lang="it-it">Rubrica</label>
+ <label xml:lang="ja-jp">電話帳</label>
+ <label xml:lang="ka-ge">კონტაქტები</label>
+ <label xml:lang="kk-kz">Контактілер</label>
+ <label xml:lang="ko-kr">연락처</label>
+ <label xml:lang="lt-lt">Adresatai</label>
+ <label xml:lang="lv-lv">Kontakti</label>
+ <label xml:lang="mk-mk">Именик</label>
+ <label xml:lang="nb-no">Kontakter</label>
+ <label xml:lang="nl-nl">Contacten</label>
+ <label xml:lang="pl-pl">Kontakty</label>
+ <label xml:lang="pt-br">Contatos</label>
+ <label xml:lang="pt-pt">Contactos</label>
+ <label xml:lang="ro-ro">Contacte</label>
+ <label xml:lang="ru-ru">Контакты</label>
+ <label xml:lang="sk-sk">Kontakty</label>
+ <label xml:lang="sl-si">Imenik</label>
+ <label xml:lang="sr-rs">Kontakti</label>
+ <label xml:lang="sv-se">Kontakter</label>
+ <label xml:lang="tr-tr">Rehber</label>
+ <label xml:lang="uk-ua">Контакти</label>
+ <label xml:lang="uz-uz">Kontaktlar</label>
+ <label xml:lang="zh-cn">联系人</label>
+ <label xml:lang="zh-hk">聯絡人</label>
+ <label xml:lang="zh-tw">聯絡人</label>
+ <icon>contacts.png</icon>
+ </ui-application>
+</manifest>
--- /dev/null
+#!/bin/bash
+
+usage()
+{
+ echo "Usage: `basename $0` [-h|--help] [-e|--emulator] [-d|--device]
+ -h, --help Show this message.
+ -e, --emulator Install on emulator (default).
+ -d, --device Install on device.
+ -2, --tizen2 Install on Tizen 2.x (32-bit)
+ -3, --tizen3 Install on Tizen 3.0 (64-bit, default)
+ -r, --rpm Install packages via RPM."
+}
+
+DEVS=($(sdb devices | tail -n+2))
+
+if [ -z $DEVS ]
+then
+ echo "Please connect device or launch emulator."
+ exit 1
+fi
+
+OPTS=$(getopt -o "hedr23" -l "help,emulator,tizen2,tizen3,device,rpm" -- "$@" 2> /dev/null)
+
+if [ $? -ne 0 ]
+then
+ usage
+ exit 1
+fi
+
+TARGET="e"
+TIZEN="3"
+
+for opt in $OPTS
+do
+ case $opt in
+ -e|--emulator)
+ TARGET="e"
+ ;;
+ -d|--device)
+ TARGET="d"
+ ;;
+ -2|--tizen2)
+ TIZEN="2"
+ ;;
+ -3|--tizen3)
+ TIZEN="3"
+ ;;
+ -h|--help)
+ usage
+ exit 0
+ ;;
+ -r|--rpm)
+ RPM=true
+ ;;
+ esac
+done
+
+if [ $TIZEN = "2" ]
+then
+ if [ $TARGET = "e" ]
+ then
+ ARCH="i586"
+ else
+ ARCH="armv7l"
+ fi
+else
+ if [ $TARGET = "e" ]
+ then
+ ARCH="x86_64"
+ else
+ ARCH="aarch64"
+ fi
+fi
+
+push()
+{
+ GBS=~/GBS-ROOT
+ ROOT=$GBS/local/BUILD-ROOTS/scratch.$ARCH.0
+
+ if [ ! -e $ROOT/*.conf ]
+ then
+ echo "Build root is not ready at $ROOT."
+ exit 1
+ fi
+
+ REPO=$(basename $ROOT/*.conf)
+ REPO=${REPO%.*}
+ RPMS=$GBS/local/repos/$REPO/$ARCH/RPMS
+
+ if [ ! -e "$RPMS/$1" ]
+ then
+ echo "Can't find $1 in $RPMS. Run build first."
+ exit 1
+ fi
+
+ echo "Pushing $1 into $2..."
+ sdb -$TARGET push "$RPMS/$1" "$2" 2> /dev/null
+}
+
+install()
+{
+ echo "Installing $2..."
+
+ if [ $RPM ]
+ then
+ sdb -$TARGET root on
+ sdb -$TARGET shell rpm -i --force "$1/$2"
+ sdb -$TARGET shell pkg_initdb
+ sdb -$TARGET root off
+ else
+ sdb -$TARGET shell pkgcmd -iqt rpm -p "$1/$2"
+ fi
+}
+
+deploy()
+{
+ push "$1" "$2"
+ install "$2" "$1"
+ sdb -$TARGET shell rm "$2/$1" > /dev/null
+}
+
+DEST=/tmp
+VER=$(grep Version: packaging/*.spec | awk '{print $2}')
+REL=$(grep Release: packaging/*.spec | awk '{print $2}')
+SUFFIX="$VER-$REL.$ARCH.rpm"
+
+PKG=$(grep Name: packaging/*.spec | awk '{print $2}')
+PKGS=($(grep %package packaging/*.spec | awk '{print $3}'))
+
+if [ -z $PKGS ]
+then
+ deploy "$PKG-$SUFFIX" "$DEST"
+else
+ echo "Current package contains several sub-packages:"
+ PKGS=($PKG ${PKGS[*]})
+ for i in ${!PKGS[@]}
+ do
+ echo "$((i + 1)). ${PKGS[$i]}"
+ done
+
+ echo "Specify packages and order of installation (for example: 5 1):"
+ read NUMS
+
+ for i in $NUMS
+ do
+ deploy "${PKGS[$((i - 1))]}-$SUFFIX" "$DEST"
+ done
+fi
+echo "Done."
+
--- /dev/null
+cmake_minimum_required(VERSION 2.6)
+project(common C CXX)
+
+file(GLOB_RECURSE SOURCES src/*.c src/*.cpp)
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}/inc
+)
+
+add_library(${PROJECT_NAME} SHARED ${SOURCES})
+target_link_libraries(${PROJECT_NAME} ${LIBRARIES})
+
+install(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR})
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ *
+ */
+
+#ifndef UTILS_TRACER_H
+#define UTILS_TRACER_H
+
+#include <time.h>
+
+namespace Utils
+{
+ /**
+ * @brief Code block logger. Writes logs when created and destroyed. Outputs elapsed time.
+ */
+ class Tracer
+ {
+ public:
+ /**
+ * @brief Create tracer and write entry log.
+ * @param[in] tag Log tag
+ * @param[in] file Current source file
+ * @param[in] func Current function
+ * @param[in] line Current source line
+ */
+ Tracer(const char *tag, const char *file, const char *func, int line);
+ ~Tracer();
+
+ private:
+ const char *m_Tag;
+ const char *m_File;
+ const char *m_Func;
+ timespec m_startTime;
+ };
+}
+
+#endif /* UTILS_TRACER_H */
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ *
+ */
+
+#include "Utils/Tracer.h"
+#include <dlog.h>
+
+using namespace Utils;
+
+void subtractTime(const timespec &a, const timespec &b, timespec &res)
+{
+ static const size_t ratio(1000000000);
+
+ res.tv_sec = b.tv_sec - a.tv_sec;
+ res.tv_nsec = b.tv_nsec - a.tv_nsec;
+ if (res.tv_nsec < 0)
+ {
+ --res.tv_sec;
+ res.tv_nsec += ratio;
+ }
+}
+
+Tracer::Tracer(const char *tag, const char *file, const char *func, int line)
+ : m_Tag(tag), m_File(file), m_Func(func)
+{
+ dlog_print(DLOG_DEBUG, m_Tag, "%s: %s(%d) <<< called", m_File, m_Func, line);
+ clock_gettime(CLOCK_REALTIME, &m_startTime);
+}
+
+Tracer::~Tracer()
+{
+ timespec endTime;
+ clock_gettime(CLOCK_REALTIME, &endTime);
+
+ timespec res;
+ subtractTime(m_startTime, endTime, res);
+
+ dlog_print(DLOG_DEBUG, m_Tag, "%s: %s >>> returned in %d.%03d seconds",
+ m_File, m_Func, res.tv_sec, res.tv_nsec / 1000000);
+}
--- /dev/null
+Name: org.tizen.contacts
+Version: 0.1
+Release: 1
+License: Apache-2.0
+Summary: Contacts and Phone Applications
+Group: Applications/Social
+Source: %{name}-%{version}.tar.gz
+
+BuildRequires: cmake
+BuildRequires: edje-bin
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(contacts-service2)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(efl-extension)
+BuildRequires: pkgconfig(elementary)
+
+%description
+Contacts and Phone Reference Applications.
+
+%define _pkgdir /usr/apps/%{name}
+%define _bindir %{_pkgdir}/bin
+%define _libdir %{_pkgdir}/lib
+%define _resdir %{_pkgdir}/res
+%define _manifestdir /usr/share/packages
+%define _icondir /usr/share/icons/default/small
+%define _smackdir /etc/smack/accesses.d
+
+%prep
+%setup -q
+
+%build
+cmake \
+ %{!?RELEASE: -DCMAKE_BUILD_TYPE=Debug }\
+ '-DPACKAGE=%{name}'\
+ '-DCMAKE_INSTALL_PREFIX=%{_pkgdir}'\
+ '-DBINDIR=%{_bindir}'\
+ '-DLIBDIR=%{_libdir}'\
+ '-DRESDIR=%{_resdir}'\
+ '-DMANIFESTDIR=%{_manifestdir}'\
+ '-DICONDIR=%{_icondir}'\
+ '-DSMACKDIR=%{_smackdir}'
+
+make %{?jobs:-j%jobs}
+
+%install
+%make_install
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%manifest %{name}.manifest
+%{_bindir}/*
+%{_libdir}/*.so
+%{_manifestdir}/%{name}.xml
+%{_icondir}/*.png
+%{_smackdir}/%{name}.efl