Release 12.0.0.18245
[platform/core/csapi/tizenfx.git] / packaging / csapi-tizenfx.spec.in
index 7b9509d..17db927 100644 (file)
@@ -2,30 +2,71 @@
 %define TIZEN_NET_API_VERSION @api_version@
 %define TIZEN_NET_RPM_VERSION @rpm_version@
 %define TIZEN_NET_NUGET_VERSION @nuget_version@
-%define TIZEN_NET_INTERNAL_NUGET_VERSION @internal_nuget_version@
 
 %define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework
 %define DOTNET_ASSEMBLY_DUMMY_PATH %{DOTNET_ASSEMBLY_PATH}/ref
 %define DOTNET_ASSEMBLY_RES_PATH %{DOTNET_ASSEMBLY_PATH}/res
+%define DOTNET_TOOLS_PATH /usr/share/dotnet.tizen/tools
+%define DOTNET_PRELOAD_PATH /usr/share/dotnet.tizen/preload
+%define DOTNET_LIBRARY_PATH /usr/share/dotnet.tizen/lib
 %define DOTNET_NUGET_SOURCE /nuget
 
+%define TIZEN_NET_RUNTIME_IDENTIFIERS @rid_version@
+%define TIZEN_NET_TARGET_FRAMEWORK_MONIKERS @tfm_support@
+
+%define UPGRADE_SCRIPT_PATH /usr/share/upgrade/scripts
+
 Name:       csapi-tizenfx
 Summary:    Assemblies of Tizen .NET
 Version:    %{TIZEN_NET_RPM_VERSION}
 Release:    1
 Group:      Development/Libraries
-License:    Apache-2.0
+License:    Apache-2.0 and MIT
 URL:        https://www.tizen.org
 Source0:    %{name}-%{version}.tar.gz
 Source1:    %{name}.manifest
 
 BuildArch:   noarch
-ExcludeArch: aarch64
 AutoReqProv: no
 
 BuildRequires: dotnet-build-tools
+BuildRequires: pkgconfig(dali2-csharp-binder)
 Requires(post): /usr/bin/vconftool
 
+# BuildRequires for StructValidator
+%if %{defined enable_struct_test}
+BuildRequires: coregl
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(efl-extension)
+BuildRequires: pkgconfig(capi-media-camera)
+BuildRequires: pkgconfig(rua)
+BuildRequires: pkgconfig(component-based-core-base)
+BuildRequires: pkgconfig(notification)
+BuildRequires: pkgconfig(capi-appfw-service-application)
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(capi-appfw-widget-application)
+BuildRequires: pkgconfig(data-control)
+BuildRequires: pkgconfig(capi-location-manager)
+BuildRequires: pkgconfig(capi-media-vision)
+BuildRequires: pkgconfig(capi-network-bluetooth)
+BuildRequires: pkgconfig(capi-network-wifi-direct)
+BuildRequires: pkgconfig(key-manager)
+BuildRequires: pkgconfig(capi-system-sensor)
+BuildRequires: pkgconfig(capi-system-runtime-info)
+BuildRequires: pkgconfig(capi-ui-inputmethod)
+BuildRequires: pkgconfig(stt-engine)
+BuildRequires: pkgconfig(tts-engine)
+BuildRequires: pkgconfig(chromium-efl)
+BuildRequires: pkgconfig(libsessiond)
+%if "%{profile}" == "tv"
+BuildRequires: pkgconfig(trustzone-nwd)
+%else
+BuildRequires: pkgconfig(capi-appfw-watch-application)
+BuildRequires: pkgconfig(capi-telephony)
+BuildRequires: pkgconfig(tef-libteec)
+%endif
+%endif
+
 %description
 %{summary}
 
@@ -37,13 +78,21 @@ AutoReqProv: no
 %description nuget
 NuGet package for %{name}
 
+%package tools
+Summary:   Tools for TizenFX
+Group:     Development/Libraries
+AutoReqProv: no
+
+%description tools
+Tools for TizenFX
+
 %package dummy
-Summary:   Dummy assemblies of Tizen .NET
+Summary:   not used package
 Group:     Development/Libraries
 AutoReqProv: no
 
 %description dummy
-Dummy assemblies of Tizen .NET
+not used package
 
 %package full
 Summary:   All Tizen .NET assemblies
@@ -62,61 +111,28 @@ AutoReqProv: no
 %description debug
 All .pdb files of Tizen .NET
 
-%package common
-Summary:   Tizen .NET assemblies for Common profile
-Group:     Development/Libraries
-Requires:  %{name} = %{version}-%{release}
-Requires:  csapi-tizenfx-dummy = %{version}-%{release}
-AutoReqProv: no
-
-%description common
-Tizen .NET assemblies for Common profile
-
 %package mobile
 Summary:   Tizen .NET assemblies for Mobile profile
 Group:     Development/Libraries
 Requires:  %{name} = %{version}-%{release}
-Requires:  csapi-tizenfx-dummy = %{version}-%{release}
 AutoReqProv: no
 
 %description mobile
 Tizen .NET assemblies for Mobile profile
 
-%package mobile-emul
-Summary:   Tizen .NET assemblies for Emulator of Mobile profile
-Group:     Development/Libraries
-Requires:  %{name} = %{version}-%{release}
-Requires:  csapi-tizenfx-dummy = %{version}-%{release}
-AutoReqProv: no
-
-%description mobile-emul
-Tizen .NET assemblies for Emulator of Mobile profile
-
 %package tv
 Summary:   Tizen .NET assemblies for TV profile
 Group:     Development/Libraries
 Requires:  %{name} = %{version}-%{release}
-Requires:  csapi-tizenfx-dummy = %{version}-%{release}
 AutoReqProv: no
 
 %description tv
 Tizen .NET assemblies for TV profile
 
-%package ivi
-Summary:   Tizen .NET assemblies for IVI profile
-Group:     Development/Libraries
-Requires:  %{name} = %{version}-%{release}
-Requires:  csapi-tizenfx-dummy = %{version}-%{release}
-AutoReqProv: no
-
-%description ivi
-Tizen .NET assemblies for IVI profile
-
 %package wearable
 Summary:   Tizen .NET assemblies for Wearable profile
 Group:     Development/Libraries
 Requires:  %{name} = %{version}-%{release}
-Requires:  csapi-tizenfx-dummy = %{version}-%{release}
 AutoReqProv: no
 
 %description wearable
@@ -128,87 +144,115 @@ cp %{SOURCE1} .
 
 %build
 
-%define _tizenfx_bin_path Artifacts
-
-GetFileList() {
-  PROFILE=$1
-  cat pkg/PlatformFileList.txt | grep -E "#$PROFILE[[:space:]]|#$PROFILE$" | cut -d# -f1 | sed "s#^#%{DOTNET_ASSEMBLY_PATH}/#"
-}
+# configure for ASAN
+%{?asan:export ASAN_OPTIONS=use_sigaltstack=false:allow_user_segv_handler=true:handle_sigfpe=false:`cat /ASAN_OPTIONS`}
 
-GetFileList common > common.filelist
-GetFileList mobile > mobile.filelist
-GetFileList mobile-emul > mobile-emul.filelist
-GetFileList tv > tv.filelist
-GetFileList ivi > ivi.filelist
-GetFileList wearable > wearable.filelist
-
-rm -fr %{_tizenfx_bin_path}
+# prepare for build
 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
-./build.sh --full
-./build.sh --dummy
-./build.sh --pack %{TIZEN_NET_NUGET_VERSION} %{TIZEN_NET_INTERNAL_NUGET_VERSION}
+%define build_cmd ./tools/scripts/retry.sh ./tools/scripts/timeout.sh -t 600 ./build.sh
+
+# build full assemblies
+%if %{defined profile}
+%{build_cmd} --full /p:BuildProfile=%{profile}
+%else
+%{build_cmd} --full
+%endif
+
+# pack nuget package
+%{build_cmd} --pack %{TIZEN_NET_NUGET_VERSION}
+
+# check validation of struct size
+%if %{defined enable_struct_test}
+dotnet validate-struct Artifacts/bin/public || echo "
+    #######################################################
+    ##################### W A R N I N G ###################
+    #######################################################
+    # The sturct size mismatches MUST BE FIXED.           #
+    # It will make building errors later                  #
+    #######################################################
+"
+%endif
+
 
 %install
 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH}
 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
 mkdir -p %{buildroot}%{DOTNET_NUGET_SOURCE}
+mkdir -p %{buildroot}%{DOTNET_TOOLS_PATH}
+mkdir -p %{buildroot}%{DOTNET_PRELOAD_PATH}
 
 # Install Runtime Assemblies
-install -p -m 644 %{_tizenfx_bin_path}/bin/public/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
-install -p -m 644 %{_tizenfx_bin_path}/bin/internal/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
+install -p -m 644 Artifacts/bin/public/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
+install -p -m 644 Artifacts/bin/internal/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
 
 # Install Debug Symbols
-install -p -m 644 %{_tizenfx_bin_path}/bin/public/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
-install -p -m 644 %{_tizenfx_bin_path}/bin/internal/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
+install -p -m 644 Artifacts/bin/public/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
+install -p -m 644 Artifacts/bin/internal/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
 
 # Install Resource files
-[ -d %{_tizenfx_bin_path}/bin/public/res ] \
-  && install -p -m 644 %{_tizenfx_bin_path}/bin/public/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
-[ -d %{_tizenfx_bin_path}/bin/internal/res ] \
-  && install -p -m 644 %{_tizenfx_bin_path}/bin/internal/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
+[ -d Artifacts/bin/public/res ] \
+  && cp -fr Artifacts/bin/public/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
+[ -d Artifacts/bin/internal/res ] \
+  && cp -fr Artifacts/bin/internal/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
 
 # Install Dummy Assemblies
-install -p -m 644 %{_tizenfx_bin_path}/bin/dummy/*.dll %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
+install -p -m 644 Artifacts/bin/dummy/*.dll %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
+
+# Install Preload
+install -p -m 644 Artifacts/preload/*.preload %{buildroot}%{DOTNET_PRELOAD_PATH}
 
 # Install NuGet Packages
-install -p -m 644 %{_tizenfx_bin_path}/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
+install -p -m 644 Artifacts/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
+install -p -m 644 packaging/depends/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
+
+# Install Tools
+install -p -m 644 tools/bin/* %{buildroot}%{DOTNET_TOOLS_PATH}
+
+
+# Install Upgrade Script
+mkdir -p %{buildroot}%{UPGRADE_SCRIPT_PATH}
+install -p -m 755 packaging/500.tizenfx_upgrade.sh %{buildroot}%{UPGRADE_SCRIPT_PATH}
 
 %post
 /usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
-
+/usr/bin/vconftool set -t string db/dotnet/tizen_api_path %{DOTNET_ASSEMBLY_PATH} -f
+mkdir -p %{DOTNET_LIBRARY_PATH}
+touch %{DOTNET_LIBRARY_PATH}/dotnet_resolving.info
+echo "db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS}" > %{DOTNET_LIBRARY_PATH}/dotnet_resolving.info
+echo "db/dotnet/tizen_tfm_support %{TIZEN_NET_TARGET_FRAMEWORK_MONIKERS}" >> %{DOTNET_LIBRARY_PATH}/dotnet_resolving.info
 
 %files
 %license LICENSE
+%license LICENSE.MIT
+%attr(0755,root,root) %{UPGRADE_SCRIPT_PATH}/500.tizenfx_upgrade.sh
 
 %files nuget
 %{DOTNET_NUGET_SOURCE}/*.nupkg
 
+%files tools
+%manifest %{name}.manifest
+%{DOTNET_TOOLS_PATH}/*
+
 %files dummy
-%attr(644,root,root) %{DOTNET_ASSEMBLY_DUMMY_PATH}/*.dll
 
 %files full
 %manifest %{name}.manifest
-%attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.dll
-%attr(644,root,root) %{DOTNET_ASSEMBLY_RES_PATH}/*
+%defattr(644,root,root,755)
+%{DOTNET_ASSEMBLY_PATH}/*.dll
+%{DOTNET_ASSEMBLY_DUMMY_PATH}/*.dll
+%{DOTNET_ASSEMBLY_RES_PATH}/*
+%{DOTNET_PRELOAD_PATH}/*
 
 %files debug
-%attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.pdb
-
-%files common -f common.filelist
-%manifest %{name}.manifest
-
-%files mobile -f mobile.filelist
-%manifest %{name}.manifest
-
-%files mobile-emul -f mobile-emul.filelist
 %manifest %{name}.manifest
+%attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.pdb
 
-%files tv -f tv.filelist
+%files mobile -f Artifacts/mobile.filelist
 %manifest %{name}.manifest
 
-%files ivi -f ivi.filelist
+%files tv -f Artifacts/tv.filelist
 %manifest %{name}.manifest
 
-%files wearable -f wearable.filelist
+%files wearable -f Artifacts/wearable.filelist
 %manifest %{name}.manifest