From 2a59cfaa466a637d64810d029c36f908e496b03b Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 23 2020 22:04:13 +0000 Subject: import dotnet-2.1.513-2.el8 --- diff --git a/.dotnet.metadata b/.dotnet.metadata new file mode 100644 index 0000000..133d204 --- /dev/null +++ b/.dotnet.metadata @@ -0,0 +1 @@ +88a5b4436d7f848b33121f8aad2d37dc9ba93a1f SOURCES/dotnet-v2.1.513-SDK.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f90b675 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/dotnet-v2.1.513-SDK.tar.gz diff --git a/SOURCES/check-debug-symbols.py b/SOURCES/check-debug-symbols.py new file mode 100755 index 0000000..1e14800 --- /dev/null +++ b/SOURCES/check-debug-symbols.py @@ -0,0 +1,136 @@ +#!/usr/bin/python3 + +""" +Check debug symbols are present in shared object and can identify +code. + +It starts scanning from a directory and recursively scans all ELF +files found in it for various symbols to ensure all debuginfo is +present and nothing has been stripped. + +Usage: + +./check-debug-symbols /path/of/dir/to/scan/ + + +Example: + +./check-debug-symbols /usr/lib64 +""" + +# This technique was explained to me by Mark Wielaard (mjw). + +import collections +import os +import re +import subprocess +import sys + +ScanResult = collections.namedtuple('ScanResult', + 'file_name debug_info debug_abbrev file_symbols gnu_debuglink') + + +def scan_file(file): + "Scan the provided file and return a ScanResult containing results of the scan." + + # Test for .debug_* sections in the shared object. This is the main test. + # Stripped objects will not contain these. + readelf_S_result = subprocess.run(['eu-readelf', '-S', file], + stdout=subprocess.PIPE, encoding='utf-8', check=True) + has_debug_info = any(line for line in readelf_S_result.stdout.split('\n') if '] .debug_info' in line) + + has_debug_abbrev = any(line for line in readelf_S_result.stdout.split('\n') if '] .debug_abbrev' in line) + + # Test FILE symbols. These will most likely be removed by anyting that + # manipulates symbol tables because it's generally useless. So a nice test + # that nothing has messed with symbols. + def contains_file_symbols(line): + parts = line.split() + if len(parts) < 8: + return False + return \ + parts[2] == '0' and parts[3] == 'FILE' and parts[4] == 'LOCAL' and parts[5] == 'DEFAULT' and \ + parts[6] == 'ABS' and re.match(r'((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx))?', parts[7]) + + readelf_s_result = subprocess.run(["eu-readelf", '-s', file], + stdout=subprocess.PIPE, encoding='utf-8', check=True) + has_file_symbols = any(line for line in readelf_s_result.stdout.split('\n') if contains_file_symbols(line)) + + # Test that there are no .gnu_debuglink sections pointing to another + # debuginfo file. There shouldn't be any debuginfo files, so the link makes + # no sense either. + has_gnu_debuglink = any(line for line in readelf_s_result.stdout.split('\n') if '] .gnu_debuglink' in line) + + return ScanResult(file, has_debug_info, has_debug_abbrev, has_file_symbols, has_gnu_debuglink) + +def is_elf(file): + result = subprocess.run(['file', file], stdout=subprocess.PIPE, encoding='utf-8', check=True) + return re.search('ELF 64-bit LSB (?:executable|shared object)', result.stdout) + +def scan_file_if_sensible(file): + if is_elf(file): + # print(file) + return scan_file(file) + return None + +def scan_dir(dir): + results = [] + for root, _, files in os.walk(dir): + for name in files: + result = scan_file_if_sensible(os.path.join(root, name)) + if result: + results.append(result) + return results + +def scan(file): + file = os.path.abspath(file) + if os.path.isdir(file): + return scan_dir(file) + elif os.path.isfile(file): + return scan_file_if_sensible(file) + +def is_bad_result(result): + return not result.debug_info or not result.debug_abbrev or not result.file_symbols or result.gnu_debuglink + +def print_scan_results(results, verbose): + # print(results) + for result in results: + file_name = result.file_name + found_issue = False + if not result.debug_info: + found_issue = True + print('error: missing .debug_info section in', file_name) + if not result.debug_abbrev: + found_issue = True + print('error: missing .debug_abbrev section in', file_name) + if not result.file_symbols: + found_issue = True + print('error: missing FILE symbols in', file_name) + if result.gnu_debuglink: + found_issue = True + print('error: unexpected .gnu_debuglink section in', file_name) + if verbose and not found_issue: + print('OK: ', file_name) + +def main(args): + verbose = False + files = [] + for arg in args: + if arg == '--verbose' or arg == '-v': + verbose = True + else: + files.append(arg) + + results = [] + for file in files: + results.extend(scan(file)) + + print_scan_results(results, verbose) + + if any(is_bad_result(result) for result in results): + return 1 + return 0 + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/SOURCES/cli-telemetry-optout.patch b/SOURCES/cli-telemetry-optout.patch new file mode 100644 index 0000000..9b01f13 --- /dev/null +++ b/SOURCES/cli-telemetry-optout.patch @@ -0,0 +1,18 @@ +diff --git a/src/dotnet/Program.cs b/src/dotnet/Program.cs +index de1ebb9e6..6bbf479de 100644 +--- a/src/dotnet/Program.cs ++++ b/src/dotnet/Program.cs +@@ -28,6 +28,13 @@ public class Program + + public static int Main(string[] args) + { ++ // opt out of telemetry by default if the env var is unset ++ string telemetryValue = Environment.GetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT"); ++ if (String.IsNullOrEmpty(telemetryValue)) ++ { ++ Environment.SetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1"); ++ } ++ + DebugHelper.HandleDebugSwitch(ref args); + + new MulticoreJitActivator().TryActivateMulticoreJit(); diff --git a/SOURCES/core-setup-4510-commit-id.patch b/SOURCES/core-setup-4510-commit-id.patch new file mode 100644 index 0000000..cf896ef --- /dev/null +++ b/SOURCES/core-setup-4510-commit-id.patch @@ -0,0 +1,48 @@ +From e02ee86364b9db3edc298a6a081004aa07473d09 Mon Sep 17 00:00:00 2001 +From: Omair Majid +Date: Wed, 29 Aug 2018 17:03:25 -0400 +Subject: [PATCH] Allow setting the commit id using /p:LatestCommit + +This is similar to how CommitCount is already supported. + +This lets consumers who are building outside a git repo, such as +source-build, set a commit id which is displayed by `dotnet --info` +and `strings dotnet | grep '@(#)'`. + +See: https://github.com/dotnet/source-build/issues/651 +See: https://github.com/dotnet/cli/pull/5945 +--- + dir.targets | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/dir.targets b/dir.targets +index 8d34872c6..59dc1ebde 100644 +--- a/dir.targets ++++ b/dir.targets +@@ -17,7 +17,8 @@ + + + +- ++ + + + +@@ -29,13 +30,13 @@ + + + +- ++ + ++ ConsoleToMSBuild="true"> + + + diff --git a/SOURCES/core-setup-pie.patch b/SOURCES/core-setup-pie.patch new file mode 100644 index 0000000..f2ef5ac --- /dev/null +++ b/SOURCES/core-setup-pie.patch @@ -0,0 +1,11 @@ +--- a/src/corehost/cli/exe/exe.cmake ++++ b/src/corehost/cli/exe/exe.cmake +@@ -44,6 +44,8 @@ + + add_executable(${DOTNET_HOST_EXE_NAME} ${SOURCES} ${RESOURCES}) + ++SET_TARGET_PROPERTIES(${DOTNET_HOST_EXE_NAME} PROPERTIES LINK_FLAGS -pie) ++ + if(NOT WIN32) + disable_pax_mprotect(${DOTNET_HOST_EXE_NAME}) + endif() diff --git a/SOURCES/coreclr-build-python3.patch b/SOURCES/coreclr-build-python3.patch new file mode 100644 index 0000000..1090a12 --- /dev/null +++ b/SOURCES/coreclr-build-python3.patch @@ -0,0 +1,38 @@ +From 7e0608fee5cacbf5bf7d0c3886e2fcb1a9d10754 Mon Sep 17 00:00:00 2001 +From: Omair Majid +Date: Wed, 9 Jan 2019 12:28:48 -0500 +Subject: [PATCH] Support building with python3 on unix (#19356) + +The windows build scripts try finding python in order of python3, +python2 and then python. The unix build scripts dont. They just try +python2 variants and then fail. This change makes brings them closer +together by letting users build using only python3. +--- + build.sh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/build.sh b/build.sh +index a0b1742effb..14452ad5ac5 100755 +--- a/build.sh ++++ b/build.sh +@@ -7,9 +7,9 @@ export ghprbCommentBody= + + # resolve python-version to use + if [ "$PYTHON" == "" ] ; then +- if ! PYTHON=$(command -v python2.7 || command -v python2 || command -v python) ++ if ! PYTHON=$(command -v python3 || command -v python2 || command -v python) + then +- echo "Unable to locate build-dependency python2.x!" 1>&2 ++ echo "Unable to locate build-dependency python!" 1>&2 + exit 1 + fi + fi +@@ -17,7 +17,7 @@ fi + # useful in case of explicitly set option. + if ! command -v $PYTHON > /dev/null + then +- echo "Unable to locate build-dependency python2.x ($PYTHON)!" 1>&2 ++ echo "Unable to locate build-dependency python ($PYTHON)!" 1>&2 + exit 1 + fi + diff --git a/SOURCES/coreclr-cmake-python3.patch b/SOURCES/coreclr-cmake-python3.patch new file mode 100644 index 0000000..285cdc4 --- /dev/null +++ b/SOURCES/coreclr-cmake-python3.patch @@ -0,0 +1,26 @@ +From e7c6f87f54be723724a4c996d815d59b515b01a6 Mon Sep 17 00:00:00 2001 +From: Omair Majid +Date: Thu, 31 Jan 2019 16:09:35 -0500 +Subject: [PATCH] Update python lookup in CMakeLists.txt to match + build.(sh|cmd) (#22145) + +Use the same logic that's used in build.sh/build.cmd to lookup python: +first search for `python3`, then fall back to `python2` and finally to +`python`. +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 82c19a9cbaa..31b814f118d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -37,7 +37,7 @@ OPTION(CLR_CMAKE_ENABLE_CODE_COVERAGE "Enable code coverage" OFF) + OPTION(CLR_CMAKE_WARNINGS_ARE_ERRORS "Warnings are errors" ON) + + # Ensure that python is present +-find_program(PYTHON NAMES python2.7 python2 python) ++find_program(PYTHON NAMES python3 python2 python) + if (PYTHON STREQUAL "PYTHON-NOTFOUND") + message(FATAL_ERROR "PYTHON not found: Please install Python 2.7.9 or later from https://www.python.org/downloads/") + endif() diff --git a/SOURCES/coreclr-pie.patch b/SOURCES/coreclr-pie.patch new file mode 100644 index 0000000..a711fc8 --- /dev/null +++ b/SOURCES/coreclr-pie.patch @@ -0,0 +1,11 @@ +--- a/src/debug/createdump/CMakeLists.txt ++++ b/src/debug/createdump/CMakeLists.txt +@@ -38,6 +38,8 @@ + main.cpp + ) + ++SET_TARGET_PROPERTIES(createdump PROPERTIES LINK_FLAGS -pie) ++ + target_link_libraries(createdump + createdump_lib + # share the PAL in the dac module diff --git a/SOURCES/corefx-32956-alpn.patch b/SOURCES/corefx-32956-alpn.patch new file mode 100644 index 0000000..88788b2 --- /dev/null +++ b/SOURCES/corefx-32956-alpn.patch @@ -0,0 +1,22 @@ +From 9b9697318e9990655ea878a28a00eda44fb615c2 Mon Sep 17 00:00:00 2001 +From: Jeremy Barton +Date: Mon, 22 Oct 2018 11:54:52 -0700 +Subject: [PATCH] Fix ALPN detection logic (for non-portable shim builds) + +--- + .../Unix/System.Security.Cryptography.Native/configure.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Native/Unix/System.Security.Cryptography.Native/configure.cmake b/src/Native/Unix/System.Security.Cryptography.Native/configure.cmake +index cdc9f50f3c33..fac8c16343df 100644 +--- a/src/Native/Unix/System.Security.Cryptography.Native/configure.cmake ++++ b/src/Native/Unix/System.Security.Cryptography.Native/configure.cmake +@@ -2,7 +2,7 @@ include(CheckLibraryExists) + include(CheckFunctionExists) + + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) +-set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY}) ++set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_SSL_LIBRARY}) + + check_function_exists( + EC_GF2m_simple_method diff --git a/SOURCES/corefx-optflags-support.patch b/SOURCES/corefx-optflags-support.patch new file mode 100644 index 0000000..8ab8409 --- /dev/null +++ b/SOURCES/corefx-optflags-support.patch @@ -0,0 +1,27 @@ +diff --git a/src/Native/Unix/configure.cmake b/src/Native/Unix/configure.cmake +index f4a30ad6cb..f2db68402a 100644 +--- a/src/Native/Unix/configure.cmake ++++ b/src/Native/Unix/configure.cmake +@@ -27,6 +27,12 @@ else () + message(FATAL_ERROR "Unknown platform. Cannot define PAL_UNIX_NAME, used by RuntimeInformation.") + endif () + ++ ++set (PREVIOUS_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) ++set (CMAKE_CXX_FLAGS "-D_GNU_SOURCE") ++set (PREVIOUS_CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) ++set (CMAKE_C_FLAGS "-D_GNU_SOURCE") ++ + # We compile with -Werror, so we need to make sure these code fragments compile without warnings. + # Older CMake versions (3.8) do not assign the result of their tests, causing unused-value errors + # which are not distinguished from the test failing. So no error for that one. +@@ -698,6 +704,9 @@ endif() + + set (CMAKE_REQUIRED_LIBRARIES) + ++set (CMAKE_CXX_FLAGS "${PREVIOUS_CMAKE_CXX_FLAGS}") ++set (CMAKE_C_FLAGS "${PREVIOUS_CMAKE_C_FLAGS}") ++ + check_c_source_compiles( + " + #include diff --git a/SOURCES/dotnet.sh b/SOURCES/dotnet.sh new file mode 100644 index 0000000..718d895 --- /dev/null +++ b/SOURCES/dotnet.sh @@ -0,0 +1,7 @@ + +# Add dotnet tools directory to PATH +DOTNET_TOOLS_PATH="$HOME/.dotnet/tools" +case "$PATH" in + *"$DOTNET_TOOLS_PATH"* ) true ;; + * ) PATH="$PATH:$DOTNET_TOOLS_PATH" ;; +esac diff --git a/SPECS/dotnet.spec b/SPECS/dotnet.spec new file mode 100644 index 0000000..eba319d --- /dev/null +++ b/SPECS/dotnet.spec @@ -0,0 +1,455 @@ +# Avoid provides/requires from private libraries +%global privlibs libhostfxr +%global privlibs %{privlibs}|libclrjit +%global privlibs %{privlibs}|libcoreclr +%global privlibs %{privlibs}|libcoreclrtraceptprovider +%global privlibs %{privlibs}|libdbgshim +%global privlibs %{privlibs}|libhostpolicy +%global privlibs %{privlibs}|libmscordaccore +%global privlibs %{privlibs}|libmscordbi +%global privlibs %{privlibs}|libsos +%global privlibs %{privlibs}|libsosplugin +%global __provides_exclude ^(%{privlibs})\\.so +%global __requires_exclude ^(%{privlibs})\\.so + +# Filter flags not supported by clang/dotnet: +# -fcf-protection is not supported by clang +# -fstack-clash-protection is not supported by clang +# -specs= is not supported by clang +# -fpie is added manually instead of via -specs +%global dotnet_cflags %(echo %optflags | sed -e 's/-fcf-protection//' | sed -e 's/-fstack-clash-protection//' | sed -re 's/-specs=[^ ]*//g') +%global dotnet_ldflags %(echo %{__global_ldflags} | sed -re 's/-specs=[^ ]*//g') + +%if 0%{?fedora} +%global use_bundled_libunwind 0 +%else +%global use_bundled_libunwind 1 +%endif + +%global simple_name dotnet + +%global host_version 2.1.17 +%global runtime_version 2.1.17 +%global sdk_version 2.1.513 + +Name: dotnet +Version: %{sdk_version} +Release: 2%{?dist} +Summary: .NET Core CLI tools and runtime +License: MIT and ASL 2.0 and BSD +URL: https://github.com/dotnet/ + +# The source is generated on a RHEL box via: +# ./build-dotnet-tarball v%%{sdk_version}-SDK + +Source0: dotnet-v%{sdk_version}-SDK.tar.gz +Source1: check-debug-symbols.py +Source2: dotnet.sh + +Patch10: corefx-optflags-support.patch +Patch11: corefx-32956-alpn.patch + +Patch100: coreclr-build-python3.patch +Patch101: coreclr-cmake-python3.patch +Patch102: coreclr-pie.patch + +Patch300: core-setup-4510-commit-id.patch +Patch301: core-setup-pie.patch + +Patch400: cli-telemetry-optout.patch + +ExclusiveArch: x86_64 + +BuildRequires: clang +BuildRequires: cmake +# Bootstrap SDK needs OpenSSL 1.0 to run, but we can build and then +# run with either OpenSSL 1.0 or 1.1 +%if 0%{?fedora} >= 26 || 0%{?rhel} >= 8 +BuildRequires: compat-openssl10 +%endif +BuildRequires: git +BuildRequires: glibc-langpack-en +BuildRequires: hostname +BuildRequires: krb5-devel +BuildRequires: libcurl-devel +BuildRequires: libicu-devel +%if ! %{use_bundled_libunwind} +BuildRequires: libunwind-devel +%endif +BuildRequires: lldb-devel +BuildRequires: llvm +BuildRequires: lttng-ust-devel +BuildRequires: make +BuildRequires: openssl-devel +BuildRequires: python3 +BuildRequires: strace +BuildRequires: zlib-devel + +Requires: %{simple_name}-sdk-2.1%{?_isa} >= %{sdk_version}-%{release} + +%description +.NET Core is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, macOS and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + +.NET Core contains a runtime conforming to .NET Standards a set of +framework libraries, an SDK containing compilers and a 'dotnet' +application to drive everything. + + +%package -n %{simple_name}-host + +Version: %{host_version} +Summary: .NET command line launcher + +%description -n %{simple_name}-host +The .NET Core host is a command line program that runs a standalone +.NET core application or launches the SDK. + +.NET Core is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + + +%package -n %{simple_name}-host-fxr-2.1 + +Version: %{host_version} +Summary: .NET Core command line host resolver + +# Theoretically any version of the host should work. But lets aim for the one +# provided by this package, or from a newer version of .NET Core +Requires: %{simple_name}-host%{?_isa} >= %{host_version}-%{release} + +%description -n %{simple_name}-host-fxr-2.1 +The .NET Core host resolver contains logic to resolve and select the +right version of the .NET Core SDK or runtime to use. + +.NET Core is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + +%package -n %{simple_name}-runtime-2.1 + +Version: %{runtime_version} +Summary: NET Core 2.1 runtime + +Requires: %{simple_name}-host-fxr-2.1%{?_isa} >= %{host_version}-%{release} + +# libicu is dlopen()ed +Requires: libicu + +%description -n %{simple_name}-runtime-2.1 +The .NET Core runtime contains everything needed to run .NET Core applications. +It includes a high performance Virtual Machine as well as the framework +libraries used by .NET Core applications. + +.NET Core is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + +%package -n %{simple_name}-sdk-2.1 + +Version: %{sdk_version} +Summary: .NET Core 2.1 Software Development Kit + +Requires: %{simple_name}-sdk-2.1.5xx%{?_isa} >= %{sdk_version}-%{release} + +%description -n %{simple_name}-sdk-2.1 +The .NET Core SDK is a collection of command line applications to +create, build, publish and run .NET Core applications. + +.NET Core is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + +%package -n %{simple_name}-sdk-2.1.5xx + +Version: %{sdk_version} +Summary: .NET Core 2.1.5xx Software Development Kit + +Requires: %{simple_name}-runtime-2.1%{?_isa} >= %{runtime_version}-%{release} + +%description -n %{simple_name}-sdk-2.1.5xx +The .NET Core SDK is a collection of command line applications to +create, build, publish and run .NET Core applications. + +.NET Core is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + + +%prep +%setup -q -n %{simple_name}-v%{sdk_version}-SDK + +pushd src/corefx +%patch10 -p1 +%patch11 -p1 +popd + +pushd src/coreclr +%patch100 -p1 +%patch101 -p1 +%patch102 -p1 +popd + +pushd src/core-setup +%patch300 -p1 +%patch301 -p1 +popd + +pushd src/cli +%patch400 -p1 +popd + +# Fix bad hardcoded path in build +sed -i 's|/usr/share/dotnet|%{_libdir}/%{simple_name}|' src/core-setup/src/corehost/common/pal.unix.cpp + +# Disable warnings +sed -i 's|skiptests|skiptests ignorewarnings|' repos/coreclr.proj + +# If CLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE is missing, add it back +grep CLR_CMAKE_USE_SYSTEM_LIBUNWIND repos/coreclr.proj || \ + sed -i 's|\$(BuildArguments) |$(BuildArguments) cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE|' repos/coreclr.proj + +%if %{use_bundled_libunwind} +# Use bundled libunwind +sed -i 's|-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE|-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=FALSE|' repos/coreclr.proj +%endif + +cat source-build-info.txt + + +%build +export DOTNET_CLI_TELEMETRY_OPTOUT=1 + +export LLVM_HOME=/opt/rh/llvm-toolset-6.0/root/usr +export CMAKE_INCLUDE_PATH="/opt/rh/llvm-toolset-6.0/root/usr/include" + +export CFLAGS="%{dotnet_cflags}" +export CXXFLAGS="%{dotnet_cflags}" +export LDFLAGS="%{dotnet_ldflags}" + +test -f Tools/ilasm/ilasm + +Tools/dotnetcli/dotnet --info + +VERBOSE=1 ./build.sh \ + /v:n \ + /p:MinimalConsoleLogOutput=false \ + /p:ContinueOnPrebuiltBaselineError=true + + +%install +install -d -m 0755 %{buildroot}%{_libdir}/%{simple_name}/ +ls bin/x64/Release +tar xf bin/x64/Release/dotnet-sdk-%{sdk_version}-*.tar.gz -C %{buildroot}%{_libdir}/%{simple_name}/ + +# Fix permissions on files +find %{buildroot}%{_libdir}/%{simple_name}/ -type f -name '*.props' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/%{simple_name}/ -type f -name '*.targets' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/%{simple_name}/ -type f -name '*.dll' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/%{simple_name}/ -type f -name '*.pubxml' -exec chmod -x {} \; + +# Provided by dotnet-host from another SRPM +# Add ~/.dotnet/tools to $PATH for all users +#install -dm 0755 %%{buildroot}%%{_sysconfdir}/profile.d/ +#install %%{SOURCE2} %%{buildroot}%%{_sysconfdir}/profile.d/ + +# Provided by dotnet-host from another SRPM +#install -dm 755 %%{buildroot}/%%{_datadir}/bash-completion/completions +# dynamic completion needs the file to be named the same as the base command +#install src/cli/scripts/register-completions.bash %%{buildroot}/%%{_datadir}/bash-completion/completions/dotnet + +# TODO: the zsh completion script needs to be ported to use #compdef +#install -dm 755 %%{buildroot}/%%{_datadir}/zsh/site-functions +#install src/cli/scripts/register-completions.zsh %%{buildroot}/%%{_datadir}/zsh/site-functions/_dotnet + +# Provided by dotnet-host from another SRPM +#install -d -m 0755 %%{buildroot}%%{_bindir} +#ln -s %%{_libdir}/%%{simple_name}/dotnet %%{buildroot}%%{_bindir}/ + +# Provided by dotnet-host from another SRPM +#install -d -m 0755 %%{buildroot}%%{_mandir}/man1/ +#find -iname 'dotnet*.1' -type f -exec cp {} %%{buildroot}%%{_mandir}/man1/ \; + +# Check debug symbols in all elf objects. This is not in %%check +# because native binaries are stripped by rpm-build after %%install. +# So we need to do this check earlier. +echo "Testing build results for debug symbols..." +%{SOURCE1} -v %{buildroot}%{_libdir}/%{simple_name}/ + +# Self-check +%{buildroot}%{_libdir}/%{simple_name}/dotnet --info + +# Provided by dotnet-host from another SRPM +rm %{buildroot}%{_libdir}/%{simple_name}/LICENSE.txt +rm %{buildroot}%{_libdir}/%{simple_name}/ThirdPartyNotices.txt +rm %{buildroot}%{_libdir}/%{simple_name}/dotnet + + +%files -n %{simple_name}-host-fxr-2.1 +%dir %{_libdir}/%{simple_name}/host/fxr +%{_libdir}/%{simple_name}/host/fxr/%{host_version} + +%files -n %{simple_name}-runtime-2.1 +%dir %{_libdir}/%{simple_name}/shared +%dir %{_libdir}/%{simple_name}/shared/Microsoft.NETCore.App +%{_libdir}/%{simple_name}/shared/Microsoft.NETCore.App/%{runtime_version} + +%files -n %{simple_name}-sdk-2.1 +# empty package useful for dependencies + +%files -n %{simple_name}-sdk-2.1.5xx +%dir %{_libdir}/%{simple_name}/sdk +%{_libdir}/%{simple_name}/sdk/%{sdk_version} + +%changelog +* Mon Mar 23 2020 Omair Majid - 2.1.513-2 +- Update to .NET Core SDK 2.1.513 and Runtime 2.1.17 +- Resolves: RHBZ#1815640 + +* Sat Mar 07 2020 Omair Majid - 2.1.512-1 +- Update to .NET Core Runtime 2.1.16 and SDK 2.1.512 +- Resolves: RHBZ#1799068 + +* Fri Jan 17 2020 Omair Majid - 2.1.511-2 +- Update to .NET Core Runtime 2.1.15 and SDK 2.1.511 +- Resolves: RHBZ#1786190 + +* Thu Aug 29 2019 Omair Majid - 2.1.509-2 +- Update to .NET Core Runtime 2.1.13 and SDK 2.1.509 +- Resolves: RHBZ#1742959 + +* Thu Aug 15 2019 Omair Majid - 2.1.508-3 +- Remove dotnet and dotnet host packages +- Resolves: RHBZ#1740879 + +* Tue Aug 13 2019 Omair Majid - 2.1.508-2 +- Bump release +- Resolves: RHBZ#1740308 + +* Thu Jul 11 2019 Omair Majid - 2.1.508-1 +- Update to .NET Core Runtime 2.1.12 and SDK 2.1.508 +- Resolves: RHBZ#1728823 + +* Wed Jun 12 2019 Omair Majid - 2.1.507-4 +- Bump version +- Related: RHBZ#1712158 + +* Mon May 20 2019 Omair Majid - 2.1.507-2 +- Link against strerror_r correctly +- Resolves: RHBZ#1712158 + +* Thu May 02 2019 Omair Majid - 2.1.507-1 +- Update to .NET Core Runtime 2.1.11 and SDK 2.1.507 +- Resolves: RHBZ#1705284 + +* Wed Apr 17 2019 Omair Majid - 2.1.506-2 +- Switch away from SCL dependencies for clang/llvm/lldb +- Resolves: RHBZ#1700908 + +* Tue Apr 09 2019 Omair Majid - 2.1.506-1 +- Update to .NET Core Runtime 2.1.10 and SDK 2.1.506 +- Resolves: RHBZ#1696371 + +* Fri Feb 22 2019 Omair Majid - 2.1.504-1 +- Update to .NET Core Runtime 2.1.8 and SDK 2.1.504 +- Sync with Fedora copr spec file +- Resolves: RHBZ#1646713 + +* Fri Oct 12 2018 Omair Majid - 2.1.403-4 +- Disable telemetry via code, not just environment variable +- Resolves: rhbz#1638093 + +* Thu Oct 11 2018 Omair Majid - 2.1.403-3 +- Disable telemetry by default +- Resolves: rhbz#1638093 + +* Wed Oct 10 2018 Omair Majid - 2.1.403-2 +- Target the latest ASP.NET Core version instead of 2.1.1 +- Resolves: rhbz#1636585 + +* Thu Oct 04 2018 Omair Majid - 2.1.403-1 +- Update to .NET Core Runtime 2.1.5 and SDK 2.1.403 +- Resolves: rhbz#1634182 + +* Mon Oct 01 2018 Omair Majid - 2.1.402-5 +- Backport fix to correct order of SSL_CERT_FILE and SSL_CERT_DIR lookup +- Resolves: rhbz#1633742 + +* Thu Sep 27 2018 Omair Majid - 2.1.402-4 +- Add ~/.dotnet/tools to $PATH to make it easier to use dotnet tools +- Resolves: rhbz#1630439 + +* Tue Sep 25 2018 Omair Majid - 2.1.402-3 +- Update .NET Core Runtime 2.1.4 and SDK 2.1.402 +- Resolves: rhbz#1628997 + +* Tue Sep 11 2018 Omair Majid - 2.1.401-3 +- Use standard flags to build .NET Core +- Resolves: rhbz#1624105 + +* Tue Sep 11 2018 Omair Majid - 2.1.401-2 +- Bundle libunwind +- Resolves: rhbz#1626285 + +* Fri Aug 17 2018 Omair Majid - 2.1.401-1 +- Update .NET Core Runtime 2.1.3 and SDK 2.1.401 +- Drop upstreamed patches + +* Mon Aug 06 2018 Omair Majid - 2.1.302-1 +- Initial build. +- Un-SCLized the package. + +* Wed Jul 4 2018 Omair Majid - 2.1.302-1 +- Update to .NET Core Runtime 2.1.2 and SDK 2.1.302 + +* Wed Jun 20 2018 Omair Majid - 2.1.301-5 +- Add sdk-2.1.3xx subpackage + +* Tue Jun 19 2018 Omair Majid - 2.1.301-4 +- Rebuild to pick up new lttng-ust + +* Tue Jun 19 2018 Omair Majid - 2.1.301-3 +- Add workaround for unreadable system certificates +- Resolves: rhbz#1588099 + +* Tue Jun 19 2018 Omair Majid - 2.1.301-2 +- Add updated man pages +- Resolves: rhbz#1584790 + +* Thu Jun 14 2018 Omair Majid - 2.1.301-1 +- Update to .NET Core SDK 2.1.301 + +* Wed May 30 2018 Omair Majid - 2.1.300-7 +- Explicitly require a modified libcurl + +* Tue May 29 2018 Omair Majid - 2.1.300-6 +- Install bash completions in %%{_root_datadir} + +* Mon May 28 2018 Omair Majid - 2.1.300-5 +- Add provides for dotnet-sdk-2.1.3xx + +* Mon May 28 2018 Omair Majid - 2.1.300-4 +- Remove patch for ASP.NET Core templates. No longer needed for 2.1. + +* Fri May 25 2018 Omair Majid - 2.1.300-3 +- Remove net46 symlink + +* Thu May 24 2018 Omair Majid - 2.1.300-2 +- Rebuild to pick up updated dependencies + +* Thu May 24 2018 Omair Majid - 2.1.300-1 +- New package. Import from Fedora (DotNet SIG package).