fix build fail in tv 54/128254/4 accepted/tizen/unified/20170510.013005 submit/tizen/20170508.090133
authorJeesun Kim <iamjs.kim@samsung.com>
Mon, 8 May 2017 07:58:23 +0000 (16:58 +0900)
committerJeesun Kim <iamjs.kim@samsung.com>
Mon, 8 May 2017 08:57:43 +0000 (17:57 +0900)
Change-Id: I64ed61bf725db0051a17e16dc1cca94a388c53a9

packaging/calendar-service.spec
server/CMakeLists.txt

index ae6e951a31ea247199c2363c95dad6bf2a2071de..8b575d286f4e8f77964bbb7e05d52c1378ce471b 100644 (file)
@@ -24,8 +24,14 @@ BuildRequires: pkgconfig(capi-base-common)
 BuildRequires: pkgconfig(capi-appfw-application)
 BuildRequires: pkgconfig(libsmack)
 BuildRequires: pkgconfig(capi-system-info)
+
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# TV profile does not have contacts-service2.
+# if wearable, ivi, common, mobile ||"undefined"
+%if "%{?profile}" != "tv"
 BuildRequires: pkgconfig(accounts-svc)
 BuildRequires: pkgconfig(contacts-service2)
+%endif
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 Provides: %{name}-compat = %{version}-%{release}
@@ -67,11 +73,19 @@ Calendar Service for using Calendar DB(development Kit)
 chmod g-w %_sourcedir/*
 cp %SOURCE1001 .
 
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# TV profile does not have contacts-service2.
+# if wearable, ivi, common, mobile ||"undefined"
+%if "%{?profile}" != "tv"
+%define _tizen_profile_tv 0
+%else
+%define _tizen_profile_tv 1
+%endif
 
 %build
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 %cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DBIN_INSTALL_DIR:PATH=%{_bindir} \
-               -DDBUS_INTERFACE=%{_dbus_interface}
+               -DDBUS_INTERFACE=%{_dbus_interface} -DTIZEN_PROFILE_TV=%{_tizen_profile_tv}
 
 make %{?jobs:-j%jobs}
 
@@ -109,15 +123,20 @@ mv %{_unitdir_user}/calendar-serviced.service %{_unitdir_user}/calendar-serviced
 
 
 %files
+%{_unitdir_user}/%{name}d.service
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# TV profile does not have contacts-service2.
+# if wearable, ivi, common, mobile ||"undefined"
+%if "%{?profile}" != "tv"
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
 %{_bindir}/calendar-serviced
-%{_unitdir_user}/%{name}d.service
 %{_datadir}/dbus-1/services/%{_dbus_interface}.service
 %config %{_sysconfdir}/dbus-1/session.d/%{name}.conf
 %{_datadir}/dbus-1/services/ALARM.acalendar-service.service
 %{upgrade_script_path}/500.%{name}.sh
 %license LICENSE.APLv2
+%endif
 
 
 %files profile_tv
index 111604f80de0a7bb7da1c32d8d5d8c85a74686b8..a0386faafdab8beb8abf2751ee20f138626f9444 100644 (file)
@@ -18,7 +18,10 @@ pkg_check_modules(daemon_pkgs REQUIRED glib-2.0 db-util sqlite3 vconf alarm-serv
        icu-i18n libtzplatform-config dlog capi-base-common capi-appfw-application
        libsmack gio-2.0 gio-unix-2.0 capi-system-info)
 
+MESSAGE(${TIZEN_PROFILE_TV})
+IF(${TIZEN_PROFILE_TV} EQUAL 0)
 pkg_check_modules(daemon_contacts_pkgs REQUIRED accounts-svc contacts-service2)
+ENDIF()
 
 INCLUDE_DIRECTORIES(${daemon_pkgs_INCLUDE_DIRS})
 LINK_DIRECTORIES(${daemon_pkgs_LIBRARY_DIRS})
@@ -34,18 +37,22 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--hash-style=both -pie")
 
 FOREACH(INCLUDE_DIR ${daemon_contacts_pkgs_INCLUDE_DIRS})
 SET(CONTACTS_CFLAGS "${CONTACTS_CFLAGS} -I${INCLUDE_DIR}")
-ENDFOREACH(FLAGS)
+ENDFOREACH(INCLUDE_DIR)
 
+IF(${TIZEN_PROFILE_TV} EQUAL 0)
 ADD_EXECUTABLE(${DAEMON} ${DAEMON_SRCS})
 ADD_DEPENDENCIES(${DAEMON} GENERATED_DBUS_CODE)
 SET_TARGET_PROPERTIES(${DAEMON} PROPERTIES COMPILE_FLAGS ${CONTACTS_CFLAGS})
 TARGET_LINK_LIBRARIES(${DAEMON} ${daemon_pkgs_LIBRARIES} ${daemon_contacts_pkgs_LIBRARIES})
+ENDIF()
 
 
 ADD_EXECUTABLE(${DAEMON}-tv ${DAEMON_SRCS})
 ADD_DEPENDENCIES(${DAEMON}-tv GENERATED_DBUS_CODE)
-TARGET_LINK_LIBRARIES(${DAEMON}-tv ${daemon_pkgs_LIBRARIES})
 SET_TARGET_PROPERTIES(${DAEMON}-tv PROPERTIES COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/without_contacts")
+TARGET_LINK_LIBRARIES(${DAEMON}-tv ${daemon_pkgs_LIBRARIES})
 
+IF(${TIZEN_PROFILE_TV} EQUAL 0)
 INSTALL(TARGETS ${DAEMON} DESTINATION ${BIN_INSTALL_DIR})
+ENDIF()
 INSTALL(TARGETS ${DAEMON}-tv DESTINATION ${BIN_INSTALL_DIR})