-# !! IMPORTANT !!
-# This packaging spec file is for developer testing only.
-# For Tizen release, the spec file in the tizen branch should be used.
+# Auto-generated from csapi-tizenfx.spec.in by makespec.sh
+
+%define TIZEN_NET_API_VERSION 5
+%define TIZEN_NET_RPM_VERSION 5.0.0.999+nui503
+%define TIZEN_NET_NUGET_VERSION 5.0.0.99999
+%define TIZEN_NET_INTERNAL_NUGET_VERSION 5.0.0.999
%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_NUGET_SOURCE /nuget
-%define _tizenfx_bin_path Artifacts
-
Name: csapi-tizenfx
Summary: Assemblies of Tizen .NET
-Version: 99.99.99
+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
-BuildRequires: dotnet-build-tools
-
-BuildArch: noarch
+BuildArch: noarch
+ExcludeArch: aarch64
AutoReqProv: no
+BuildRequires: dotnet-build-tools
+Requires(post): /usr/bin/vconftool
+
%description
%{summary}
%package full
Summary: All Tizen .NET assemblies
Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
AutoReqProv: no
%description full
%package common
Summary: Tizen .NET assemblies for Common profile
Group: Development/Libraries
-Requires: csapi-tizenfx-dummy
+Requires: %{name} = %{version}-%{release}
+Requires: csapi-tizenfx-dummy = %{version}-%{release}
AutoReqProv: no
%description common
%package mobile
Summary: Tizen .NET assemblies for Mobile profile
Group: Development/Libraries
-Requires: csapi-tizenfx-dummy
+Requires: %{name} = %{version}-%{release}
+Requires: csapi-tizenfx-dummy = %{version}-%{release}
AutoReqProv: no
%description mobile
%package mobile-emul
Summary: Tizen .NET assemblies for Emulator of Mobile profile
Group: Development/Libraries
-Requires: csapi-tizenfx-dummy
+Requires: %{name} = %{version}-%{release}
+Requires: csapi-tizenfx-dummy = %{version}-%{release}
AutoReqProv: no
%description mobile-emul
%package tv
Summary: Tizen .NET assemblies for TV profile
Group: Development/Libraries
-Requires: csapi-tizenfx-dummy
+Requires: %{name} = %{version}-%{release}
+Requires: csapi-tizenfx-dummy = %{version}-%{release}
AutoReqProv: no
%description tv
%package ivi
Summary: Tizen .NET assemblies for IVI profile
Group: Development/Libraries
-Requires: csapi-tizenfx-dummy
+Requires: %{name} = %{version}-%{release}
+Requires: csapi-tizenfx-dummy = %{version}-%{release}
AutoReqProv: no
%description ivi
%package wearable
Summary: Tizen .NET assemblies for Wearable profile
Group: Development/Libraries
-Requires: csapi-tizenfx-dummy
+Requires: %{name} = %{version}-%{release}
+Requires: csapi-tizenfx-dummy = %{version}-%{release}
AutoReqProv: no
%description wearable
%setup -q
cp %{SOURCE1} .
+# prepare external modules
+for ext in $(ls -1 packaging/externals.*.tar.gz); do
+ extname=$(basename -- $ext)
+ extname=${extname#externals\.}
+ extname=${extname%\.tar\.gz}
+ mkdir -p externals/$extname
+ tar xvfz $ext -C externals/$extname
+done
+
%build
+%{?asan:export ASAN_OPTIONS=use_sigaltstack=false:allow_user_segv_handler=true:handle_sigfpe=false:`cat /ASAN_OPTIONS`}
+
+%define _tizenfx_bin_path Artifacts
GetFileList() {
PROFILE=$1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
./build.sh --full
./build.sh --dummy
-./build.sh --pack
+./build.sh --pack %{TIZEN_NET_NUGET_VERSION} %{TIZEN_NET_INTERNAL_NUGET_VERSION}
+./build.sh --ext
%install
mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH}
mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
mkdir -p %{buildroot}%{DOTNET_NUGET_SOURCE}
+# 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}
+[ -d %{_tizenfx_bin_path}/bin/external ] \
+ && install -p -m 644 %{_tizenfx_bin_path}/bin/external/*.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/platform/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
-install -p -m 644 %{_tizenfx_bin_path}/bin/platform/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
-install -p -m 644 %{_tizenfx_bin_path}/bin/platform/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
+install -p -m 644 %{_tizenfx_bin_path}/bin/internal/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
+[ -d %{_tizenfx_bin_path}/bin/external ] \
+ && install -p -m 644 %{_tizenfx_bin_path}/bin/external/*.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}
+
+# Install Dummy Assemblies
install -p -m 644 %{_tizenfx_bin_path}/bin/dummy/*.dll %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
+
+# Install NuGet Packages
install -p -m 644 %{_tizenfx_bin_path}/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
+%post
+/usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
+
+
+%files
+%license LICENSE
+
%files nuget
%{DOTNET_NUGET_SOURCE}/*.nupkg
%files full
%manifest %{name}.manifest
-%license LICENSE
%attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.dll
%attr(644,root,root) %{DOTNET_ASSEMBLY_RES_PATH}/*
%files common -f common.filelist
%manifest %{name}.manifest
-%license LICENSE
%files mobile -f mobile.filelist
%manifest %{name}.manifest
-%license LICENSE
%files mobile-emul -f mobile-emul.filelist
%manifest %{name}.manifest
-%license LICENSE
%files tv -f tv.filelist
%manifest %{name}.manifest
-%license LICENSE
%files ivi -f ivi.filelist
%manifest %{name}.manifest
-%license LICENSE
%files wearable -f wearable.filelist
%manifest %{name}.manifest
-%license LICENSE