SET(INSTALL_ARCH x86_64)
ENDIF()
-IF("${CMAKE_PROFILE}" STREQUAL "TV")
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/lib_embedded/${INSTALL_ARCH}/libvc-engine-default.so DESTINATION ${TZ_SYS_RO_SHARE}/voice/vc/1.0/engine/ COMPONENT RuntimeLibraries)
-INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/engine_data_embedded/ DESTINATION ${TZ_SYS_RO_SHARE}/voice/vc/engine_data)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/vc-default-info-embedded.xml DESTINATION ${TZ_SYS_RO_SHARE}/voice/vc/1.0/engine-info/ RENAME vc-default-info.xml)
-ELSE()
+# FLORA LICENSED (TV) FILES
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/lib_embedded/${INSTALL_ARCH}/libvc-engine-default.so DESTINATION ${TZ_SYS_RO_SHARE}/voice/vc/1.0/engine/flora/ COMPONENT RuntimeLibraries)
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/engine_data_embedded/ DESTINATION ${TZ_SYS_RO_SHARE}/voice/vc/engine_data/flora/)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/vc-default-info-embedded.xml DESTINATION ${TZ_SYS_RO_SHARE}/voice/vc/1.0/engine-info/flora/ RENAME vc-default-info.xml)
+
+# PROPRIETARY (non-TV) FILES
INSTALL(FILES ${CMAKE_SOURCE_DIR}/lib/${INSTALL_ARCH}/libasr-nlu.so DESTINATION ${LIBDIR})
INSTALL(FILES ${CMAKE_SOURCE_DIR}/lib/${INSTALL_ARCH}/libsvoiceclientdp.so DESTINATION ${LIBDIR})
INSTALL(FILES ${CMAKE_SOURCE_DIR}/lib/${INSTALL_ARCH}/libsvoiceparser.so DESTINATION ${LIBDIR})
INSTALL(FILES ${CMAKE_SOURCE_DIR}/lib/${INSTALL_ARCH}/libsvoice.so DESTINATION ${TZ_SYS_RO_SHARE}/voice/vc/1.0/engine/ COMPONENT RuntimeLibraries)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/engine_data/shared DESTINATION ${TZ_SYS_RO_SHARE}/voice/vc/1.0/engine-data/n66)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/vc-default-info.xml DESTINATION ${TZ_SYS_RO_SHARE}/voice/vc/1.0/engine-info/)
-ENDIF()
Name: vc-engine-default
Summary: Voice control default engine library
-Version: 0.2.0
+Version: 0.2.1
Release: 1
Group: Graphics & UI Framework/Voice Framework
-%if "%{?profile}" == "tv"
-License: Flora-1.1
-%else
-License: Samsung proprietary
-%endif
+License: Samsung proprietary or Flora-1.1
Source0: %{name}-%{version}.tar.gz
Source1001: %{name}.manifest
BuildRequires: cmake
BuildRequires: pkgconfig(libtzplatform-config)
+Requires: %{name}-compat
+Recommends: %{name}-profile_common
%description
Description: Voice control default engine library
+%package profile_tv
+Summary: vc-engine-default flora
+License: Flora-1.1
+Provides: %{name}-compat = %{version}-%{release}
+Conflicts: %{name}-profile_common
+
+%description profile_tv
+vc-enging-default binaries with Flora 1.1 license.
+
+%package profile_common
+Summary: vc-engine-default proprietary
+License: Samsung proprietary
+Provides: %{name}-compat = %{version}-%{release}
+Provides: %{name}-profile_mobile = %{version}-%{release}
+Provides: %{name}-profile_wearable = %{version}-%{release}
+Provides: %{name}-profile_ivi = %{version}-%{release}
+Conflicts: %{name}-profile_tv
+
+%description profile_common
+vc-enging-default binaries with priorietary license.
+
%prep
%setup -q
cp %{SOURCE1001} .
-
-%if "%{?profile}" == "tv"
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DTZ_SYS_RO_SHARE=%TZ_SYS_RO_SHARE -DCMAKE_PROFILE=TV
-%else
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DTZ_SYS_RO_SHARE=%TZ_SYS_RO_SHARE
-%endif
%build
make %{?jobs:-j%jobs}
rm -rf %{buildroot}
%make_install
mkdir -p %{buildroot}%{TZ_SYS_RO_SHARE}/license
-%if "%{?profile}" == "tv"
-cp %{_builddir}/%{name}-%{version}/LICENSE_embedded %{buildroot}%{TZ_SYS_RO_SHARE}/license/%{name}
-%else
-cp %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}%{TZ_SYS_RO_SHARE}/license/%{name}
-%endif
+
+cp %{_builddir}/%{name}-%{version}/LICENSE_embedded %{buildroot}%{TZ_SYS_RO_SHARE}/license/%{name}-profile_tv
+cp %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}%{TZ_SYS_RO_SHARE}/license/%{name}-profile_common
+
+%post profile_tv
+echo "Moving files to destination..."
+mv -f %{TZ_SYS_RO_SHARE}/voice/vc/1.0/engine/flora/lib*.so %{TZ_SYS_RO_SHARE}/voice/vc/1.0/engine/
+mv -f %{TZ_SYS_RO_SHARE}/voice/vc/1.0/engine-info/flora/vc-default-info.xml %{TZ_SYS_RO_SHARE}/voice/vc/1.0/engine-info/
+mv -f %{TZ_SYS_RO_SHARE}/voice/vc/engine_data/flora/* %{TZ_SYS_RO_SHARE}/voice/vc/engine_data/
+rm -rf %{TZ_SYS_RO_SHARE}/voice/vc/engine_data/flora
+
+%preun profile_tv
+echo "Moving files for rpm uninstall..."
+mv -f %{TZ_SYS_RO_SHARE}/voice/vc/1.0/engine/lib*.so %{TZ_SYS_RO_SHARE}/voice/vc/1.0/engine/flora/
+mv %{TZ_SYS_RO_SHARE}/voice/vc/1.0/engine-info/vc-default-info.xml %{TZ_SYS_RO_SHARE}/voice/vc/1.0/engine-info/flora/
+mkdir -p %{TZ_SYS_RO_SHARE}/voice/vc/tmp
+mv -f %{TZ_SYS_RO_SHARE}/voice/vc/engine_data/* %{TZ_SYS_RO_SHARE}/voice/vc/tmp
+mv -f %{TZ_SYS_RO_SHARE}/voice/vc/tmp %{TZ_SYS_RO_SHARE}/voice/vc/engine_data/flora
%files
+
+%files profile_tv
+%manifest vc-engine-default.manifest
+%defattr(-,root,root,-)
+%{TZ_SYS_RO_SHARE}/voice/vc/1.0/engine/flora/lib*.so
+%{TZ_SYS_RO_SHARE}/voice/vc/1.0/engine-info/flora/vc-default-info.xml
+%{TZ_SYS_RO_SHARE}/voice/vc/engine_data/flora/*
+%{TZ_SYS_RO_SHARE}/license/%{name}-profile_tv
+
+%files profile_common
%manifest vc-engine-default.manifest
%defattr(-,root,root,-)
%{TZ_SYS_RO_SHARE}/voice/vc/1.0/engine/lib*.so
%{TZ_SYS_RO_SHARE}/voice/vc/1.0/engine-info/vc-default-info.xml
-%{TZ_SYS_RO_SHARE}/license/%{name}
-%if "%{?profile}" != "tv"
%{TZ_SYS_RO_SHARE}/voice/vc/1.0/engine-data/*
+%{TZ_SYS_RO_SHARE}/license/%{name}-profile_common
%{_libdir}/libasr-nlu.so
%{_libdir}/libsvoiceclientdp.so
%{_libdir}/libsvoiceparser.so
%{_libdir}/libvoiceactivity.so
%{_libdir}/libvoice-transport.so
-%endif
-%if "%{?profile}" == "tv"
-%{TZ_SYS_RO_SHARE}/voice/vc/engine_data/*
-%endif