Name: dotnet-build-tools
Summary: Tools for building C# API projects
-Version: 1.0.12
+Version: 1.2.0
Release: 1
Group: Development/Libraries
License: MIT and Apache-2.0
URL: https://www.tizen.org
Source0: %{name}-%{version}.tar.gz
Source1: macros.dotnet-build-tools
+Source2: dotnet-dev-linux-x64.latest.tar.gz
+Source3: deps.tar.gz
AutoReqProv: no
+BuildRequires: patchelf
+
Requires: corefx-managed-ref
+Requires: referenceassemblies-pcl
Requires: mono-compat
Requires: mono-devel
Requires: mono-compiler
+%define debug_package %{nil}
+
%description
Build target files (.Targets) and Tools (including NuGet.exe) for building
C# Deivce API with xbuild in GBS environment.
+%define CLI_PATH %{_datadir}/dotnet-build-tools/cli
+
%prep
%setup -q
%build
+# Prepare dotnet-cli
+mkdir -p dotnet
+tar xf %{SOURCE2} -C ./dotnet
+tar xf %{SOURCE3} -C ./dotnet
+
+for file in $( find ./dotnet -name "dotnet" -type f )
+do
+ patchelf --set-interpreter %{CLI_PATH}/deps/ld-linux-x86-64.so.2 ${file}
+ patchelf --set-rpath %{CLI_PATH}/deps/ ${file}
+done
+for file in $( find ./dotnet -type f \( -name "*.so" -or -name "*.so.*" \) -not -name "*.dbg" -not -name "ld-*.so*" )
+do
+ patchelf --set-rpath %{CLI_PATH}/deps/ ${file}
+done
%install
%define NuGetDir %{_datadir}/NuGet
%define XBuildDir /usr/lib/mono/xbuild
-%define ToolsDir %{_datadir}/DotnetBuildTools
+%define ToolsDir %{_datadir}/dotnet-build-tools
# Tizen.GBS.BuildTasks
mkdir -p %{buildroot}%{XBuildDir}/14.0/Microsoft.Common.targets/ImportAfter
# RPM Macros
install -D -p -m 0644 %{S:1} %{buildroot}%{_sysconfdir}/rpm/macros.dotnet-build-tools
+# dotnet-cli
+mkdir -p %{buildroot}%{ToolsDir}/cli
+cp -fr ./dotnet/* %{buildroot}%{ToolsDir}/cli
+ln -s %{ToolsDir}/cli/dotnet %{buildroot}%{_bindir}/dotnet
+
%files
%license LICENSE.NuGet
%config(noreplace) %{_sysconfdir}/rpm/macros.dotnet-build-tools