Separate Common and Mobile profile 43/205243/2 accepted/tizen/unified/20190502.051449 submit/tizen/20190501.101917
authorKartik Tidke <kr.tidke@samsung.com>
Wed, 1 May 2019 01:06:45 +0000 (06:36 +0530)
committerKartik Tidke <kr.tidke@samsung.com>
Wed, 1 May 2019 14:38:15 +0000 (20:08 +0530)
This patch differentiates common profile from mobile profile
Signed-off-by: Kartik Tidke <kr.tidke@samsung.com>
Change-Id: Ia9fd43fe456e9213a91cbdfe3817da2ca315a6a4

CMake/CMakeLists.txt
CMake/res/resource/CMakeLists.txt
packaging/org.tizen.indicator.spec
src/modules/clock/clock.c
src/modules/modules.c

index 6e6b375..14ee938 100644 (file)
@@ -14,6 +14,8 @@ SET(PROJECT_EDC_DIR "${PROJECT_RESOURCES_DIR}/resource")
 SET(PROJECT_IMAGES_DIR "${PROJECT_RESOURCES_DIR}/images")
 SET(PROJECT_PO_DIR "${PROJECT_RESOURCES_DIR}/po")
 
+IF("${TIZEN_PROFILE_NAME}" STREQUAL "MOBILE")
+
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs REQUIRED
        capi-appfw-application
@@ -52,6 +54,47 @@ pkg_check_modules(pkgs REQUIRED
        msg-service
 )
 
+ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "COMMON")
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+       capi-appfw-application
+       capi-appfw-preference
+       capi-appfw-app-control
+       capi-appfw-app-common
+       capi-appfw-event
+       capi-appfw-app-manager
+       capi-system-runtime-info
+       capi-network-bluetooth
+       capi-appfw-preference
+       capi-system-system-settings
+       capi-media-player
+       capi-media-sound-manager
+       capi-media-metadata-extractor
+       capi-network-wifi-manager
+       capi-ui-efl-util
+       appcore-common
+       dlog
+       elementary
+       notification
+       vconf
+       minicontrol-monitor
+       pkgmgr-info
+       tzsh-indicator-service
+       capi-system-device
+       capi-telephony
+       capi-network-wifi-direct
+       capi-network-tethering
+       storage
+       capi-base-utils-i18n
+       capi-message-port
+       callmgr_client
+       capi-ui-efl-util
+       msg-service
+)
+
+ENDIF()
+
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
@@ -65,6 +108,10 @@ INCLUDE_DIRECTORIES(${PROJECT_ROOT_DIR}/inc)
 AUX_SOURCE_DIRECTORY(${PROJECT_ROOT_DIR}/src DAEMON_SRCS)
 FILE(GLOB_RECURSE MODULE_SRCS ${PROJECT_ROOT_DIR}/src/modules/*.c)
 
+IF("${TIZEN_PROFILE_NAME}" STREQUAL "COMMON")
+list(REMOVE_ITEM MODULE_SRCS ${PROJECT_ROOT_DIR}/src/modules/setting/nfc.c)
+ENDIF()
+
 SET(SRCS ${DAEMON_SRCS} ${MODULE_SRCS})
 
 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
index 9cc5524..8c5db4c 100644 (file)
@@ -54,13 +54,13 @@ ADD_CUSTOM_TARGET(indicator_icon_animation.edj
 )
 ADD_DEPENDENCIES(${PROJECT_NAME} indicator_icon_animation.edj)
 
-INSTALL(FILES indicator_port.edj DESTINATION ${INSTALL_EDJEDIR})
-INSTALL(FILES ticker.edj DESTINATION ${INSTALL_EDJEDIR})
-INSTALL(FILES ticker_default.edj DESTINATION ${INSTALL_EDJEDIR})
-INSTALL(FILES ticker_animated_icon.edj DESTINATION ${INSTALL_EDJEDIR})
-INSTALL(FILES indicator_icon_theme.edj DESTINATION ${INSTALL_EDJEDIR})
-INSTALL(FILES indicator_icon_nonfixed_theme.edj DESTINATION ${INSTALL_EDJEDIR})
-INSTALL(FILES indicator_icon_animation.edj DESTINATION ${INSTALL_EDJEDIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/indicator_port.edj DESTINATION ${INSTALL_EDJEDIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ticker.edj DESTINATION ${INSTALL_EDJEDIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ticker_default.edj DESTINATION ${INSTALL_EDJEDIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ticker_animated_icon.edj DESTINATION ${INSTALL_EDJEDIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/indicator_icon_theme.edj DESTINATION ${INSTALL_EDJEDIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/indicator_icon_nonfixed_theme.edj DESTINATION ${INSTALL_EDJEDIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/indicator_icon_animation.edj DESTINATION ${INSTALL_EDJEDIR})
 
 INSTALL(DIRECTORY ${PROJECT_EDC_DIR}/icons DESTINATION ${INSTALL_EDJEDIR} FILES_MATCHING PATTERN "*.png")
 INSTALL(DIRECTORY ${PROJECT_EDC_DIR}/icons DESTINATION ${INSTALL_EDJEDIR} FILES_MATCHING PATTERN "*.PNG")
index a41e3eb..fade436 100644 (file)
@@ -5,7 +5,6 @@ Release:    1
 Group:      utils
 License:    Flora-1.1
 Source0:    %{name}-%{version}.tar.gz
-
 BuildRequires: pkgconfig(capi-appfw-application)
 BuildRequires: pkgconfig(capi-appfw-app-control)
 BuildRequires: pkgconfig(capi-appfw-app-common)
@@ -55,10 +54,32 @@ BuildRequires: gettext-tools
 BuildRequires: hash-signer
 
 Requires(post): /usr/bin/vconftool
+Requires:      %{name}-compat = %{version}-%{release}
+Recommends:    %{name}-profile_common = %{version}-%{release}
 
 %description
+This is for managing life-cycle of core applications.
 Indicator window reference implementation.
 
+%package profile_common
+Summary:       Indicator binary for common profile
+Provides:      %{name}-compat = %{version}-%{release}
+Conflicts:     %{name}-profile_mobile
+
+%description profile_common
+Indicator has different build options and source codes for each profile.
+This is for common/iot.
+
+%package profile_mobile
+Summary:       Indicator binary for mobile profile
+Provides:      %{name}-compat = %{version}-%{release}
+Conflicts:     %{name}-profile_common
+
+%description profile_mobile
+Indicator has different build options and source codes for each profile.
+This is for mobile.
+
+
 %prep
 %setup -q
 
@@ -75,32 +96,74 @@ Indicator window reference implementation.
 %define tizen_author_sign 1
 %define tizen_dist_sign 1
 
+export CFLAGS_COMMON="$CFLAGS"
+export CXXFLAGS_COMMON="$CXXFLAGS"
 
+#mobile
+export CFLAGS="$CFLAGS_COMMON -DTIZEN_PROFILE_MOBILE"
+export CXXFLAGS="$CXXFLAGS_COMMON -DTIZEN_PROFILE_MOBILE"
 cd CMake
-cmake . -DINSTALL_PREFIX=%{_pkg_dir} \
+mkdir -p build_mobile
+pushd build_mobile
+cmake .. -DTIZEN_PROFILE_NAME=MOBILE -DINSTALL_PREFIX=%{_pkg_dir} \
        -DSYS_ICONS_DIR=%{_sys_icons_dir} \
        -DSYS_PACKAGES_DIR=%{_sys_packages_dir}
 make %{?jobs:-j%jobs}
+popd
+
+#common
+export CFLAGS="$CFLAGS_COMMON -DTIZEN_PROFILE_COMMON"
+export CXXFLAGS="$CXXFLAGS_COMMON -DTIZEN_PROFILE_COMMON"
+mkdir -p build_common
+pushd build_common
+cmake .. -DTIZEN_PROFILE_NAME=COMMON -DINSTALL_PREFIX=%{_pkg_dir}/common/ \
+       -DSYS_ICONS_DIR=%{_sys_icons_dir} \
+       -DSYS_PACKAGES_DIR=%{_sys_packages_dir}
+make %{?jobs:-j%jobs}
+popd
 cd -
 
 
 %install
 rm -rf %{buildroot}
 cd CMake
+pushd build_common
+%make_install
+popd
+
+pushd build_mobile
 %make_install
+popd
 cd -
 
+mkdir -p %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
 %find_lang indicator-win
 
-
-%files -f indicator-win.lang
-%manifest %{name}.manifest
+%files -f CMake/build_mobile/indicator-win.lang
 %defattr(-,root,root,-)
+%license LICENSE
+
+#mobile
+%files profile_mobile
 %{_pkg_dir}/bin/*
 %{_pkg_dir}/res/resource/icons/*
 %{_pkg_dir}/res/resource/*.edj
 %{_sys_packages_dir}/%{name}.xml
+%manifest %{name}.manifest
 %{_pkg_dir}/author-signature.xml
 %{_pkg_dir}/signature1.xml
 
-%license LICENSE
+#common
+%files profile_common
+%{_pkg_dir}/common/bin/*
+%{_pkg_dir}/common/res/resource/icons/*
+%{_pkg_dir}/common/res/resource/*.edj
+%{_sys_packages_dir}/%{name}.xml
+%manifest %{name}.manifest
+%{_pkg_dir}/author-signature.xml
+%{_pkg_dir}/signature1.xml
+
+%post profile_common
+rm -rf %{_pkg_dir}/bin
+rm -rf %{_pkg_dir}/res
+mv %{_pkg_dir}/common/* %{_pkg_dir}/.
index 60523b0..9d676c9 100644 (file)
 
 #define SYSTEM_RESUME          "system_wakeup"
 
+#ifdef TIZEN_PROFILE_COMMON
+#define TIME_FONT_SIZE_24              50
+#define TIME_FONT_SIZE_12              50
+#define AMPM_FONT_SIZE         49
+#else
 #define TIME_FONT_SIZE_24              30
 #define TIME_FONT_SIZE_12              30
 #define AMPM_FONT_SIZE         29
+#endif
 
 #define TIME_FONT_COLOR                200, 200, 200, 255
 #define AMPM_FONT_COLOR                200, 200, 200, 255
index cf9dce0..10bb5dc 100644 (file)
@@ -47,7 +47,10 @@ extern icon_s voice_recorder;
 extern icon_s silent;
 extern icon_s bluetooth;
 extern icon_s gps;
+
+#ifdef TIZEN_PROFILE_MOBILE
 extern icon_s nfc;
+#endif
 extern icon_s dnd;
 
 /* Clock */
@@ -102,7 +105,9 @@ static icon_s *modules[] = {
        &silent,
        &bluetooth,
        &gps,
+#ifdef TIZEN_PROFILE_MOBILE
        &nfc,
+#endif
        &dnd,
 
        /*Smart Stay*/