Remove build dependencies on profile 42/116442/1
authorpr.jung <pr.jung@samsung.com>
Fri, 24 Feb 2017 09:05:39 +0000 (18:05 +0900)
committerpr.jung <pr.jung@samsung.com>
Fri, 24 Feb 2017 09:05:39 +0000 (18:05 +0900)
- Remove build dependencies of svi-data

Change-Id: I7d1b3fada53e0eeb3bdd19caa2f94c6aac0750ff
Signed-off-by: pr.jung <pr.jung@samsung.com>
CMakeLists.txt
packaging/libfeedback.spec

index 9b4a3b0fc30e45edd97668507267a805e878b96c..486bca070d6f492ac9521f2799d5a7a0264f2234 100644 (file)
@@ -6,12 +6,9 @@ SET(EXEC_PREFIX "\${prefix}")
 SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
 SET(VERSION 0.1.4)
 
-IF(NOT "${PROFILE}" STREQUAL "mobile")
-       IF(NOT "${PROFILE}" STREQUAL "wearable")
-               SET(PROFILE "common")
-       ENDIF()
-ENDIF()
-SET(FEEDBACK_PROFILE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${PROFILE})
+SET(COMMON_PROFILE "common")
+SET(MOBILE_PROFILE "mobile")
+SET(WEARABLE_PROFILE "wearable")
 
 SET(SRCS
        src/sound.c
@@ -20,7 +17,7 @@ SET(SRCS
        src/parser.c
        src/feedback.c
        src/dbus.c
-       ${FEEDBACK_PROFILE_PATH}/src/check.c)
+       src/check.c)
 
 SET(HEADERS
        include/feedback.h
@@ -33,10 +30,9 @@ ADD_DEFINITIONS("-DFEEDBACK_SYS_RO_SHARE=\"${TZ_SYS_RO_SHARE}\"")
 
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
-INCLUDE_DIRECTORIES(${FEEDBACK_PROFILE_PATH}/include)
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED vconf mm-keysound dlog glib-2.0 dbus-1 gio-2.0)
+pkg_check_modules(pkgs REQUIRED vconf mm-keysound dlog glib-2.0 dbus-1 gio-2.0 capi-system-info)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
@@ -57,4 +53,6 @@ CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
 INSTALL(FILES ${HEADERS} DESTINATION include/${PROJECT_NAME})
-INSTALL(DIRECTORY ${FEEDBACK_PROFILE_PATH}/data/ DESTINATION share/${PROJECT_NAME})
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${COMMON_PROFILE}/data/ DESTINATION share/${COMMON_PROFILE})
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${MOBILE_PROFILE}/data/ DESTINATION share/${MOBILE_PROFILE})
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${WEARABLE_PROFILE}/data/ DESTINATION share/${WEARABLE_PROFILE})
index 022e954cb203786bc8809bd05405fcbf9f181d84..1fb26661808476c597a297e8dc950760e5962bca 100644 (file)
@@ -18,6 +18,7 @@ BuildRequires:  pkgconfig(gio-2.0)
 BuildRequires:  pkgconfig(capi-base-common)
 BuildRequires:  pkgconfig(dbus-1)
 BuildRequires:  pkgconfig(libtzplatform-config)
+BuildRequires:  pkgconfig(capi-system-info)
 Requires(post):        svi-data
 
 %description
@@ -39,6 +40,36 @@ Group:               Development/Libraries
 %description -n svi-data
 svi resource package
 
+%package -n svi-data-profile_common
+Summary:       svi resource package body without mobile/wearable mods
+Provides:      svi-data-compat = %{version}-%{release}
+Provides:      svi-data-profile_tv = %{version}-%{release}
+Provides:      svi-data-profile_ivi = %{version}-%{release}
+Conflicts:     svi-data-profile_mobile
+Conflicts:     svi-data-profile_wearable
+%description -n svi-data-profile_common
+default set for svi resource package (not for mobile or wearable).
+
+%package -n svi-data-profile_mobile
+Summary:       svi resource package body without mobile/wearable mods
+Provides:      svi-data-compat = %{version}-%{release}
+Provides:      svi-data-profile_tv = %{version}-%{release}
+Provides:      svi-data-profile_ivi = %{version}-%{release}
+Conflicts:     svi-data-profile_common
+Conflicts:     svi-data-profile_wearable
+%description -n svi-data-profile_mobile
+default set for svi resource package (not for mobile or wearable).
+
+%package -n svi-data-profile_wearable
+Summary:       svi resource package body without mobile/wearable mods
+Provides:      svi-data-compat = %{version}-%{release}
+Provides:      svi-data-profile_tv = %{version}-%{release}
+Provides:      svi-data-profile_ivi = %{version}-%{release}
+Conflicts:     svi-data-profile_common
+Conflicts:     svi-data-profile_mobile
+%description -n svi-data-profile_wearable
+default set for svi resource package (not for mobile or wearable).
+
 %prep
 %setup -q
 
@@ -49,14 +80,19 @@ cp %{SOURCE2} .
 
 %cmake . \
                -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-               -DPROFILE=%{profile} \
                -DTZ_SYS_RO_SHARE=%{_datadir} \
                -DTZ_SYS_SHARE=%{TZ_SYS_SHARE}
 make
 
 %install
 rm -rf %{buildroot}
+
 %make_install
+pushd %{buildroot}%{_datadir}
+mv common feedback
+mv mobile feedback.mobile
+mv wearable feedback.wearable
+popd
 
 mkdir -p %{buildroot}%{_datadir}/license
 cp LICENSE %{buildroot}%{_datadir}/license/%{name}
@@ -85,9 +121,30 @@ rm -rf %{TZ_SYS_SHARE}/feedback/
 %{_libdir}/pkgconfig/feedback.pc
 
 %files -n svi-data
-%defattr(644,root,root,-)
-%{_datadir}/feedback/*
 %defattr(666,app,app,-)
 %dir %{TZ_SYS_SHARE}/feedback/haptic/custom
 %{_datadir}/license/svi-data
 %manifest svi-data.manifest
+
+%files -n svi-data-profile_common
+%defattr(644,root,root,-)
+%{_datadir}/feedback/*
+%manifest svi-data.manifest
+
+%post -n svi-data-profile_mobile
+ln -sf feedback.mobile %{_datadir}/feedback
+%preun -n svi-data-profile_mobile
+rm -f %{_datadir}/feedback
+%files -n svi-data-profile_mobile
+%defattr(644,root,root,-)
+%{_datadir}/feedback.mobile/*
+%manifest svi-data.manifest
+
+%post -n svi-data-profile_wearable
+ln -sf feedback.wearable %{_datadir}/feedback
+%preun -n svi-data-profile_wearable
+rm -f %{_datadir}/feedback
+%files -n svi-data-profile_wearable
+%defattr(644,root,root,-)
+%{_datadir}/feedback.wearable/*
+%manifest svi-data.manifest