Blame SPECS/dotnet.spec

105ad9
# Avoid provides/requires from private libraries
105ad9
%global privlibs             libhostfxr
105ad9
%global privlibs %{privlibs}|libclrjit
105ad9
%global privlibs %{privlibs}|libcoreclr
105ad9
%global privlibs %{privlibs}|libcoreclrtraceptprovider
105ad9
%global privlibs %{privlibs}|libdbgshim
105ad9
%global privlibs %{privlibs}|libhostpolicy
105ad9
%global privlibs %{privlibs}|libmscordaccore
105ad9
%global privlibs %{privlibs}|libmscordbi
105ad9
%global privlibs %{privlibs}|libsos
105ad9
%global privlibs %{privlibs}|libsosplugin
105ad9
%global __provides_exclude ^(%{privlibs})\\.so
105ad9
%global __requires_exclude ^(%{privlibs})\\.so
105ad9
105ad9
# Filter flags not supported by clang/dotnet:
105ad9
#  -fcf-protection is not supported by clang
105ad9
#  -fstack-clash-protection is not supported by clang
105ad9
#  -specs= is not supported by clang
105ad9
#  -fpie is added manually instead of via -specs
105ad9
%global dotnet_cflags %(echo %optflags | sed -e 's/-fcf-protection//' | sed -e 's/-fstack-clash-protection//' | sed -re 's/-specs=[^ ]*//g')
105ad9
%global dotnet_ldflags %(echo %{__global_ldflags} | sed -re 's/-specs=[^ ]*//g')
105ad9
105ad9
%if 0%{?fedora}
105ad9
%global use_bundled_libunwind 0
105ad9
%else
105ad9
%global use_bundled_libunwind 1
105ad9
%endif
105ad9
105ad9
%global simple_name dotnet
105ad9
13553c
%global host_version 2.1.13
13553c
%global runtime_version 2.1.13
13553c
%global sdk_version 2.1.509
105ad9
105ad9
Name:           dotnet
105ad9
Version:        %{sdk_version}
b5b3b1
Release:        2%{?dist}.01
105ad9
Summary:        .NET Core CLI tools and runtime
105ad9
License:        MIT and ASL 2.0 and BSD
105ad9
URL:            https://github.com/dotnet/
105ad9
105ad9
# The source is generated on a RHEL box via:
105ad9
# - git clone https://github.com/dotnet/source-build
105ad9
# - git checkout v%%{sdk_version}
105ad9
# - set environment variables + tweak sources to build
105ad9
# - ./build-source-tarball.sh dotnet-%%{sdk_version}
105ad9
# - tar cvzf dotnet-%%{sdk_version}.tar.gz dotnet-%%{sdk_version}
105ad9
105ad9
Source0:        dotnet-v%{runtime_version}.tar.gz
105ad9
Source1:        check-debug-symbols.py
105ad9
Source2:        dotnet.sh
105ad9
105ad9
Patch10:        corefx-optflags-support.patch
105ad9
Patch11:        corefx-32956-alpn.patch
105ad9
105ad9
Patch100:       coreclr-build-python3.patch
105ad9
Patch101:       coreclr-cmake-python3.patch
105ad9
Patch102:       coreclr-mscorlib.patch
105ad9
Patch103:       coreclr-pie.patch
105ad9
105ad9
Patch300:       core-setup-4510-commit-id.patch
105ad9
Patch301:       core-setup-pie.patch
105ad9
105ad9
Patch400:       cli-telemetry-optout.patch
105ad9
105ad9
ExclusiveArch:  x86_64
105ad9
e9eb67
BuildRequires:  clang
105ad9
BuildRequires:  cmake
105ad9
# Bootstrap SDK needs OpenSSL 1.0 to run, but we can build and then
105ad9
# run with either OpenSSL 1.0 or 1.1
105ad9
%if 0%{?fedora} >= 26 || 0%{?rhel} >= 8
105ad9
BuildRequires:  compat-openssl10
105ad9
%endif
105ad9
BuildRequires:  git
105ad9
BuildRequires:  glibc-langpack-en
105ad9
BuildRequires:  hostname
105ad9
BuildRequires:  krb5-devel
105ad9
BuildRequires:  libcurl-devel
105ad9
BuildRequires:  libicu-devel
105ad9
%if ! %{use_bundled_libunwind}
105ad9
BuildRequires:  libunwind-devel
105ad9
%endif
4af396
BuildRequires:  lldb-devel
4af396
BuildRequires:  llvm
105ad9
BuildRequires:  lttng-ust-devel
105ad9
BuildRequires:  make
105ad9
BuildRequires:  openssl-devel
105ad9
BuildRequires:  python3
105ad9
BuildRequires:  strace
105ad9
BuildRequires:  zlib-devel
105ad9
105ad9
Requires:       %{simple_name}-sdk-2.1%{?_isa} >= %{sdk_version}-%{release}
105ad9
105ad9
%description
105ad9
.NET Core is a fast, lightweight and modular platform for creating
105ad9
cross platform applications that work on Linux, macOS and Windows.
105ad9
105ad9
It particularly focuses on creating console applications, web
105ad9
applications and micro-services.
105ad9
105ad9
.NET Core contains a runtime conforming to .NET Standards a set of
105ad9
framework libraries, an SDK containing compilers and a 'dotnet'
105ad9
application to drive everything.
105ad9
105ad9
105ad9
%package -n %{simple_name}-host
105ad9
105ad9
Version:        %{host_version}
105ad9
Summary:        .NET command line launcher
105ad9
105ad9
%description -n %{simple_name}-host
105ad9
The .NET Core host is a command line program that runs a standalone
105ad9
.NET core application or launches the SDK.
105ad9
105ad9
.NET Core is a fast, lightweight and modular platform for creating
105ad9
cross platform applications that work on Linux, Mac and Windows.
105ad9
105ad9
It particularly focuses on creating console applications, web
105ad9
applications and micro-services.
105ad9
105ad9
105ad9
%package -n %{simple_name}-host-fxr-2.1
105ad9
105ad9
Version:        %{host_version}
105ad9
Summary:        .NET Core command line host resolver
105ad9
105ad9
# Theoretically any version of the host should work. But lets aim for the one
105ad9
# provided by this package, or from a newer version of .NET Core
105ad9
Requires:       %{simple_name}-host%{?_isa} >= %{host_version}-%{release}
105ad9
105ad9
%description -n %{simple_name}-host-fxr-2.1
105ad9
The .NET Core host resolver contains logic to resolve and select the
105ad9
right version of the .NET Core SDK or runtime to use.
105ad9
105ad9
.NET Core is a fast, lightweight and modular platform for creating
105ad9
cross platform applications that work on Linux, Mac and Windows.
105ad9
105ad9
It particularly focuses on creating console applications, web
105ad9
applications and micro-services.
105ad9
105ad9
%package -n %{simple_name}-runtime-2.1
105ad9
105ad9
Version:        %{runtime_version}
105ad9
Summary:        NET Core 2.1 runtime
105ad9
105ad9
Requires:       %{simple_name}-host-fxr-2.1%{?_isa} >= %{host_version}-%{release}
105ad9
105ad9
# libicu is dlopen()ed
105ad9
Requires:       libicu
105ad9
105ad9
%description -n %{simple_name}-runtime-2.1
105ad9
The .NET Core runtime contains everything needed to run .NET Core applications.
105ad9
It includes a high performance Virtual Machine as well as the framework
105ad9
libraries used by .NET Core applications.
105ad9
105ad9
.NET Core is a fast, lightweight and modular platform for creating
105ad9
cross platform applications that work on Linux, Mac and Windows.
105ad9
105ad9
It particularly focuses on creating console applications, web
105ad9
applications and micro-services.
105ad9
105ad9
%package -n %{simple_name}-sdk-2.1
105ad9
105ad9
Version:        %{sdk_version}
105ad9
Summary:        .NET Core 2.1 Software Development Kit
105ad9
105ad9
Requires:       %{simple_name}-sdk-2.1.5xx%{?_isa} >= %{sdk_version}-%{release}
105ad9
105ad9
%description -n %{simple_name}-sdk-2.1
105ad9
The .NET Core SDK is a collection of command line applications to
105ad9
create, build, publish and run .NET Core applications.
105ad9
105ad9
.NET Core is a fast, lightweight and modular platform for creating
105ad9
cross platform applications that work on Linux, Mac and Windows.
105ad9
105ad9
It particularly focuses on creating console applications, web
105ad9
applications and micro-services.
105ad9
105ad9
%package -n %{simple_name}-sdk-2.1.5xx
105ad9
105ad9
Version:        %{sdk_version}
105ad9
Summary:        .NET Core 2.1.5xx Software Development Kit
105ad9
105ad9
Requires:       %{simple_name}-runtime-2.1%{?_isa} >= %{runtime_version}-%{release}
105ad9
105ad9
%description -n %{simple_name}-sdk-2.1.5xx
105ad9
The .NET Core SDK is a collection of command line applications to
105ad9
create, build, publish and run .NET Core applications.
105ad9
105ad9
.NET Core is a fast, lightweight and modular platform for creating
105ad9
cross platform applications that work on Linux, Mac and Windows.
105ad9
105ad9
It particularly focuses on creating console applications, web
105ad9
applications and micro-services.
105ad9
e9eb67
105ad9
%prep
105ad9
%setup -q -n %{simple_name}-v%{runtime_version}
105ad9
105ad9
pushd src/corefx
105ad9
%patch10 -p1
105ad9
%patch11 -p1
105ad9
popd
105ad9
105ad9
pushd src/coreclr
105ad9
%patch100 -p1
105ad9
%patch101 -p1
105ad9
%patch102 -p1
105ad9
%patch103 -p1
105ad9
popd
105ad9
105ad9
pushd src/core-setup
105ad9
%patch300 -p1
105ad9
%patch301 -p1
105ad9
popd
105ad9
105ad9
pushd src/cli
105ad9
%patch400 -p1
105ad9
popd
105ad9
e9eb67
# Fix bad hardcoded path in build
e9eb67
sed -i 's|/usr/share/dotnet|%{_libdir}/%{simple_name}|' src/core-setup/src/corehost/common/pal.unix.cpp
e9eb67
e9eb67
# Disable warnings
e9eb67
sed -i 's|skiptests|skiptests ignorewarnings|' repos/coreclr.proj
e9eb67
105ad9
%if %{use_bundled_libunwind}
105ad9
# Use bundled libunwind
105ad9
sed -i 's|-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE|-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=FALSE|' repos/coreclr.proj
105ad9
%endif
105ad9
e9eb67
cat source-build-info.txt
e9eb67
b5b3b1
find -iname 'nuget.config' -exec echo {} \; -exec cat {} \; -exec echo \;
b5b3b1
105ad9
e9eb67
%build
105ad9
export DOTNET_CLI_TELEMETRY_OPTOUT=1
105ad9
105ad9
export LLVM_HOME=/opt/rh/llvm-toolset-6.0/root/usr
105ad9
export CMAKE_INCLUDE_PATH="/opt/rh/llvm-toolset-6.0/root/usr/include"
105ad9
105ad9
export CFLAGS="%{dotnet_cflags}"
105ad9
export CXXFLAGS="%{dotnet_cflags}"
105ad9
export LDFLAGS="%{dotnet_ldflags}"
105ad9
105ad9
test -f Tools/ilasm/ilasm
105ad9
105ad9
Tools/dotnetcli/dotnet --info
105ad9
105ad9
VERBOSE=1 ./build.sh \
105ad9
  /v:n \
105ad9
  /p:MinimalConsoleLogOutput=false \
105ad9
  /p:ContinueOnPrebuiltBaselineError=true
105ad9
105ad9
105ad9
%install
105ad9
install -d -m 0755 %{buildroot}%{_libdir}/%{simple_name}/
105ad9
ls bin/x64/Release
105ad9
tar xf bin/x64/Release/dotnet-sdk-%{sdk_version}-*.tar.gz -C %{buildroot}%{_libdir}/%{simple_name}/
105ad9
105ad9
# Fix permissions on files
105ad9
find %{buildroot}%{_libdir}/%{simple_name}/ -type f -name '*.props' -exec chmod -x {} \;
105ad9
find %{buildroot}%{_libdir}/%{simple_name}/ -type f -name '*.targets' -exec chmod -x {} \;
105ad9
find %{buildroot}%{_libdir}/%{simple_name}/ -type f -name '*.dll' -exec chmod -x {} \;
105ad9
find %{buildroot}%{_libdir}/%{simple_name}/ -type f -name '*.pubxml' -exec chmod -x {} \;
105ad9
105ad9
# Add ~/.dotnet/tools to $PATH for all users
b5b3b1
install -dm 0755 %{buildroot}%{_sysconfdir}/profile.d/
b5b3b1
install %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d/
105ad9
b5b3b1
install -dm 755 %{buildroot}/%{_datadir}/bash-completion/completions
105ad9
# dynamic completion needs the file to be named the same as the base command
b5b3b1
install src/cli/scripts/register-completions.bash %{buildroot}/%{_datadir}/bash-completion/completions/dotnet
105ad9
105ad9
# TODO: the zsh completion script needs to be ported to use #compdef
105ad9
#install -dm 755 %%{buildroot}/%%{_datadir}/zsh/site-functions
105ad9
#install src/cli/scripts/register-completions.zsh %%{buildroot}/%%{_datadir}/zsh/site-functions/_dotnet
105ad9
b5b3b1
install -d -m 0755 %{buildroot}%{_bindir}
b5b3b1
ln -s %{_libdir}/%{simple_name}/dotnet %{buildroot}%{_bindir}/
105ad9
b5b3b1
install -d -m 0755 %{buildroot}%{_mandir}/man1/
b5b3b1
find -iname 'dotnet*.1' -type f -exec cp {} %{buildroot}%{_mandir}/man1/ \;
105ad9
105ad9
# Check debug symbols in all elf objects. This is not in %%check
105ad9
# because native binaries are stripped by rpm-build after %%install.
105ad9
# So we need to do this check earlier.
105ad9
echo "Testing build results for debug symbols..."
105ad9
%{SOURCE1} -v %{buildroot}%{_libdir}/%{simple_name}/
105ad9
b5b3b1
b5b3b1
%check
105ad9
%{buildroot}%{_libdir}/%{simple_name}/dotnet --info
105ad9
105ad9
b5b3b1
%files -n %{simple_name}
b5b3b1
# empty package useful for dependencies
b5b3b1
b5b3b1
%files -n %{simple_name}-host
b5b3b1
%dir %{_libdir}/%{simple_name}
b5b3b1
%{_libdir}/%{simple_name}/dotnet
b5b3b1
%dir %{_libdir}/%{simple_name}/host
b5b3b1
%dir %{_libdir}/%{simple_name}/host/fxr
b5b3b1
%{_bindir}/dotnet
b5b3b1
%license %{_libdir}/%{simple_name}/LICENSE.txt
b5b3b1
%license %{_libdir}/%{simple_name}/ThirdPartyNotices.txt
b5b3b1
%doc %{_mandir}/man1/dotnet*.1.gz
b5b3b1
%{_sysconfdir}/profile.d/dotnet.sh
b5b3b1
%dir %{_datadir}/bash-completion
b5b3b1
%dir %{_datadir}/bash-completion/completions
b5b3b1
%{_datadir}/bash-completion/completions/dotnet
105ad9
105ad9
%files -n %{simple_name}-host-fxr-2.1
105ad9
%dir %{_libdir}/%{simple_name}/host/fxr
105ad9
%{_libdir}/%{simple_name}/host/fxr/%{host_version}
105ad9
105ad9
%files -n %{simple_name}-runtime-2.1
105ad9
%dir %{_libdir}/%{simple_name}/shared
105ad9
%dir %{_libdir}/%{simple_name}/shared/Microsoft.NETCore.App
105ad9
%{_libdir}/%{simple_name}/shared/Microsoft.NETCore.App/%{runtime_version}
105ad9
105ad9
%files -n %{simple_name}-sdk-2.1
105ad9
# empty package useful for dependencies
105ad9
105ad9
%files -n %{simple_name}-sdk-2.1.5xx
105ad9
%dir %{_libdir}/%{simple_name}/sdk
105ad9
%{_libdir}/%{simple_name}/sdk/%{sdk_version}
105ad9
105ad9
%changelog
b5b3b1
* Mon Jan 23 2020 Johnny Hughes <johnny@centos.org> - 2.1.599-2.0.1
b5b3b1
- Bump ENVR for rebuild
13553c
b5b3b1
* Fri Aug 30 2019 Omair Majid <omajid@redhat.com> - 2.1.509-1
b5b3b1
- Update to .NET Core Runtime 2.1.13 and SDK 2.1.509
b5b3b1
- Resolves: RHBZ#1747874
7b136d
b5b3b1
* Mon Jul 15 2019 Omair Majid <omajid@redhat.com> - 2.1.508-1
e9eb67
- Update to .NET Core Runtime 2.1.12 and SDK 2.1.508
b5b3b1
- Resolves: RHBZ#1729752
e9eb67
b5b3b1
* Wed May 22 2019 Omair Majid <omajid@redhat.com> - 2.1.507-3
b5b3b1
- Use updated build dependencies for clang/llvm/lldb
b5b3b1
- Resolves: RHBZ#1712874
e9eb67
b5b3b1
* Tue May 21 2019 Omair Majid <omajid@redhat.com> - 2.1.507-2
e9eb67
- Link against strerror_r correctly
b5b3b1
- Resolves: RHBZ#1712471
e9eb67
b5b3b1
* Mon May 13 2019 Omair Majid <omajid@redhat.com> - 2.1.507-1
e9eb67
- Update to .NET Core Runtime 2.1.11 and SDK 2.1.507
b5b3b1
- Resolves: RHBZ#1710068
e9eb67
b5b3b1
* Thu May 02 2019 Omair Majid <omajid@redhat.com> - 2.1.506-1
e9eb67
- Update to .NET Core Runtime 2.1.10 and SDK 2.1.506
b5b3b1
- Resolves: RHBZ#1696836
e9eb67
105ad9
* Fri Feb 22 2019 Omair Majid <omajid@redhat.com> - 2.1.504-1
105ad9
- Update to .NET Core Runtime 2.1.8 and SDK 2.1.504
105ad9
- Sync with Fedora copr spec file
105ad9
- Resolves: RHBZ#1646713
105ad9
105ad9
* Fri Oct 12 2018 Omair Majid <omajid@redhat.com> - 2.1.403-4
105ad9
- Disable telemetry via code, not just environment variable
105ad9
- Resolves: rhbz#1638093
105ad9
105ad9
* Thu Oct 11 2018 Omair Majid <omajid@redhat.com> - 2.1.403-3
105ad9
- Disable telemetry by default
105ad9
- Resolves: rhbz#1638093
105ad9
105ad9
* Wed Oct 10 2018 Omair Majid <omajid@redhat.com> - 2.1.403-2
105ad9
- Target the latest ASP.NET Core version instead of 2.1.1
105ad9
- Resolves: rhbz#1636585
105ad9
105ad9
* Thu Oct 04 2018 Omair Majid <omajid@redhat.com> - 2.1.403-1
105ad9
- Update to .NET Core Runtime 2.1.5 and SDK 2.1.403
105ad9
- Resolves: rhbz#1634182
105ad9
105ad9
* Mon Oct 01 2018 Omair Majid <omajid@redhat.com> - 2.1.402-5
105ad9
- Backport fix to correct order of SSL_CERT_FILE and SSL_CERT_DIR lookup
105ad9
- Resolves: rhbz#1633742
105ad9
105ad9
* Thu Sep 27 2018 Omair Majid <omajid@redhat.com> - 2.1.402-4
105ad9
- Add ~/.dotnet/tools to $PATH to make it easier to use dotnet tools
105ad9
- Resolves: rhbz#1630439
105ad9
105ad9
* Tue Sep 25 2018 Omair Majid <omajid@redhat.com> - 2.1.402-3
105ad9
- Update .NET Core Runtime 2.1.4 and SDK 2.1.402
105ad9
- Resolves: rhbz#1628997
105ad9
105ad9
* Tue Sep 11 2018 Omair Majid <omajid@redhat.com> - 2.1.401-3
105ad9
- Use standard flags to build .NET Core
105ad9
- Resolves: rhbz#1624105
105ad9
105ad9
* Tue Sep 11 2018 Omair Majid <omajid@redhat.com> - 2.1.401-2
105ad9
- Bundle libunwind
105ad9
- Resolves: rhbz#1626285
105ad9
105ad9
* Fri Aug 17 2018 Omair Majid <omajid@redhat.com> - 2.1.401-1
105ad9
- Update .NET Core Runtime 2.1.3 and SDK 2.1.401
105ad9
- Drop upstreamed patches
105ad9
105ad9
* Mon Aug 06 2018 Omair Majid <omajid@redhat.com> - 2.1.302-1
105ad9
- Initial build.
105ad9
- Un-SCLized the package.
105ad9
105ad9
* Wed Jul 4 2018 Omair Majid <omajid@redhat.com> - 2.1.302-1
105ad9
- Update to .NET Core Runtime 2.1.2 and SDK 2.1.302
105ad9
105ad9
* Wed Jun 20 2018 Omair Majid <omajid@redhat.com> - 2.1.301-5
105ad9
- Add sdk-2.1.3xx subpackage
105ad9
105ad9
* Tue Jun 19 2018 Omair Majid <omajid@redhat.com> - 2.1.301-4
105ad9
- Rebuild to pick up new lttng-ust
105ad9
105ad9
* Tue Jun 19 2018 Omair Majid <omajid@redhat.com> - 2.1.301-3
105ad9
- Add workaround for unreadable system certificates
105ad9
- Resolves: rhbz#1588099
105ad9
105ad9
* Tue Jun 19 2018 Omair Majid <omajid@redhat.com> - 2.1.301-2
105ad9
- Add updated man pages
105ad9
- Resolves: rhbz#1584790
105ad9
105ad9
* Thu Jun 14 2018 Omair Majid <omajid@redhat.com> - 2.1.301-1
105ad9
- Update to .NET Core SDK 2.1.301
105ad9
105ad9
* Wed May 30 2018 Omair Majid <omajid@redhat.com> - 2.1.300-7
105ad9
- Explicitly require a modified libcurl
105ad9
105ad9
* Tue May 29 2018 Omair Majid <omajid@redhat.com> - 2.1.300-6
105ad9
- Install bash completions in %%{_root_datadir}
105ad9
105ad9
* Mon May 28 2018 Omair Majid <omajid@redhat.com> - 2.1.300-5
105ad9
- Add provides for dotnet-sdk-2.1.3xx
105ad9
105ad9
* Mon May 28 2018 Omair Majid <omajid@redhat.com> - 2.1.300-4
105ad9
- Remove patch for ASP.NET Core templates. No longer needed for 2.1.
105ad9
105ad9
* Fri May 25 2018 Omair Majid <omajid@redhat.com> - 2.1.300-3
105ad9
- Remove net46 symlink
105ad9
105ad9
* Thu May 24 2018 Omair Majid <omajid@redhat.com> - 2.1.300-2
105ad9
- Rebuild to pick up updated dependencies
105ad9
105ad9
* Thu May 24 2018 Omair Majid <omajid@redhat.com> - 2.1.300-1
105ad9
- New package. Import from Fedora (DotNet SIG package).