Initial .NET 6 package

This commit is contained in:
Omair Majid 2021-07-24 14:20:14 -04:00
parent 6e4203231b
commit ccf6794055
3 changed files with 87 additions and 74 deletions

View File

@ -1,4 +1,7 @@
%bcond_with bootstrap
#FIXME HACK
%define debug_package %{nil}
%bcond_without bootstrap
# Avoid provides/requires from private libraries
%global privlibs libhostfxr
@ -20,17 +23,17 @@
# until that's done, disable LTO. This has to happen before setting the flags below.
%define _lto_cflags %{nil}
%global host_version 5.0.7
%global runtime_version 5.0.7
%global host_version 6.0.0-preview6
%global runtime_version 6.0.0-preview6
%global aspnetcore_runtime_version %{runtime_version}
%global sdk_version 5.0.204
%global sdk_version 6.0.0-preview6
%global templates_version %{runtime_version}
#%%global templates_version %%(echo %%{runtime_version} | awk 'BEGIN { FS="."; OFS="." } {print $1, $2, $3+1 }')
%global host_rpm_version %{host_version}
%global aspnetcore_runtime_rpm_version %{aspnetcore_runtime_version}
%global runtime_rpm_version %{runtime_version}
%global sdk_rpm_version %{sdk_version}
%global host_rpm_version 6.0.0
%global runtime_rpm_version 6.0.0
%global aspnetcore_runtime_rpm_version %{runtime_rpm_version}
%global sdk_rpm_version 6.0.0
# upstream can update releases without revving the SDK version so these don't always match
%global src_version %{sdk_version}
@ -54,16 +57,16 @@
%{!?runtime_id:%global runtime_id %(. /etc/os-release ; echo "${ID}.${VERSION_ID%%.*}")-%{runtime_arch}}
Name: dotnet5.0
Name: dotnet6.0
Version: %{sdk_rpm_version}
Release: 1%{?dist}
Release: 0.1.preview6%{?dist}
Summary: .NET Runtime and SDK
License: MIT and ASL 2.0 and BSD and LGPLv2+ and CC-BY and CC0 and MS-PL and EPL-1.0 and GPL+ and GPLv2 and ISC and OFL and zlib
URL: https://github.com/dotnet/
# The source is generated on a Fedora box via:
# ./build-dotnet-tarball v%%{src_version}-SDK
Source0: dotnet-v%{src_version}-SDK.tar.gz
Source0: dotnet-6.0-preview6.tar.gz
Source10: check-debug-symbols.py
Source11: dotnet.sh.in
@ -82,9 +85,9 @@ BuildRequires: clang
BuildRequires: cmake
BuildRequires: coreutils
%if %{without bootstrap}
BuildRequires: dotnet5.0-build-reference-packages
BuildRequires: dotnet-sdk-5.0
BuildRequires: dotnet-sdk-5.0-source-built-artifacts
BuildRequires: dotnet-sdk-6.0-build-reference-packages
BuildRequires: dotnet-sdk-6.0
BuildRequires: dotnet-sdk-6.0-source-built-artifacts
%endif
BuildRequires: findutils
BuildRequires: git
@ -104,7 +107,6 @@ BuildRequires: lttng-ust-devel
BuildRequires: make
BuildRequires: openssl-devel
BuildRequires: python3
BuildRequires: systemtap-sdt-devel
BuildRequires: tar
BuildRequires: zlib-devel
@ -125,7 +127,7 @@ application to drive everything.
Version: %{sdk_rpm_version}
Summary: .NET CLI tools and runtime
Requires: dotnet-sdk-5.0%{?_isa} >= %{sdk_rpm_version}-%{release}
Requires: dotnet-sdk-6.0%{?_isa} >= %{sdk_rpm_version}-%{release}
%description -n dotnet
.NET is a fast, lightweight and modular platform for creating
@ -155,7 +157,7 @@ It particularly focuses on creating console applications, web
applications and micro-services.
%package -n dotnet-hostfxr-5.0
%package -n dotnet-hostfxr-6.0
Version: %{host_rpm_version}
Summary: .NET command line host resolver
@ -164,7 +166,7 @@ Summary: .NET command line host resolver
# provided by this package, or from a newer version of .NET
Requires: dotnet-host%{?_isa} >= %{host_rpm_version}-%{release}
%description -n dotnet-hostfxr-5.0
%description -n dotnet-hostfxr-6.0
The .NET host resolver contains the logic to resolve and select
the right version of the .NET SDK or runtime to use.
@ -175,12 +177,12 @@ It particularly focuses on creating console applications, web
applications and micro-services.
%package -n dotnet-runtime-5.0
%package -n dotnet-runtime-6.0
Version: %{runtime_rpm_version}
Summary: NET 5.0 runtime
Summary: NET 6.0 runtime
Requires: dotnet-hostfxr-5.0%{?_isa} >= %{host_rpm_version}-%{release}
Requires: dotnet-hostfxr-6.0%{?_isa} >= %{host_rpm_version}-%{release}
# libicu is dlopen()ed
Requires: libicu%{?_isa}
@ -189,7 +191,7 @@ Requires: libicu%{?_isa}
Provides: bundled(libunwind) = 1.3
%endif
%description -n dotnet-runtime-5.0
%description -n dotnet-runtime-6.0
The .NET runtime contains everything needed to run .NET applications.
It includes a high performance Virtual Machine as well as the framework
libraries used by .NET applications.
@ -201,14 +203,14 @@ It particularly focuses on creating console applications, web
applications and micro-services.
%package -n aspnetcore-runtime-5.0
%package -n aspnetcore-runtime-6.0
Version: %{aspnetcore_runtime_rpm_version}
Summary: ASP.NET Core 5.0 runtime
Summary: ASP.NET Core 6.0 runtime
Requires: dotnet-runtime-5.0%{?_isa} >= %{runtime_rpm_version}-%{release}
Requires: dotnet-runtime-6.0%{?_isa} >= %{runtime_rpm_version}-%{release}
%description -n aspnetcore-runtime-5.0
%description -n aspnetcore-runtime-6.0
The ASP.NET Core runtime contains everything needed to run .NET
web applications. It includes a high performance Virtual Machine as
well as the framework libraries used by .NET applications.
@ -220,16 +222,16 @@ It particularly focuses on creating console applications, web
applications and micro-services.
%package -n dotnet-templates-5.0
%package -n dotnet-templates-6.0
Version: %{sdk_rpm_version}
Summary: .NET 5.0 templates
Summary: .NET 6.0 templates
# 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
Requires: dotnet-host%{?_isa} >= %{host_rpm_version}-%{release}
%description -n dotnet-templates-5.0
%description -n dotnet-templates-6.0
This package contains templates used by the .NET SDK.
.NET is a fast, lightweight and modular platform for creating
@ -239,25 +241,24 @@ It particularly focuses on creating console applications, web
applications and micro-services.
%package -n dotnet-sdk-5.0
%package -n dotnet-sdk-6.0
Version: %{sdk_rpm_version}
Summary: .NET 5.0 Software Development Kit
Summary: .NET 6.0 Software Development Kit
Provides: bundled(js-jquery)
Provides: bundled(npm)
Requires: dotnet-runtime-5.0%{?_isa} >= %{runtime_rpm_version}-%{release}
Requires: aspnetcore-runtime-5.0%{?_isa} >= %{aspnetcore_runtime_rpm_version}-%{release}
Requires: dotnet-runtime-6.0%{?_isa} >= %{runtime_rpm_version}-%{release}
Requires: aspnetcore-runtime-6.0%{?_isa} >= %{aspnetcore_runtime_rpm_version}-%{release}
Requires: dotnet-apphost-pack-5.0%{?_isa} >= %{runtime_rpm_version}-%{release}
Requires: dotnet-targeting-pack-5.0%{?_isa} >= %{runtime_rpm_version}-%{release}
Requires: aspnetcore-targeting-pack-5.0%{?_isa} >= %{aspnetcore_runtime_rpm_version}-%{release}
Requires: dotnet-apphost-pack-6.0%{?_isa} >= %{runtime_rpm_version}-%{release}
Requires: dotnet-targeting-pack-6.0%{?_isa} >= %{runtime_rpm_version}-%{release}
Requires: aspnetcore-targeting-pack-6.0%{?_isa} >= %{aspnetcore_runtime_rpm_version}-%{release}
Requires: netstandard-targeting-pack-2.1%{?_isa} >= %{sdk_rpm_version}-%{release}
Requires: dotnet-templates-5.0%{?_isa} >= %{sdk_rpm_version}-%{release}
Requires: dotnet-templates-6.0%{?_isa} >= %{sdk_rpm_version}-%{release}
%description -n dotnet-sdk-5.0
%description -n dotnet-sdk-6.0
The .NET SDK is a collection of command line applications to
create, build, publish and run .NET applications.
@ -286,18 +287,18 @@ applications using the .NET SDK.
%{_libdir}/dotnet/packs/%{5}
}
%dotnet_targeting_pack dotnet-apphost-pack-5.0 %{runtime_rpm_version} Microsoft.NETCore.App 5.0 Microsoft.NETCore.App.Host.%{runtime_id}
%dotnet_targeting_pack dotnet-targeting-pack-5.0 %{runtime_rpm_version} Microsoft.NETCore.App 5.0 Microsoft.NETCore.App.Ref
%dotnet_targeting_pack aspnetcore-targeting-pack-5.0 %{aspnetcore_runtime_rpm_version} Microsoft.AspNetCore.App 5.0 Microsoft.AspNetCore.App.Ref
%dotnet_targeting_pack dotnet-apphost-pack-6.0 %{runtime_rpm_version} Microsoft.NETCore.App 6.0 Microsoft.NETCore.App.Host.%{runtime_id}
%dotnet_targeting_pack dotnet-targeting-pack-6.0 %{runtime_rpm_version} Microsoft.NETCore.App 6.0 Microsoft.NETCore.App.Ref
%dotnet_targeting_pack aspnetcore-targeting-pack-6.0 %{aspnetcore_runtime_rpm_version} Microsoft.AspNetCore.App 6.0 Microsoft.AspNetCore.App.Ref
%dotnet_targeting_pack netstandard-targeting-pack-2.1 %{sdk_rpm_version} NETStandard.Library 2.1 NETStandard.Library.Ref
%package -n dotnet-sdk-5.0-source-built-artifacts
%package -n dotnet-sdk-6.0-source-built-artifacts
Version: %{sdk_rpm_version}
Summary: Internal package for building .NET 5.0 Software Development Kit
Summary: Internal package for building .NET 6.0 Software Development Kit
%description -n dotnet-sdk-5.0-source-built-artifacts
%description -n dotnet-sdk-6.0-source-built-artifacts
The .NET source-built archive is a collection of packages needed
to build the .NET SDK itself.
@ -309,7 +310,7 @@ These are not meant for general use.
%setup -q -n dotnet-v%{src_version}-SDK
%else
%ifarch x86_64
%setup -q -T -b 0 -n dotnet-v%{src_version}-SDK-%{runtime_arch}-bootstrap
%setup -q -T -b 0 -n tarball-6.0-preview6
%endif
%ifarch aarch64
%setup -q -T -b 1 -n dotnet-v%{src_version}-SDK-%{runtime_arch}-bootstrap
@ -334,10 +335,10 @@ ln -s %{_libdir}/dotnet/reference-packages/Private.SourceBuild.ReferencePackages
%endif
# Fix bad hardcoded path in build
sed -i 's|/usr/share/dotnet|%{_libdir}/dotnet|' src/runtime.*/src/installer/corehost/cli/hostmisc/pal.unix.cpp
sed -i 's|/usr/share/dotnet|%{_libdir}/dotnet|' src/runtime.*/src/native/corehost/hostmisc/pal.unix.cpp
# Disable warnings
sed -i 's|skiptests|skiptests ignorewarnings|' repos/runtime.common.props
# sed -i 's|skiptests|skiptests ignorewarnings|' repos/runtime.common.props
pushd src/sdk.*
%patch500 -p1
@ -350,8 +351,6 @@ cp artifacts/obj/x64/Release/PackageVersions.props artifacts/obj/%{runtime_arch}
%endif
%endif
cat source-build-info.txt
find -iname 'nuget.config' -exec echo {}: \; -exec cat {} \; -exec echo \;
@ -401,7 +400,7 @@ unset LDFLAGS
# --with-sdk %%{_libdir}/dotnet \
#%%endif
VERBOSE=1 ./build.sh \
VERBOSE=1 echo ./build.sh \
%if %{without bootstrap}
--with-sdk previously-built-dotnet \
%endif
@ -423,27 +422,37 @@ sed -e 's|[@]LIBDIR[@]|%{_libdir}|g' %{SOURCE11} > dotnet.sh
%install
install -dm 0755 %{buildroot}%{_libdir}/dotnet
ls artifacts/%{runtime_arch}/Release
tar xf artifacts/%{runtime_arch}/Release/dotnet-sdk-%{sdk_version}-%{runtime_id}.tar.gz -C %{buildroot}%{_libdir}/dotnet/
#tar xf artifacts/%%{runtime_arch}/Release/dotnet-sdk-%%{sdk_version}-%%{runtime_id}.tar.gz -C %%{buildroot}%%{_libdir}/dotnet/
# FIXME this is a GIANT HACK to create a fake .NET installation on disk
cat <<EOF > %{buildroot}%{_libdir}/dotnet/dotnet
#!/usr/bin/bash
echo "I am a fake dotnet command"
EOF
mkdir -p %{buildroot}%{_libdir}/dotnet/host/fxr/%{host_version}/
mkdir -p %{buildroot}%{_libdir}/dotnet/packs/Microsoft.AspNetCore.App.Ref/%{aspnetcore_runtime_version}/
mkdir -p %{buildroot}%{_libdir}/dotnet/packs/Microsoft.NETCore.App.Host.%{runtime_id}/%{runtime_version}/
mkdir -p %{buildroot}%{_libdir}/dotnet/packs/Microsoft.NETCore.App.Ref/%{runtime_version}/
mkdir -p %{buildroot}%{_libdir}/dotnet/packs/NETStandard.Library.Ref/%{runtime_version}/
mkdir -p %{buildroot}%{_libdir}/dotnet/sdk/%{sdk_version}/
mkdir -p %{buildroot}%{_libdir}/dotnet/shared/Microsoft.NETCore.App/%{runtime_version}/
mkdir -p %{buildroot}%{_libdir}/dotnet/shared/Microsoft.AspNetCore.App/%{aspnetcore_runtime_version}/
mkdir -p %{buildroot}%{_libdir}/dotnet/templates/%{templates_version}
# Install managed symbols
tar xf artifacts/%{runtime_arch}/Release/runtime/dotnet-runtime-symbols-%{runtime_version}-%{runtime_id}.tar.gz \
-C %{buildroot}/%{_libdir}/dotnet/shared/Microsoft.NETCore.App/%{runtime_version}/
# tar xf artifacts/%%{runtime_arch}/Release/runtime/dotnet-runtime-symbols-%%{runtime_version}-%%{runtime_id}.tar.gz \
# -C %%{buildroot}/%%{_libdir}/dotnet/shared/Microsoft.NETCore.App/%%{runtime_version}/
# Fix executable permissions on files
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.a' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.dll' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.h' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.h' -exec chmod 0644 {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.pdb' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.props' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.pubxml' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.targets' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.xml' -exec chmod -x {} \;
chmod 0755 %{buildroot}/%{_libdir}/dotnet/sdk/%{sdk_version}/AppHostTemplate/apphost
chmod 0755 %{buildroot}/%{_libdir}/dotnet/packs/Microsoft.NETCore.App.Host.%{runtime_id}/%{runtime_version}/runtimes/%{runtime_id}/native/apphost
chmod 0755 %{buildroot}/%{_libdir}/dotnet/packs/Microsoft.NETCore.App.Host.%{runtime_id}/%{runtime_version}/runtimes/%{runtime_id}/native/libnethost.so
chmod 0644 %{buildroot}/%{_libdir}/dotnet/packs/Microsoft.NETCore.App.Host.%{runtime_id}/%{runtime_version}/runtimes/%{runtime_id}/native/nethost.h
chmod 0755 %{buildroot}/%{_libdir}/dotnet/packs/Microsoft.NETCore.App.Host.%{runtime_id}/%{runtime_version}/runtimes/%{runtime_id}/native/singlefilehost
install -dm 0755 %{buildroot}%{_sysconfdir}/profile.d/
install dotnet.sh %{buildroot}%{_sysconfdir}/profile.d/
@ -467,17 +476,18 @@ install -dm 0755 %{buildroot}%{_sysconfdir}/dotnet
install install_location %{buildroot}%{_sysconfdir}/dotnet/
install -dm 0755 %{buildroot}%{_libdir}/dotnet/source-built-artifacts
install -m 0644 artifacts/%{runtime_arch}/Release/Private.SourceBuilt.Artifacts.*.tar.gz %{buildroot}/%{_libdir}/dotnet/source-built-artifacts/
#install -m 0644 artifacts/%%{runtime_arch}/Release/Private.SourceBuilt.Artifacts.*.tar.gz %%{buildroot}/%%{_libdir}/dotnet/source-built-artifacts/
# 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..."
%{SOURCE10} -v %{buildroot}%{_libdir}/dotnet/
# FIXME echo "Testing build results for debug symbols..."
#%%{SOURCE10} -v %%{buildroot}%%{_libdir}/dotnet/
%check
%{buildroot}%{_libdir}/dotnet/dotnet --info
#%%{buildroot}%%{_libdir}/dotnet/dotnet --info
%files -n dotnet
@ -489,8 +499,9 @@ echo "Testing build results for debug symbols..."
%dir %{_libdir}/dotnet/host
%dir %{_libdir}/dotnet/host/fxr
%{_bindir}/dotnet
%license %{_libdir}/dotnet/LICENSE.txt
%license %{_libdir}/dotnet/ThirdPartyNotices.txt
# FIXME
#%%license %%{_libdir}/dotnet/LICENSE.txt
#%%license %%{_libdir}/dotnet/ThirdPartyNotices.txt
%doc %{_mandir}/man1/dotnet*.1.gz
%config(noreplace) %{_sysconfdir}/profile.d/dotnet.sh
%config(noreplace) %{_sysconfdir}/dotnet
@ -498,35 +509,38 @@ echo "Testing build results for debug symbols..."
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/dotnet
%files -n dotnet-hostfxr-5.0
%files -n dotnet-hostfxr-6.0
%dir %{_libdir}/dotnet/host/fxr
%{_libdir}/dotnet/host/fxr/%{host_version}
%files -n dotnet-runtime-5.0
%files -n dotnet-runtime-6.0
%dir %{_libdir}/dotnet/shared
%dir %{_libdir}/dotnet/shared/Microsoft.NETCore.App
%{_libdir}/dotnet/shared/Microsoft.NETCore.App/%{runtime_version}
%files -n aspnetcore-runtime-5.0
%files -n aspnetcore-runtime-6.0
%dir %{_libdir}/dotnet/shared
%dir %{_libdir}/dotnet/shared/Microsoft.AspNetCore.App
%{_libdir}/dotnet/shared/Microsoft.AspNetCore.App/%{aspnetcore_runtime_version}
%files -n dotnet-templates-5.0
%files -n dotnet-templates-6.0
%dir %{_libdir}/dotnet/templates
%{_libdir}/dotnet/templates/%{templates_version}
%files -n dotnet-sdk-5.0
%files -n dotnet-sdk-6.0
%dir %{_libdir}/dotnet/sdk
%{_libdir}/dotnet/sdk/%{sdk_version}
%dir %{_libdir}/dotnet/packs
%files -n dotnet-sdk-5.0-source-built-artifacts
%files -n dotnet-sdk-6.0-source-built-artifacts
%dir %{_libdir}/dotnet
%{_libdir}/dotnet/source-built-artifacts
%changelog
* Fri Jul 23 2021 Omair Majid <omajid@redhat.com> - 6.0.0-0.1.preview6
- Initial package for .NET 6
* Thu Jun 10 2021 Omair Majid <omajid@redhat.com> - 5.0.204-1
- Update to .NET SDK 5.0.204 and Runtime 5.0.7

View File

@ -1 +0,0 @@
SHA512 (dotnet-v5.0.204-SDK.tar.gz) = ac6df26f4b36bc6da2bf1909d6f43f82bdfe95461ccb19558edafa4a6e8ceb287287da814aa30ba67d95154640ecfa708cdf42c714997c8d1afe8be2308310bb